Title: [137107] trunk/Source/WebCore
Revision
137107
Author
[email protected]
Date
2012-12-09 21:39:08 -0800 (Sun, 09 Dec 2012)

Log Message

REGRESSION (r137003): failures in MicroData tests on EFL, GTK
https://bugs.webkit.org/show_bug.cgi?id=104469

Reviewed by Darin Adler.

Fix the regression by calling propertyNodeList on HTMLPropertiesCollection
in the named getter for HTMLCollection. It's a miracle that the old code prior to r137003
worked at all since the return type of namedItem was different.

Existing tests cover this.

* bindings/js/JSHTMLCollectionCustom.cpp:
(WebCore::JSHTMLCollection::nameGetter):
* bindings/v8/custom/V8HTMLCollectionCustom.cpp:
(WebCore::V8HTMLCollection::namedPropertyGetter):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (137106 => 137107)


--- trunk/Source/WebCore/ChangeLog	2012-12-10 05:09:57 UTC (rev 137106)
+++ trunk/Source/WebCore/ChangeLog	2012-12-10 05:39:08 UTC (rev 137107)
@@ -1,3 +1,21 @@
+2012-12-09  Ryosuke Niwa  <[email protected]>
+
+        REGRESSION (r137003): failures in MicroData tests on EFL, GTK
+        https://bugs.webkit.org/show_bug.cgi?id=104469
+
+        Reviewed by Darin Adler.
+
+        Fix the regression by calling propertyNodeList on HTMLPropertiesCollection
+        in the named getter for HTMLCollection. It's a miracle that the old code prior to r137003
+        worked at all since the return type of namedItem was different.
+
+        Existing tests cover this.
+
+        * bindings/js/JSHTMLCollectionCustom.cpp:
+        (WebCore::JSHTMLCollection::nameGetter):
+        * bindings/v8/custom/V8HTMLCollectionCustom.cpp:
+        (WebCore::V8HTMLCollection::namedPropertyGetter):
+
 2012-12-09  Joanmarie Diggs  <[email protected]>
 
         [GTK] accessibility/placeholder.html is failing

Modified: trunk/Source/WebCore/bindings/js/JSHTMLCollectionCustom.cpp (137106 => 137107)


--- trunk/Source/WebCore/bindings/js/JSHTMLCollectionCustom.cpp	2012-12-10 05:09:57 UTC (rev 137106)
+++ trunk/Source/WebCore/bindings/js/JSHTMLCollectionCustom.cpp	2012-12-10 05:39:08 UTC (rev 137107)
@@ -24,6 +24,7 @@
 #include "HTMLCollection.h"
 #include "HTMLFormControlsCollection.h"
 #include "HTMLOptionsCollection.h"
+#include "HTMLPropertiesCollection.h"
 #include "JSDOMBinding.h"
 #include "JSHTMLAllCollection.h"
 #include "JSHTMLFormControlsCollection.h"
@@ -32,6 +33,7 @@
 #include "JSNodeList.h"
 #include "JSRadioNodeList.h"
 #include "Node.h"
+#include "PropertyNodeList.h"
 #include "RadioNodeList.h"
 #include "StaticNodeList.h"
 #include <wtf/Vector.h>
@@ -50,7 +52,12 @@
 {
     JSHTMLCollection* collection = jsCast<JSHTMLCollection*>(asObject(slotBase));
     const AtomicString& name = propertyNameToAtomicString(propertyName);
-    return toJS(exec, collection->globalObject(), collection->impl()->namedItem(name));
+    HTMLCollection* impl = collection->impl();
+#if ENABLE(MICRODATA)
+    if (impl->type() == ItemProperties)
+        return toJS(exec, collection->globalObject(), static_cast<HTMLPropertiesCollection*>(impl)->propertyNodeList(name));
+#endif
+    return toJS(exec, collection->globalObject(), impl->namedItem(name));
 }
 
 JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, HTMLCollection* collection)

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (137106 => 137107)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2012-12-10 05:09:57 UTC (rev 137106)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2012-12-10 05:39:08 UTC (rev 137107)
@@ -2452,7 +2452,11 @@
             push(@implContent, "JSValue ${className}::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)\n");
             push(@implContent, "{\n");
             push(@implContent, "    ${className}* thisObj = jsCast<$className*>(asObject(slotBase));\n");
-            push(@implContent, "    return toJS(exec, thisObj->globalObject(), static_cast<$interfaceName*>(thisObj->impl())->namedItem(propertyNameToAtomicString(propertyName)));\n");
+            if ($interfaceName eq "HTMLPropertiesCollection") {
+                push(@implContent, "    return toJS(exec, thisObj->globalObject(), static_cast<$interfaceName*>(thisObj->impl())->propertyNodeList(propertyNameToAtomicString(propertyName)));\n");
+            } else {
+                push(@implContent, "    return toJS(exec, thisObj->globalObject(), static_cast<$interfaceName*>(thisObj->impl())->namedItem(propertyNameToAtomicString(propertyName)));\n");
+            }
             push(@implContent, "}\n\n");
         }
     }

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm (137106 => 137107)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm	2012-12-10 05:09:57 UTC (rev 137106)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm	2012-12-10 05:39:08 UTC (rev 137107)
@@ -2747,7 +2747,11 @@
             $indexer = $function->signature;
         }
 
-        if ($function->signature->name eq "namedItem") {
+        if ($interfaceName eq "HTMLPropertiesCollection") {
+            if ($function->signature->name eq "propertyNodeList") {
+                $namedPropertyGetter = $function->signature;
+            }
+        } elsif ($function->signature->name eq "namedItem") {
             $namedPropertyGetter = $function->signature;
         }
 

Modified: trunk/Source/WebCore/bindings/v8/custom/V8HTMLCollectionCustom.cpp (137106 => 137107)


--- trunk/Source/WebCore/bindings/v8/custom/V8HTMLCollectionCustom.cpp	2012-12-10 05:09:57 UTC (rev 137106)
+++ trunk/Source/WebCore/bindings/v8/custom/V8HTMLCollectionCustom.cpp	2012-12-10 05:39:08 UTC (rev 137107)
@@ -32,6 +32,8 @@
 #include "V8HTMLCollection.h"
 
 #include "HTMLCollection.h"
+#include "HTMLPropertiesCollection.h"
+#include "PropertyNodeList.h"
 #include "V8Binding.h"
 #include "V8HTMLAllCollection.h"
 #include "V8HTMLFormControlsCollection.h"
@@ -51,6 +53,14 @@
         return v8Undefined();
 
     HTMLCollection* imp = V8HTMLCollection::toNative(info.Holder());
+#if ENABLE(MICRODATA)
+    if (imp->type() == ItemProperties) {
+        PropertyNodeList* item = static_cast<HTMLPropertiesCollection*>(imp)->propertyNodeList(toWebCoreAtomicString(name));
+        if (!item)
+            return v8Undefined();
+        return toV8(item, info.Holder(), info.GetIsolate());
+    }
+#endif
     Node* item = imp->namedItem(toWebCoreAtomicString(name));
     if (!item)
         return v8Undefined();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to