Skip to content
Permalink
Browse files
DOMHTMLOptionsCollection is missing some implementation.
https://bugs.webkit.org/show_bug.cgi?id=31488

Reviewed by Dan Bernstein.

* DOMHTMLClasses.cpp:
(DOMHTMLOptionsCollection::DOMHTMLOptionsCollection):
Initialize m_collection.
(DOMHTMLOptionsCollection::createInstance):
Create a DOMHTMLOptionsCollection. If we fail to query for
IDOMHTMLOptionsCollection, delete it, and return 0. Otherwise, return
the result.
(DOMHTMLOptionsCollection::length):
(DOMHTMLOptionsCollection::item):
Create a DOMNode for the WebCore Node. If this is 0, return E_FAIL.
(DOMHTMLOptionsCollection::namedItem):
Correct the signature of this function.

* DOMHTMLClasses.h:
Declare DOMHTMLOptionsCollection::createInstance(). Correct the
signature of namedItem() to match IDOMHTMLOptionsCollection. Add a
member to DOMHTMLOptionsCollection to hold the WebCore object.

Canonical link: https://commits.webkit.org/42520@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@51091 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Jon Honeycutt committed Nov 17, 2009
1 parent 1b88d00 commit a33f3c286d0d24ba22e2a06a413408478a88bdaa
Showing with 72 additions and 9 deletions.
  1. +26 −0 WebKit/win/ChangeLog
  2. +36 −8 WebKit/win/DOMHTMLClasses.cpp
  3. +10 −1 WebKit/win/DOMHTMLClasses.h
@@ -1,3 +1,29 @@
2009-11-12 Jon Honeycutt <jhoneycutt@apple.com>

DOMHTMLOptionsCollection is missing some implementation.

https://bugs.webkit.org/show_bug.cgi?id=31488

Reviewed by Dan Bernstein.

* DOMHTMLClasses.cpp:
(DOMHTMLOptionsCollection::DOMHTMLOptionsCollection):
Initialize m_collection.
(DOMHTMLOptionsCollection::createInstance):
Create a DOMHTMLOptionsCollection. If we fail to query for
IDOMHTMLOptionsCollection, delete it, and return 0. Otherwise, return
the result.
(DOMHTMLOptionsCollection::length):
(DOMHTMLOptionsCollection::item):
Create a DOMNode for the WebCore Node. If this is 0, return E_FAIL.
(DOMHTMLOptionsCollection::namedItem):
Correct the signature of this function.

* DOMHTMLClasses.h:
Declare DOMHTMLOptionsCollection::createInstance(). Correct the
signature of namedItem() to match IDOMHTMLOptionsCollection. Add a
member to DOMHTMLOptionsCollection to hold the WebCore object.

2009-11-12 Jon Honeycutt <jhoneycutt@apple.com>

DOMHTMLInputElement::rectOnScreen() returns the wrong rect
@@ -39,6 +39,7 @@
#include <WebCore/HTMLInputElement.h>
#include <WebCore/HTMLNames.h>
#include <WebCore/HTMLOptionElement.h>
#include <WebCore/HTMLOptionsCollection.h>
#include <WebCore/HTMLSelectElement.h>
#include <WebCore/HTMLTextAreaElement.h>
#include <WebCore/IntRect.h>
@@ -134,11 +135,34 @@ HRESULT STDMETHODCALLTYPE DOMHTMLOptionsCollection::QueryInterface(REFIID riid,

// DOMHTMLOptionsCollection ---------------------------------------------------

DOMHTMLOptionsCollection::DOMHTMLOptionsCollection(WebCore::HTMLOptionsCollection* collection)
: m_collection(collection)
{
}

IDOMHTMLOptionsCollection* DOMHTMLOptionsCollection::createInstance(WebCore::HTMLOptionsCollection* collection)
{
if (!collection)
return 0;

IDOMHTMLOptionsCollection* optionsCollection = 0;
DOMHTMLOptionsCollection* newCollection = new DOMHTMLOptionsCollection(collection);
if (FAILED(newCollection->QueryInterface(IID_IDOMHTMLOptionsCollection, (void**)&optionsCollection))) {
delete newCollection;
return 0;
}

return optionsCollection;
}

HRESULT STDMETHODCALLTYPE DOMHTMLOptionsCollection::length(
/* [retval][out] */ unsigned int* /*result*/)
/* [retval][out] */ unsigned int* result)
{
ASSERT_NOT_REACHED();
return E_NOTIMPL;
if (!result)
return E_POINTER;

*result = m_collection->length();
return S_OK;
}

HRESULT STDMETHODCALLTYPE DOMHTMLOptionsCollection::setLength(
@@ -149,16 +173,20 @@ HRESULT STDMETHODCALLTYPE DOMHTMLOptionsCollection::setLength(
}

HRESULT STDMETHODCALLTYPE DOMHTMLOptionsCollection::item(
/* [in] */ unsigned int /*index*/,
/* [retval][out] */ IDOMNode** /*result*/)
/* [in] */ unsigned int index,
/* [retval][out] */ IDOMNode** result)
{
ASSERT_NOT_REACHED();
return E_NOTIMPL;
if (!result)
return E_POINTER;

*result = DOMNode::createInstance(m_collection->item(index));

return *result ? S_OK : E_FAIL;
}

HRESULT STDMETHODCALLTYPE DOMHTMLOptionsCollection::namedItem(
/* [in] */ BSTR /*name*/,
/* [retval][out] */ IDOMNode* /*result*/)
/* [retval][out] */ IDOMNode** /*result*/)
{
ASSERT_NOT_REACHED();
return E_NOTIMPL;
@@ -34,6 +34,7 @@

namespace WebCore {
class HTMLCollection;
class HTMLOptionsCollection;
}

class DOMHTMLCollection : public DOMObject, public IDOMHTMLCollection
@@ -99,6 +100,9 @@ class DOMHTMLCollection : public DOMObject, public IDOMHTMLCollection

class DOMHTMLOptionsCollection : public DOMObject, public IDOMHTMLOptionsCollection
{
public:
static IDOMHTMLOptionsCollection* createInstance(WebCore::HTMLOptionsCollection*);

// IUnknown
virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject);
virtual ULONG STDMETHODCALLTYPE AddRef(void) { return DOMObject::AddRef(); }
@@ -149,7 +153,12 @@ class DOMHTMLOptionsCollection : public DOMObject, public IDOMHTMLOptionsCollect

virtual HRESULT STDMETHODCALLTYPE namedItem(
/* [in] */ BSTR name,
/* [retval][out] */ IDOMNode *result);
/* [retval][out] */ IDOMNode **result);

private:
DOMHTMLOptionsCollection(WebCore::HTMLOptionsCollection*);

RefPtr<WebCore::HTMLOptionsCollection> m_collection;
};

class DOMHTMLDocument : public DOMDocument, public IDOMHTMLDocument

0 comments on commit a33f3c2

Please sign in to comment.