Changeset 51091 in webkit
- Timestamp:
- Nov 17, 2009 3:37:37 PM (14 years ago)
- Location:
- trunk/WebKit/win
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/win/ChangeLog
r51090 r51091 1 2009-11-12 Jon Honeycutt <jhoneycutt@apple.com> 2 3 DOMHTMLOptionsCollection is missing some implementation. 4 5 https://bugs.webkit.org/show_bug.cgi?id=31488 6 7 Reviewed by Dan Bernstein. 8 9 * DOMHTMLClasses.cpp: 10 (DOMHTMLOptionsCollection::DOMHTMLOptionsCollection): 11 Initialize m_collection. 12 (DOMHTMLOptionsCollection::createInstance): 13 Create a DOMHTMLOptionsCollection. If we fail to query for 14 IDOMHTMLOptionsCollection, delete it, and return 0. Otherwise, return 15 the result. 16 (DOMHTMLOptionsCollection::length): 17 (DOMHTMLOptionsCollection::item): 18 Create a DOMNode for the WebCore Node. If this is 0, return E_FAIL. 19 (DOMHTMLOptionsCollection::namedItem): 20 Correct the signature of this function. 21 22 * DOMHTMLClasses.h: 23 Declare DOMHTMLOptionsCollection::createInstance(). Correct the 24 signature of namedItem() to match IDOMHTMLOptionsCollection. Add a 25 member to DOMHTMLOptionsCollection to hold the WebCore object. 26 1 27 2009-11-12 Jon Honeycutt <jhoneycutt@apple.com> 2 28 -
trunk/WebKit/win/DOMHTMLClasses.cpp
r51090 r51091 40 40 #include <WebCore/HTMLNames.h> 41 41 #include <WebCore/HTMLOptionElement.h> 42 #include <WebCore/HTMLOptionsCollection.h> 42 43 #include <WebCore/HTMLSelectElement.h> 43 44 #include <WebCore/HTMLTextAreaElement.h> … … 135 136 // DOMHTMLOptionsCollection --------------------------------------------------- 136 137 138 DOMHTMLOptionsCollection::DOMHTMLOptionsCollection(WebCore::HTMLOptionsCollection* collection) 139 : m_collection(collection) 140 { 141 } 142 143 IDOMHTMLOptionsCollection* DOMHTMLOptionsCollection::createInstance(WebCore::HTMLOptionsCollection* collection) 144 { 145 if (!collection) 146 return 0; 147 148 IDOMHTMLOptionsCollection* optionsCollection = 0; 149 DOMHTMLOptionsCollection* newCollection = new DOMHTMLOptionsCollection(collection); 150 if (FAILED(newCollection->QueryInterface(IID_IDOMHTMLOptionsCollection, (void**)&optionsCollection))) { 151 delete newCollection; 152 return 0; 153 } 154 155 return optionsCollection; 156 } 157 137 158 HRESULT STDMETHODCALLTYPE DOMHTMLOptionsCollection::length( 138 /* [retval][out] */ unsigned int* /*result*/) 139 { 140 ASSERT_NOT_REACHED(); 141 return E_NOTIMPL; 159 /* [retval][out] */ unsigned int* result) 160 { 161 if (!result) 162 return E_POINTER; 163 164 *result = m_collection->length(); 165 return S_OK; 142 166 } 143 167 … … 150 174 151 175 HRESULT STDMETHODCALLTYPE DOMHTMLOptionsCollection::item( 152 /* [in] */ unsigned int /*index*/, 153 /* [retval][out] */ IDOMNode** /*result*/) 154 { 155 ASSERT_NOT_REACHED(); 156 return E_NOTIMPL; 176 /* [in] */ unsigned int index, 177 /* [retval][out] */ IDOMNode** result) 178 { 179 if (!result) 180 return E_POINTER; 181 182 *result = DOMNode::createInstance(m_collection->item(index)); 183 184 return *result ? S_OK : E_FAIL; 157 185 } 158 186 159 187 HRESULT STDMETHODCALLTYPE DOMHTMLOptionsCollection::namedItem( 160 188 /* [in] */ BSTR /*name*/, 161 /* [retval][out] */ IDOMNode* /*result*/)189 /* [retval][out] */ IDOMNode** /*result*/) 162 190 { 163 191 ASSERT_NOT_REACHED(); -
trunk/WebKit/win/DOMHTMLClasses.h
r30180 r51091 35 35 namespace WebCore { 36 36 class HTMLCollection; 37 class HTMLOptionsCollection; 37 38 } 38 39 … … 100 101 class DOMHTMLOptionsCollection : public DOMObject, public IDOMHTMLOptionsCollection 101 102 { 103 public: 104 static IDOMHTMLOptionsCollection* createInstance(WebCore::HTMLOptionsCollection*); 105 102 106 // IUnknown 103 107 virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject); … … 150 154 virtual HRESULT STDMETHODCALLTYPE namedItem( 151 155 /* [in] */ BSTR name, 152 /* [retval][out] */ IDOMNode *result); 156 /* [retval][out] */ IDOMNode **result); 157 158 private: 159 DOMHTMLOptionsCollection(WebCore::HTMLOptionsCollection*); 160 161 RefPtr<WebCore::HTMLOptionsCollection> m_collection; 153 162 }; 154 163
Note: See TracChangeset
for help on using the changeset viewer.