<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[188523] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/188523">188523</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2015-08-17 09:46:41 -0700 (Mon, 17 Aug 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Accessing HTMLCollection.length is slow
https://bugs.webkit.org/show_bug.cgi?id=148039

Reviewed by Ryosuke Niwa.

Source/WebCore:

Accessing was HTMLCollection.length is slow, much slower than accessing
NodeList.length. The reason is that HTMLCollection's bindings code is
slightly different. In particular, HTMLCollection's GetOwnPropertySlot()
has an extra check to see if the PropertyName is available on the
prototype before doing:
1. Check static properties (getStaticValueSlotEntryWithoutCaching())
2. Indexed getter
3. Named getter
4. Check own properties (getStaticValueSlot())

This means that everytime the JavaScript was accessing HTMLCollection.length
or HTMLCollection[index], we would check if length / index was present on the
prototype before calling HTMLCollection::length() / HTMLCollection::item(i).
The prototype check is fairly expensive and was making traversing an
HTMLCollection much slower than traversing a NodeList.

In this patch, I refactored GetOwnPropertySlot() to do:
1. Indexed getter
2. Check static properties
3. Prototype check
4. Named getter
5. Check own properties

This way, the prototype check is no longer slowing down HTMLCollection
traversal. What matters is that we do the prototype check *before* calling
the named getter as we don't want named properties to mask properties on
the prototype.

Note that this patch takes the minimal approach to get the performance win
while limiting the risk of breakage. Indeed, the current behavior still
does not match the WebIDL specification, which seems to indicate the order
should be:
1. Indexed getter
2. Check static / own properties
3. Prototype check
4. Named getter

Once we match the specification, I believe we will be able to drop the
JSC::HasImpureGetOwnPropertySlot flag on HTMLCollection, which currently
makes HTMLCollection.length not cacheable. Right now, I believe we still
need this flag because named properties can still mask own properties.

Performance:
/Bindings/childNodes-traversal: 5597.54 +/- 0.7% -&gt; 5572.10 +/- 0.4%
/Bindings/children-traversal: 3852.61 +/- 0.3% -&gt; 4731.03 +/- 0.3% (~23% better)

Test: fast/dom/htmlcollection-getownproperty.html

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateGetOwnPropertySlotBody):
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::JSTestEventTarget::getOwnPropertySlot):

LayoutTests:

* fast/dom/htmlcollection-getownproperty-expected.txt: Added.
* fast/dom/htmlcollection-getownproperty.html: Added.
Add new layout test covering the expected behavior of HTMLCollection's
[[GetOwnProperty]]. A few checks are still failing as we don't entirely
match the specification yet.

