[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

jhoneycutt at apple.com jhoneycutt at apple.com
Wed Apr 7 23:45:49 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit d057b0ae4fbd3486bf7daf37cfbe709ba127f8fa
Author: jhoneycutt at apple.com <jhoneycutt at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Nov 17 23:37:37 2009 +0000

    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.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51091 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog
index 684bf07..1eee4ce 100644
--- a/WebKit/win/ChangeLog
+++ b/WebKit/win/ChangeLog
@@ -1,5 +1,31 @@
 2009-11-12  Jon Honeycutt  <jhoneycutt at 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 at apple.com>
+
         DOMHTMLInputElement::rectOnScreen() returns the wrong rect
 
         https://bugs.webkit.org/show_bug.cgi?id=31487
diff --git a/WebKit/win/DOMHTMLClasses.cpp b/WebKit/win/DOMHTMLClasses.cpp
index 11ee323..5e24333 100644
--- a/WebKit/win/DOMHTMLClasses.cpp
+++ b/WebKit/win/DOMHTMLClasses.cpp
@@ -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;
diff --git a/WebKit/win/DOMHTMLClasses.h b/WebKit/win/DOMHTMLClasses.h
index ddc3dd1..18fa8fa 100644
--- a/WebKit/win/DOMHTMLClasses.h
+++ b/WebKit/win/DOMHTMLClasses.h
@@ -34,6 +34,7 @@
 
 namespace WebCore {
     class HTMLCollection;
+    class HTMLOptionsCollection;
 }
 
 class DOMHTMLCollection : public DOMObject, public IDOMHTMLCollection
@@ -99,6 +100,9 @@ protected:
 
 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

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list