* fast/dom/wrapper-classes-expected.txt:
Rebaseline test as a few more checks are now passing.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastdomwrapperclassesexpectedtxt">trunk/LayoutTests/fast/dom/wrapper-classes-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestEventTargetcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastdomhtmlcollectiongetownpropertyexpectedtxt">trunk/LayoutTests/fast/dom/htmlcollection-getownproperty-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomhtmlcollectiongetownpropertyhtml">trunk/LayoutTests/fast/dom/htmlcollection-getownproperty.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (188522 => 188523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-08-17 15:36:16 UTC (rev 188522)
+++ trunk/LayoutTests/ChangeLog        2015-08-17 16:46:41 UTC (rev 188523)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2015-08-17  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Accessing HTMLCollection.length is slow
+        https://bugs.webkit.org/show_bug.cgi?id=148039
+
+        Reviewed by Ryosuke Niwa.
+
+        * fast/dom/htmlcollection-getownproperty-expected.txt: Added.
+        * fast/dom/htmlcollection-getownproperty.html: Added.
+        Add new layout test covering the expected behavior of HTMLCollection's
+        [[GetOwnProperty]]. A few checks are still failing as we don't entirely
+        match the specification yet.
+
+        * fast/dom/wrapper-classes-expected.txt:
+        Rebaseline test as a few more checks are now passing.
+
</ins><span class="cx"> 2015-08-15  Alexey Proskuryakov  &lt;ap@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Removed an expectation for http/tests/media/video-buffered-range-contains-currentTime.html,
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomhtmlcollectiongetownpropertyexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/htmlcollection-getownproperty-expected.txt (0 => 188523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/htmlcollection-getownproperty-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/dom/htmlcollection-getownproperty-expected.txt        2015-08-17 16:46:41 UTC (rev 188523)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+Tests that the behavior of HTMLCollection's [[GetOwnProperty]] conforms to Web IDL
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+* Named properties should not mask properties on the prototype
+PASS htmlCollection.namedItem('toString') is document.getElementById('toStringP')
+PASS htmlCollection.toString is HTMLCollection.prototype.toString
+
+* Named properties should not mask static properties on HTMLCollection
+PASS htmlCollection.namedItem('length') is document.getElementById('lengthP')
+PASS htmlCollection.length is 4
+
+* Named properties should not mask own properties on HTMLCollection
+htmlCollection.foo = 'foo'
+PASS htmlCollection.namedItem('foo') is document.getElementById('fooP')
+FAIL htmlCollection.foo should be foo (of type string). Was [object HTMLParagraphElement] (of type object).
+
+* Named properties should not mask indexed properties
+PASS htmlCollection.item(0) is testDiv.firstElementChild
+PASS htmlCollection[0] is testDiv.firstElementChild
+PASS htmlCollection.namedItem('0') is document.getElementById('0P')
+PASS htmlCollection['0'] is testDiv.firstElementChild
+
+* Own properties on HTMLCollection should mask properties on prototype
+htmlCollection.toString = 'InstanceToString'
+FAIL htmlCollection.toString should be InstanceToString (of type string). Was function toString() {
+    [native code]
+} (of type function).
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomhtmlcollectiongetownpropertyhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/htmlcollection-getownproperty.html (0 => 188523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/htmlcollection-getownproperty.html                                (rev 0)
+++ trunk/LayoutTests/fast/dom/htmlcollection-getownproperty.html        2015-08-17 16:46:41 UTC (rev 188523)
</span><span class="lines">@@ -0,0 +1,47 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;div id=&quot;testDiv&quot;&gt;
+&lt;p name=&quot;toString&quot; id=&quot;toStringP&quot;&gt;&lt;/p&gt;
+&lt;p name=&quot;length&quot; id=&quot;lengthP&quot;&gt;&lt;/p&gt;
+&lt;p name=&quot;foo&quot; id=&quot;fooP&quot;&gt;&lt;/p&gt;
+&lt;p name=&quot;0&quot; id=&quot;0P&quot;&gt;&lt;/p&gt;
+&lt;/div&gt;
+&lt;script&gt;
+description(&quot;Tests that the behavior of HTMLCollection's [[GetOwnProperty]] conforms to Web IDL&quot;);
+
+var testDiv = document.getElementById(&quot;testDiv&quot;);
+var htmlCollection = testDiv.children;
+
+debug(&quot;* Named properties should not mask properties on the prototype&quot;);
+shouldBe(&quot;htmlCollection.namedItem('toString')&quot;, &quot;document.getElementById('toStringP')&quot;);
+shouldBe(&quot;htmlCollection.toString&quot;, &quot;HTMLCollection.prototype.toString&quot;);
+
+debug(&quot;&quot;);
+debug(&quot;* Named properties should not mask static properties on HTMLCollection&quot;);
+shouldBe(&quot;htmlCollection.namedItem('length')&quot;, &quot;document.getElementById('lengthP')&quot;);
+shouldBe(&quot;htmlCollection.length&quot;, &quot;4&quot;);
+
+debug(&quot;&quot;);
+debug(&quot;* Named properties should not mask own properties on HTMLCollection&quot;);
+evalAndLog(&quot;htmlCollection.foo = 'foo'&quot;);
+shouldBe(&quot;htmlCollection.namedItem('foo')&quot;, &quot;document.getElementById('fooP')&quot;)
+shouldBeEqualToString(&quot;htmlCollection.foo&quot;, &quot;foo&quot;);
+
+debug(&quot;&quot;);
+debug(&quot;* Named properties should not mask indexed properties&quot;);
+shouldBe(&quot;htmlCollection.item(0)&quot;, &quot;testDiv.firstElementChild&quot;);
+shouldBe(&quot;htmlCollection[0]&quot;, &quot;testDiv.firstElementChild&quot;);
+shouldBe(&quot;htmlCollection.namedItem('0')&quot;, &quot;document.getElementById('0P')&quot;);
+shouldBe(&quot;htmlCollection['0']&quot;, &quot;testDiv.firstElementChild&quot;);
+
+debug(&quot;&quot;);
+debug(&quot;* Own properties on HTMLCollection should mask properties on prototype&quot;);
+evalAndLog(&quot;htmlCollection.toString = 'InstanceToString'&quot;);
+shouldBeEqualToString(&quot;htmlCollection.toString&quot;, &quot;InstanceToString&quot;);
+
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomwrapperclassesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/wrapper-classes-expected.txt (188522 => 188523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/wrapper-classes-expected.txt        2015-08-17 15:36:16 UTC (rev 188522)
+++ trunk/LayoutTests/fast/dom/wrapper-classes-expected.txt        2015-08-17 16:46:41 UTC (rev 188523)
</span><span class="lines">@@ -19,7 +19,7 @@
</span><span class="cx"> PASS jsWrapperClass(document.implementation.constructor) is 'DOMImplementationConstructor'
</span><span class="cx"> PASS jsWrapperClass(root.attributes) is 'NamedNodeMap'
</span><span class="cx"> PASS jsWrapperClass(root.attributes.__proto__) is 'NamedNodeMapPrototype'
</span><del>-FAIL jsWrapperClass(root.attributes.constructor) should be NamedNodeMapConstructor. Was Function.
</del><ins>+PASS jsWrapperClass(root.attributes.constructor) is 'NamedNodeMapConstructor'
</ins><span class="cx"> PASS jsWrapperClass(document.createNodeIterator(root, 0, null, false)) is 'NodeIterator'
</span><span class="cx"> PASS jsWrapperClass(document.createNodeIterator(root, 0, null, false).__proto__) is 'NodeIteratorPrototype'
</span><span class="cx"> PASS jsWrapperClass(document.createNodeIterator(root, 0, null, false).constructor) is 'NodeIteratorConstructor'
</span><span class="lines">@@ -136,7 +136,7 @@
</span><span class="cx"> 
</span><span class="cx"> PASS jsWrapperClass(root.children) is 'HTMLCollection'
</span><span class="cx"> PASS jsWrapperClass(root.children.__proto__) is 'HTMLCollectionPrototype'
</span><del>-FAIL jsWrapperClass(root.children.constructor) should be HTMLCollectionConstructor. Was Function.
</del><ins>+PASS jsWrapperClass(root.children.constructor) is 'HTMLCollectionConstructor'
</ins><span class="cx"> PASS jsWrapperClass(document) is 'HTMLDocument'
</span><span class="cx"> PASS jsWrapperClass(document.__proto__) is 'HTMLDocumentPrototype'
</span><span class="cx"> PASS jsWrapperClass(document.constructor) is 'HTMLDocumentConstructor'
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (188522 => 188523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-08-17 15:36:16 UTC (rev 188522)
+++ trunk/Source/WebCore/ChangeLog        2015-08-17 16:46:41 UTC (rev 188523)
</span><span class="lines">@@ -1,3 +1,63 @@
</span><ins>+2015-08-17  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Accessing HTMLCollection.length is slow
+        https://bugs.webkit.org/show_bug.cgi?id=148039
+
+        Reviewed by Ryosuke Niwa.
+
+        Accessing was HTMLCollection.length is slow, much slower than accessing
+        NodeList.length. The reason is that HTMLCollection's bindings code is
+        slightly different. In particular, HTMLCollection's GetOwnPropertySlot()
+        has an extra check to see if the PropertyName is available on the
+        prototype before doing:
+        1. Check static properties (getStaticValueSlotEntryWithoutCaching())
+        2. Indexed getter
+        3. Named getter
+        4. Check own properties (getStaticValueSlot())
+
+        This means that everytime the JavaScript was accessing HTMLCollection.length
+        or HTMLCollection[index], we would check if length / index was present on the
+        prototype before calling HTMLCollection::length() / HTMLCollection::item(i).
+        The prototype check is fairly expensive and was making traversing an
+        HTMLCollection much slower than traversing a NodeList.
+
+        In this patch, I refactored GetOwnPropertySlot() to do:
+        1. Indexed getter
+        2. Check static properties
+        3. Prototype check
+        4. Named getter
+        5. Check own properties
+
+        This way, the prototype check is no longer slowing down HTMLCollection
+        traversal. What matters is that we do the prototype check *before* calling
+        the named getter as we don't want named properties to mask properties on
+        the prototype.
+
+        Note that this patch takes the minimal approach to get the performance win
+        while limiting the risk of breakage. Indeed, the current behavior still
+        does not match the WebIDL specification, which seems to indicate the order
+        should be:
+        1. Indexed getter
+        2. Check static / own properties
+        3. Prototype check
+        4. Named getter
+
+        Once we match the specification, I believe we will be able to drop the
+        JSC::HasImpureGetOwnPropertySlot flag on HTMLCollection, which currently
+        makes HTMLCollection.length not cacheable. Right now, I believe we still
+        need this flag because named properties can still mask own properties.
+
+        Performance:
+        /Bindings/childNodes-traversal: 5597.54 +/- 0.7% -&gt; 5572.10 +/- 0.4%
+        /Bindings/children-traversal: 3852.61 +/- 0.3% -&gt; 4731.03 +/- 0.3% (~23% better)
+
+        Test: fast/dom/htmlcollection-getownproperty.html
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateGetOwnPropertySlotBody):
+        * bindings/scripts/test/JS/JSTestEventTarget.cpp:
+        (WebCore::JSTestEventTarget::getOwnPropertySlot):
+
</ins><span class="cx"> 2015-08-17  Jinyoung Hur  &lt;hur.ims@navercorp.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Fix possible EGL and GLX makeCurrent problem of GLPlatformContext and GLPlatformSurface
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (188522 => 188523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2015-08-17 15:36:16 UTC (rev 188522)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2015-08-17 16:46:41 UTC (rev 188523)
</span><span class="lines">@@ -381,12 +381,6 @@
</span><span class="cx"> 
</span><span class="cx">     my @getOwnPropertySlotImpl = ();
</span><span class="cx"> 
</span><del>-    if ($interfaceName eq &quot;NamedNodeMap&quot; or $interfaceName =~ /^HTML\w*Collection$/) {
-        push(@getOwnPropertySlotImpl, &quot;    ${namespaceMaybe}JSValue proto = thisObject-&gt;prototype();\n&quot;);
-        push(@getOwnPropertySlotImpl, &quot;    if (proto.isObject() &amp;&amp; jsCast&lt;${namespaceMaybe}JSObject*&gt;(proto)-&gt;hasProperty(exec, propertyName))\n&quot;);
-        push(@getOwnPropertySlotImpl, &quot;        return false;\n\n&quot;);
-    }
-
</del><span class="cx">     my $manualLookupGetterGeneration = sub {
</span><span class="cx">         my $requiresManualLookup = $indexedGetterFunction || $namedGetterFunction;
</span><span class="cx">         if ($requiresManualLookup) {
</span><span class="lines">@@ -398,10 +392,6 @@
</span><span class="cx">         }
</span><span class="cx">     };
</span><span class="cx"> 
</span><del>-    if (!$interface-&gt;extendedAttributes-&gt;{&quot;CustomNamedGetter&quot;} and InstanceAttributeCount($interface) &gt; 0) {
-        &amp;$manualLookupGetterGeneration();
-    }
-
</del><span class="cx">     if ($indexedGetterFunction) {
</span><span class="cx">         push(@getOwnPropertySlotImpl, &quot;    Optional&lt;uint32_t&gt; optionalIndex = parseIndex(propertyName);\n&quot;);
</span><span class="cx"> 
</span><span class="lines">@@ -424,6 +414,17 @@
</span><span class="cx">         push(@getOwnPropertySlotImpl, &quot;    }\n&quot;);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    if (!$interface-&gt;extendedAttributes-&gt;{&quot;CustomNamedGetter&quot;} and InstanceAttributeCount($interface) &gt; 0) {
+        &amp;$manualLookupGetterGeneration();
+    }
+
+    # FIXME: We should do this for every interface for every interface that has a named getter.
+    if ($interfaceName eq &quot;NamedNodeMap&quot; or $interfaceName =~ /^HTML\w*Collection$/) {
+        push(@getOwnPropertySlotImpl, &quot;    ${namespaceMaybe}JSValue proto = thisObject-&gt;prototype();\n&quot;);
+        push(@getOwnPropertySlotImpl, &quot;    if (proto.isObject() &amp;&amp; jsCast&lt;${namespaceMaybe}JSObject*&gt;(proto)-&gt;hasProperty(exec, propertyName))\n&quot;);
+        push(@getOwnPropertySlotImpl, &quot;        return false;\n\n&quot;);
+    }
+
</ins><span class="cx">     if ($namedGetterFunction || $interface-&gt;extendedAttributes-&gt;{&quot;CustomNamedGetter&quot;}) {
</span><span class="cx">         push(@getOwnPropertySlotImpl, &quot;    if (canGetItemsForName(exec, &amp;thisObject-&gt;impl(), propertyName)) {\n&quot;);
</span><span class="cx">         push(@getOwnPropertySlotImpl, &quot;        slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, thisObject-&gt;nameGetter);\n&quot;);
</span><span class="lines">@@ -446,6 +447,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if ($hasAttributes) {
</span><ins>+        # FIXME: We are supposed to check for own properties *before* calling the named getter.
</ins><span class="cx">         if ($inlined) {
</span><span class="cx">             push(@getOwnPropertySlotImpl, &quot;    return ${namespaceMaybe}getStaticValueSlot&lt;$className, Base&gt;(exec, *info()-&gt;staticPropHashTable, thisObject, propertyName, slot);\n&quot;);
</span><span class="cx">         } else {
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestEventTargetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp (188522 => 188523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp        2015-08-17 15:36:16 UTC (rev 188522)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp        2015-08-17 16:46:41 UTC (rev 188523)
</span><span class="lines">@@ -176,11 +176,6 @@
</span><span class="cx"> {
</span><span class="cx">     auto* thisObject = jsCast&lt;JSTestEventTarget*&gt;(object);
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(thisObject, info());
</span><del>-    const HashTableValue* entry = getStaticValueSlotEntryWithoutCaching&lt;JSTestEventTarget&gt;(exec, propertyName);
-    if (entry) {
-        slot.setCacheableCustom(thisObject, entry-&gt;attributes(), entry-&gt;propertyGetter());
-        return true;
-    }
</del><span class="cx">     Optional&lt;uint32_t&gt; optionalIndex = parseIndex(propertyName);
</span><span class="cx">     if (optionalIndex &amp;&amp; optionalIndex.value() &lt; thisObject-&gt;impl().length()) {
</span><span class="cx">         unsigned index = optionalIndex.value();
</span><span class="lines">@@ -188,6 +183,11 @@
</span><span class="cx">         slot.setValue(thisObject, attributes, toJS(exec, thisObject-&gt;globalObject(), thisObject-&gt;impl().item(index)));
</span><span class="cx">         return true;
</span><span class="cx">     }
</span><ins>+    const HashTableValue* entry = getStaticValueSlotEntryWithoutCaching&lt;JSTestEventTarget&gt;(exec, propertyName);
+    if (entry) {
+        slot.setCacheableCustom(thisObject, entry-&gt;attributes(), entry-&gt;propertyGetter());
+        return true;
+    }
</ins><span class="cx">     if (canGetItemsForName(exec, &amp;thisObject-&gt;impl(), propertyName)) {
</span><span class="cx">         slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, thisObject-&gt;nameGetter);
</span><span class="cx">         return true;
</span></span></pre>
</div>
</div>

</body>
</html>