<!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>[190280] 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/190280">190280</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2015-09-28 10:43:49 -0700 (Mon, 28 Sep 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Object.getOwnPropertyNames() does not return named properties
https://bugs.webkit.org/show_bug.cgi?id=149562
&lt;rdar://problem/22879779&gt;

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline existing W3C tests now that Object.getOwnPropertyNames()
returns named properties for HTMLCollection. We unfortunately still
don't pass those because 'length' / 'constructor' properties are
currently on the instance and they should be on the prototype.

* web-platform-tests/dom/collections/HTMLCollection-supported-property-names-expected.txt:
* web-platform-tests/dom/nodes/Document-getElementsByTagName-expected.txt:
* web-platform-tests/dom/nodes/Element-getElementsByTagName-expected.txt:
* web-platform-tests/html/dom/documents/dom-tree-accessors/document.forms-expected.txt:

Source/WebCore:

Previously, Object.getOwnPropertyNames() did not return named properties
for interfaces with named property getters. This patch adds support for
this in the JS bindings generator and uses it for HTMLCollection only
for now. Other interfaces will be taken care of independently.

Note that currently, even though the named properties are returned by
Object.getOwnPropertyNames(), these properties are still not enumerated.
This is because these are always unenumerable for existing DOM interfaces:
- https://dom.spec.whatwg.org/#interface-htmlcollection
- https://dom.spec.whatwg.org/#namednodemap

In the future, we may need to extend support if some interfaces require
those to be enumerable.

Test: fast/dom/htmlcollection-getownpropertynames.html

* Modules/mediastream/RTCStatsResponse.cpp:
(WebCore::WebCore::RTCStatsResponse::supportedPropertyNames):
* Modules/mediastream/RTCStatsResponse.h:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateImplementation):
* css/StyleSheetList.cpp:
(WebCore::StyleSheetList::supportedPropertyNames):
* css/StyleSheetList.h:
* dom/DOMNamedFlowCollection.cpp:
(WebCore::DOMNamedFlowCollection::supportedPropertyNames):
* dom/DOMNamedFlowCollection.h:
* dom/NamedNodeMap.cpp:
(WebCore::NamedNodeMap::supportedPropertyNames):
* dom/NamedNodeMap.h:
* html/HTMLCollection.cpp:
(WebCore::HTMLCollection::supportedPropertyNames):
* html/HTMLCollection.h:
(WebCore::CollectionNamedElementCache::propertyNames):
(WebCore::CollectionNamedElementCache::appendToIdCache):
(WebCore::CollectionNamedElementCache::appendToNameCache):
(WebCore::CollectionNamedElementCache::memoryCost):
(WebCore::CollectionNamedElementCache::append):
* plugins/DOMMimeTypeArray.cpp:
(WebCore::DOMMimeTypeArray::supportedPropertyNames):
* plugins/DOMMimeTypeArray.h:
* plugins/DOMPlugin.cpp:
(WebCore::DOMPlugin::supportedPropertyNames):
* plugins/DOMPlugin.h:
* plugins/DOMPluginArray.cpp:
(WebCore::DOMPluginArray::supportedPropertyNames):
* plugins/DOMPluginArray.h:

LayoutTests:

Add layout test that verifies that Object.getOwnPropertyNames() returns
an HTMLCollection's named properties, in addition to its indexes. It
also checks that they are not enumerable, as per the DOM specification.

* fast/dom/htmlcollection-getownpropertynames-expected.txt: Added.
* fast/dom/htmlcollection-getownpropertynames.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsdomcollectionsHTMLCollectionsupportedpropertynamesexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/dom/collections/HTMLCollection-supported-property-names-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsdomnodesDocumentgetElementsByTagNameexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-getElementsByTagName-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsdomnodesElementgetElementsByTagNameexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Element-getElementsByTagName-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmldomdocumentsdomtreeaccessorsdocumentformsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/document.forms-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamRTCStatsResponsecpp">trunk/Source/WebCore/Modules/mediastream/RTCStatsResponse.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamRTCStatsResponseh">trunk/Source/WebCore/Modules/mediastream/RTCStatsResponse.h</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>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestOverrideBuiltinscpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestOverrideBuiltinsh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.h</a></li>
<li><a href="#trunkSourceWebCorecssStyleSheetListcpp">trunk/Source/WebCore/css/StyleSheetList.cpp</a></li>
<li><a href="#trunkSourceWebCorecssStyleSheetListh">trunk/Source/WebCore/css/StyleSheetList.h</a></li>
<li><a href="#trunkSourceWebCoredomDOMNamedFlowCollectioncpp">trunk/Source/WebCore/dom/DOMNamedFlowCollection.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDOMNamedFlowCollectionh">trunk/Source/WebCore/dom/DOMNamedFlowCollection.h</a></li>
<li><a href="#trunkSourceWebCoredomNamedNodeMapcpp">trunk/Source/WebCore/dom/NamedNodeMap.cpp</a></li>
<li><a href="#trunkSourceWebCoredomNamedNodeMaph">trunk/Source/WebCore/dom/NamedNodeMap.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLCollectioncpp">trunk/Source/WebCore/html/HTMLCollection.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLCollectionh">trunk/Source/WebCore/html/HTMLCollection.h</a></li>
<li><a href="#trunkSourceWebCorepluginsDOMMimeTypeArraycpp">trunk/Source/WebCore/plugins/DOMMimeTypeArray.cpp</a></li>
<li><a href="#trunkSourceWebCorepluginsDOMMimeTypeArrayh">trunk/Source/WebCore/plugins/DOMMimeTypeArray.h</a></li>
<li><a href="#trunkSourceWebCorepluginsDOMPlugincpp">trunk/Source/WebCore/plugins/DOMPlugin.cpp</a></li>
<li><a href="#trunkSourceWebCorepluginsDOMPluginh">trunk/Source/WebCore/plugins/DOMPlugin.h</a></li>
<li><a href="#trunkSourceWebCorepluginsDOMPluginArraycpp">trunk/Source/WebCore/plugins/DOMPluginArray.cpp</a></li>
<li><a href="#trunkSourceWebCorepluginsDOMPluginArrayh">trunk/Source/WebCore/plugins/DOMPluginArray.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastdomhtmlcollectiongetownpropertynamesexpectedtxt">trunk/LayoutTests/fast/dom/htmlcollection-getownpropertynames-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomhtmlcollectiongetownpropertynameshtml">trunk/LayoutTests/fast/dom/htmlcollection-getownpropertynames.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (190279 => 190280)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-09-28 17:33:19 UTC (rev 190279)
+++ trunk/LayoutTests/ChangeLog        2015-09-28 17:43:49 UTC (rev 190280)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2015-09-28  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Object.getOwnPropertyNames() does not return named properties
+        https://bugs.webkit.org/show_bug.cgi?id=149562
+        &lt;rdar://problem/22879779&gt;
+
+        Reviewed by Darin Adler.
+
+        Add layout test that verifies that Object.getOwnPropertyNames() returns
+        an HTMLCollection's named properties, in addition to its indexes. It
+        also checks that they are not enumerable, as per the DOM specification.
+
+        * fast/dom/htmlcollection-getownpropertynames-expected.txt: Added.
+        * fast/dom/htmlcollection-getownpropertynames.html: Added.
+
</ins><span class="cx"> 2015-09-28  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Update bug numbers for failing test expectations in fast/shadow-dom.
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomhtmlcollectiongetownpropertynamesexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/htmlcollection-getownpropertynames-expected.txt (0 => 190280)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/htmlcollection-getownpropertynames-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/dom/htmlcollection-getownpropertynames-expected.txt        2015-09-28 17:43:49 UTC (rev 190280)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+Tests that HTMLCollection's named properties returned by Object.getOwnPropertyNames() but not enumerable.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+* Own properties
+Actual:   ['0', '1', '2', '3', '4', '5', '6', '7', 'some-id', 'some-name', 'another-id', 'another-name', 'constructor', 'length']
+Expected: ['0', '1', '2', '3', '4', '5', '6', '7', 'some-id', 'some-name', 'another-id', 'another-name']
+
+* Enumerated properties
+Actual:   ['0', '1', '2', '3', '4', '5', '6', '7', 'length', 'item', 'namedItem']
+Expected: ['0', '1', '2', '3', '4', '5', '6', '7', 'length', 'item', 'namedItem']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomhtmlcollectiongetownpropertynameshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/htmlcollection-getownpropertynames.html (0 => 190280)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/htmlcollection-getownpropertynames.html                                (rev 0)
+++ trunk/LayoutTests/fast/dom/htmlcollection-getownpropertynames.html        2015-09-28 17:43:49 UTC (rev 190280)
</span><span class="lines">@@ -0,0 +1,61 @@
</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;playground&quot;&gt;
+    &lt;!-- with no attribute --&gt;
+    &lt;span&gt;&lt;/span&gt;
+
+    &lt;!-- with `id` attribute --&gt;
+    &lt;span id=''&gt;&lt;/span&gt;
+    &lt;span id='some-id'&gt;&lt;/span&gt;
+    &lt;span id='some-id'&gt;&lt;/span&gt;&lt;!-- to ensure no duplicates --&gt;
+
+    &lt;!-- with `name` attribute --&gt;
+    &lt;span name=''&gt;&lt;/span&gt;
+    &lt;span name='some-name'&gt;&lt;/span&gt;
+    &lt;span name='some-name'&gt;&lt;/span&gt;&lt;!-- to ensure no duplicates --&gt;
+
+    &lt;!-- with `name` and `id` attribute --&gt;
+    &lt;span id='another-id' name='another-name'&gt;&lt;/span&gt;
+&lt;/div&gt;
+&lt;script&gt;
+description(&quot;Tests that HTMLCollection's named properties returned by Object.getOwnPropertyNames() but not enumerable.&quot;);
+
+var playground = document.getElementById(&quot;playground&quot;);
+var elements = playground.getElementsByTagName(&quot;span&quot;);
+
+debug(&quot;* Own properties&quot;);
+var ownProperties = Object.getOwnPropertyNames(elements);
+var result = &quot;[&quot;;
+var isFirst = true;
+for (var i = 0; i &lt; ownProperties.length; i++) {
+    if (isFirst)
+        isFirst = false;
+    else
+       result += &quot;, &quot;;
+    result += &quot;'&quot; + ownProperties[i] + &quot;'&quot;;
+}
+result += &quot;]&quot;;
+debug(&quot;Actual:   &quot; + result);
+debug(&quot;Expected: ['0', '1', '2', '3', '4', '5', '6', '7', 'some-id', 'some-name', 'another-id', 'another-name']&quot;);
+
+debug(&quot;&quot;);
+debug(&quot;* Enumerated properties&quot;);
+result = &quot;[&quot;;
+isFirst = true;
+for (var property in elements) {
+    if (isFirst)
+        isFirst = false;
+    else
+       result += &quot;, &quot;;
+    result += &quot;'&quot; + property + &quot;'&quot;;
+}
+result += &quot;]&quot;;
+debug(&quot;Actual:   &quot; + result);
+debug(&quot;Expected: ['0', '1', '2', '3', '4', '5', '6', '7', 'length', 'item', 'namedItem']&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="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (190279 => 190280)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2015-09-28 17:33:19 UTC (rev 190279)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2015-09-28 17:43:49 UTC (rev 190280)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2015-09-28  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Object.getOwnPropertyNames() does not return named properties
+        https://bugs.webkit.org/show_bug.cgi?id=149562
+        &lt;rdar://problem/22879779&gt;
+
+        Reviewed by Darin Adler.
+
+        Rebaseline existing W3C tests now that Object.getOwnPropertyNames()
+        returns named properties for HTMLCollection. We unfortunately still
+        don't pass those because 'length' / 'constructor' properties are
+        currently on the instance and they should be on the prototype.
+
+        * web-platform-tests/dom/collections/HTMLCollection-supported-property-names-expected.txt:
+        * web-platform-tests/dom/nodes/Document-getElementsByTagName-expected.txt:
+        * web-platform-tests/dom/nodes/Element-getElementsByTagName-expected.txt:
+        * web-platform-tests/html/dom/documents/dom-tree-accessors/document.forms-expected.txt:
+
</ins><span class="cx"> 2015-09-24  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Node.replaceChild() does not behave according to the specification
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsdomcollectionsHTMLCollectionsupportedpropertynamesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/collections/HTMLCollection-supported-property-names-expected.txt (190279 => 190280)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/collections/HTMLCollection-supported-property-names-expected.txt        2015-09-28 17:33:19 UTC (rev 190279)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/collections/HTMLCollection-supported-property-names-expected.txt        2015-09-28 17:43:49 UTC (rev 190280)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> 
</span><del>-FAIL Object.getOwnPropertyNames on HTMLCollection assert_array_equals: lengths differ, expected 12 got 10
</del><ins>+FAIL Object.getOwnPropertyNames on HTMLCollection assert_array_equals: lengths differ, expected 12 got 14
</ins><span class="cx"> FAIL Object.getOwnPropertyNames on HTMLCollection with non-HTML namespace assert_array_equals: lengths differ, expected 1 got 3
</span><span class="cx"> FAIL Object.getOwnPropertyNames on HTMLCollection with expando object assert_array_equals: lengths differ, expected 2 got 4
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsdomnodesDocumentgetElementsByTagNameexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-getElementsByTagName-expected.txt (190279 => 190280)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-getElementsByTagName-expected.txt        2015-09-28 17:33:19 UTC (rev 190279)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-getElementsByTagName-expected.txt        2015-09-28 17:43:49 UTC (rev 190280)
</span><span class="lines">@@ -8,7 +8,7 @@
</span><span class="cx">     }&quot; did not throw
</span><span class="cx"> PASS Should be able to set expando shadowing a proto prop (item) 
</span><span class="cx"> PASS Should be able to set expando shadowing a proto prop (namedItem) 
</span><del>-FAIL hasOwnProperty, getOwnPropertyDescriptor, getOwnPropertyNames assert_array_equals: lengths differ, expected 2 got 3
</del><ins>+FAIL hasOwnProperty, getOwnPropertyDescriptor, getOwnPropertyNames assert_array_equals: lengths differ, expected 2 got 4
</ins><span class="cx"> PASS HTML element with uppercase tagName never matches in HTML Documents 
</span><span class="cx"> PASS Element in non-HTML namespace, no prefix, lowercase name 
</span><span class="cx"> PASS Element in non-HTML namespace, no prefix, uppercase name 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsdomnodesElementgetElementsByTagNameexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Element-getElementsByTagName-expected.txt (190279 => 190280)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Element-getElementsByTagName-expected.txt        2015-09-28 17:33:19 UTC (rev 190279)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Element-getElementsByTagName-expected.txt        2015-09-28 17:43:49 UTC (rev 190280)
</span><span class="lines">@@ -8,7 +8,7 @@
</span><span class="cx">     }&quot; did not throw
</span><span class="cx"> PASS Should be able to set expando shadowing a proto prop (item) 
</span><span class="cx"> PASS Should be able to set expando shadowing a proto prop (namedItem) 
</span><del>-FAIL hasOwnProperty, getOwnPropertyDescriptor, getOwnPropertyNames assert_array_equals: lengths differ, expected 2 got 3
</del><ins>+FAIL hasOwnProperty, getOwnPropertyDescriptor, getOwnPropertyNames assert_array_equals: lengths differ, expected 2 got 4
</ins><span class="cx"> PASS HTML element with uppercase tagName never matches in HTML Documents 
</span><span class="cx"> PASS Element in non-HTML namespace, no prefix, lowercase name 
</span><span class="cx"> PASS Element in non-HTML namespace, no prefix, uppercase name 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmldomdocumentsdomtreeaccessorsdocumentformsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/document.forms-expected.txt (190279 => 190280)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/document.forms-expected.txt        2015-09-28 17:33:19 UTC (rev 190279)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/document.forms-expected.txt        2015-09-28 17:43:49 UTC (rev 190280)
</span><span class="lines">@@ -5,5 +5,5 @@
</span><span class="cx"> PASS document.forms.item with string arg 
</span><span class="cx"> PASS document.forms with empty string 
</span><span class="cx"> FAIL document.forms iteration assert_array_equals: property 3, expected &quot;item&quot; but got &quot;length&quot;
</span><del>-FAIL document.forms getOwnPropertyNames assert_array_equals: property 3, expected &quot;form1&quot; but got &quot;constructor&quot;
</del><ins>+FAIL document.forms getOwnPropertyNames assert_array_equals: lengths differ, expected 5 got 7
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (190279 => 190280)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-09-28 17:33:19 UTC (rev 190279)
+++ trunk/Source/WebCore/ChangeLog        2015-09-28 17:43:49 UTC (rev 190280)
</span><span class="lines">@@ -1,3 +1,60 @@
</span><ins>+2015-09-28  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Object.getOwnPropertyNames() does not return named properties
+        https://bugs.webkit.org/show_bug.cgi?id=149562
+        &lt;rdar://problem/22879779&gt;
+
+        Reviewed by Darin Adler.
+
+        Previously, Object.getOwnPropertyNames() did not return named properties
+        for interfaces with named property getters. This patch adds support for
+        this in the JS bindings generator and uses it for HTMLCollection only
+        for now. Other interfaces will be taken care of independently.
+
+        Note that currently, even though the named properties are returned by
+        Object.getOwnPropertyNames(), these properties are still not enumerated.
+        This is because these are always unenumerable for existing DOM interfaces:
+        - https://dom.spec.whatwg.org/#interface-htmlcollection
+        - https://dom.spec.whatwg.org/#namednodemap
+
+        In the future, we may need to extend support if some interfaces require
+        those to be enumerable.
+
+        Test: fast/dom/htmlcollection-getownpropertynames.html
+
+        * Modules/mediastream/RTCStatsResponse.cpp:
+        (WebCore::WebCore::RTCStatsResponse::supportedPropertyNames):
+        * Modules/mediastream/RTCStatsResponse.h:
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateHeader):
+        (GenerateImplementation):
+        * css/StyleSheetList.cpp:
+        (WebCore::StyleSheetList::supportedPropertyNames):
+        * css/StyleSheetList.h:
+        * dom/DOMNamedFlowCollection.cpp:
+        (WebCore::DOMNamedFlowCollection::supportedPropertyNames):
+        * dom/DOMNamedFlowCollection.h:
+        * dom/NamedNodeMap.cpp:
+        (WebCore::NamedNodeMap::supportedPropertyNames):
+        * dom/NamedNodeMap.h:
+        * html/HTMLCollection.cpp:
+        (WebCore::HTMLCollection::supportedPropertyNames):
+        * html/HTMLCollection.h:
+        (WebCore::CollectionNamedElementCache::propertyNames):
+        (WebCore::CollectionNamedElementCache::appendToIdCache):
+        (WebCore::CollectionNamedElementCache::appendToNameCache):
+        (WebCore::CollectionNamedElementCache::memoryCost):
+        (WebCore::CollectionNamedElementCache::append):
+        * plugins/DOMMimeTypeArray.cpp:
+        (WebCore::DOMMimeTypeArray::supportedPropertyNames):
+        * plugins/DOMMimeTypeArray.h:
+        * plugins/DOMPlugin.cpp:
+        (WebCore::DOMPlugin::supportedPropertyNames):
+        * plugins/DOMPlugin.h:
+        * plugins/DOMPluginArray.cpp:
+        (WebCore::DOMPluginArray::supportedPropertyNames):
+        * plugins/DOMPluginArray.h:
+
</ins><span class="cx"> 2015-09-28  Per Arne Vollan  &lt;peavo@outlook.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Curl] Deadlock when downloading.
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCStatsResponsecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCStatsResponse.cpp (190279 => 190280)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCStatsResponse.cpp        2015-09-28 17:33:19 UTC (rev 190279)
+++ trunk/Source/WebCore/Modules/mediastream/RTCStatsResponse.cpp        2015-09-28 17:43:49 UTC (rev 190280)
</span><span class="lines">@@ -46,6 +46,12 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+Vector&lt;AtomicString&gt; WebCore::RTCStatsResponse::supportedPropertyNames()
+{
+    // FIXME: Should be implemented.
+    return Vector&lt;AtomicString&gt;();
+}
+
</ins><span class="cx"> size_t RTCStatsResponse::addReport(String id, String type, double timestamp)
</span><span class="cx"> {
</span><span class="cx">     m_result.append(RTCStatsReport::create(id, type, timestamp));
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCStatsResponseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCStatsResponse.h (190279 => 190280)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCStatsResponse.h        2015-09-28 17:33:19 UTC (rev 190279)
+++ trunk/Source/WebCore/Modules/mediastream/RTCStatsResponse.h        2015-09-28 17:43:49 UTC (rev 190280)
</span><span class="lines">@@ -46,6 +46,7 @@
</span><span class="cx">     const Vector&lt;RefPtr&lt;RTCStatsReport&gt;&gt;&amp; result() const { return m_result; };
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;RTCStatsReport&gt; namedItem(const AtomicString&amp;);
</span><ins>+    Vector&lt;AtomicString&gt; supportedPropertyNames();
</ins><span class="cx"> 
</span><span class="cx">     virtual size_t addReport(String id, String type, double timestamp) override;
</span><span class="cx">     virtual void addStatistic(size_t report, String name, String value) override;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (190279 => 190280)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2015-09-28 17:33:19 UTC (rev 190279)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2015-09-28 17:43:49 UTC (rev 190280)
</span><span class="lines">@@ -1033,7 +1033,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     # Custom getOwnPropertyNames function
</span><del>-    if ($interface-&gt;extendedAttributes-&gt;{&quot;CustomEnumerateProperty&quot;} || $indexedGetterFunction) {
</del><ins>+    if ($interface-&gt;extendedAttributes-&gt;{&quot;CustomEnumerateProperty&quot;} || $indexedGetterFunction || $namedGetterFunction) {
</ins><span class="cx">         push(@headerContent, &quot;    static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&amp;, JSC::EnumerationMode = JSC::EnumerationMode());\n&quot;);
</span><span class="cx">         $structureFlags{&quot;JSC::OverridesGetPropertyNames&quot;} = 1;       
</span><span class="cx">     }
</span><span class="lines">@@ -2771,13 +2771,22 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if ($indexedGetterFunction &amp;&amp; !$interface-&gt;extendedAttributes-&gt;{&quot;CustomEnumerateProperty&quot;}) {
</del><ins>+    if (($indexedGetterFunction || $namedGetterFunction) &amp;&amp; !$interface-&gt;extendedAttributes-&gt;{&quot;CustomEnumerateProperty&quot;}) {
</ins><span class="cx">         push(@implContent, &quot;void ${className}::getOwnPropertyNames(JSObject* object, ExecState* state, PropertyNameArray&amp; propertyNames, EnumerationMode mode)\n&quot;);
</span><span class="cx">         push(@implContent, &quot;{\n&quot;);
</span><span class="cx">         push(@implContent, &quot;    auto* thisObject = jsCast&lt;${className}*&gt;(object);\n&quot;);
</span><span class="cx">         push(@implContent, &quot;    ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n&quot;);
</span><del>-        push(@implContent, &quot;    for (unsigned i = 0, count = thisObject-&gt;impl().length(); i &lt; count; ++i)\n&quot;);
-        push(@implContent, &quot;        propertyNames.add(Identifier::from(state, i));\n&quot;);
</del><ins>+        if ($indexedGetterFunction) {
+            push(@implContent, &quot;    for (unsigned i = 0, count = thisObject-&gt;impl().length(); i &lt; count; ++i)\n&quot;);
+            push(@implContent, &quot;        propertyNames.add(Identifier::from(state, i));\n&quot;);
+        }
+        if ($namedGetterFunction) {
+            # FIXME: We may need to add an IDL extended attribute at some point if an interface needs enumerable named properties.
+            push(@implContent, &quot;    if (mode.includeDontEnumProperties()) {\n&quot;);
+            push(@implContent, &quot;        for (auto&amp; propertyName : thisObject-&gt;impl().supportedPropertyNames())\n&quot;);
+            push(@implContent, &quot;            propertyNames.add(Identifier::fromString(state, propertyName));\n&quot;);
+            push(@implContent, &quot;    }\n&quot;);
+        }
</ins><span class="cx">         push(@implContent, &quot;    Base::getOwnPropertyNames(thisObject, state, propertyNames, mode);\n&quot;);
</span><span class="cx">         push(@implContent, &quot;}\n\n&quot;);
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestEventTargetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp (190279 => 190280)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp        2015-09-28 17:33:19 UTC (rev 190279)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp        2015-09-28 17:43:49 UTC (rev 190280)
</span><span class="lines">@@ -233,6 +233,10 @@
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(thisObject, info());
</span><span class="cx">     for (unsigned i = 0, count = thisObject-&gt;impl().length(); i &lt; count; ++i)
</span><span class="cx">         propertyNames.add(Identifier::from(state, i));
</span><ins>+    if (mode.includeDontEnumProperties()) {
+        for (auto&amp; propertyName : thisObject-&gt;impl().supportedPropertyNames())
+            propertyNames.add(Identifier::fromString(state, propertyName));
+    }
</ins><span class="cx">     Base::getOwnPropertyNames(thisObject, state, propertyNames, mode);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestOverrideBuiltinscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp (190279 => 190280)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp        2015-09-28 17:33:19 UTC (rev 190279)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp        2015-09-28 17:43:49 UTC (rev 190280)
</span><span class="lines">@@ -201,6 +201,17 @@
</span><span class="cx">     return JSValue::encode(JSTestOverrideBuiltins::getConstructor(state-&gt;vm(), domObject-&gt;globalObject()));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void JSTestOverrideBuiltins::getOwnPropertyNames(JSObject* object, ExecState* state, PropertyNameArray&amp; propertyNames, EnumerationMode mode)
+{
+    auto* thisObject = jsCast&lt;JSTestOverrideBuiltins*&gt;(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    if (mode.includeDontEnumProperties()) {
+        for (auto&amp; propertyName : thisObject-&gt;impl().supportedPropertyNames())
+            propertyNames.add(Identifier::fromString(state, propertyName));
+    }
+    Base::getOwnPropertyNames(thisObject, state, propertyNames, mode);
+}
+
</ins><span class="cx"> JSValue JSTestOverrideBuiltins::getConstructor(VM&amp; vm, JSGlobalObject* globalObject)
</span><span class="cx"> {
</span><span class="cx">     return getDOMConstructor&lt;JSTestOverrideBuiltinsConstructor&gt;(vm, jsCast&lt;JSDOMGlobalObject*&gt;(globalObject));
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestOverrideBuiltinsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.h (190279 => 190280)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.h        2015-09-28 17:33:19 UTC (rev 190279)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.h        2015-09-28 17:43:49 UTC (rev 190280)
</span><span class="lines">@@ -52,6 +52,7 @@
</span><span class="cx">         return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&amp;, JSC::EnumerationMode = JSC::EnumerationMode());
</ins><span class="cx">     static JSC::JSValue getConstructor(JSC::VM&amp;, JSC::JSGlobalObject*);
</span><span class="cx">     TestOverrideBuiltins&amp; impl() const { return *m_impl; }
</span><span class="cx">     void releaseImpl() { std::exchange(m_impl, nullptr)-&gt;deref(); }
</span><span class="lines">@@ -59,7 +60,7 @@
</span><span class="cx"> private:
</span><span class="cx">     TestOverrideBuiltins* m_impl;
</span><span class="cx"> public:
</span><del>-    static const unsigned StructureFlags = JSC::HasImpureGetOwnPropertySlot | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
</del><ins>+    static const unsigned StructureFlags = JSC::HasImpureGetOwnPropertySlot | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags;
</ins><span class="cx"> protected:
</span><span class="cx">     JSTestOverrideBuiltins(JSC::Structure*, JSDOMGlobalObject*, Ref&lt;TestOverrideBuiltins&gt;&amp;&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleSheetListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleSheetList.cpp (190279 => 190280)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleSheetList.cpp        2015-09-28 17:33:19 UTC (rev 190279)
+++ trunk/Source/WebCore/css/StyleSheetList.cpp        2015-09-28 17:43:49 UTC (rev 190280)
</span><span class="lines">@@ -81,4 +81,10 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+Vector&lt;AtomicString&gt; StyleSheetList::supportedPropertyNames()
+{
+    // FIXME: Should be implemented.
+    return Vector&lt;AtomicString&gt;();
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleSheetListh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleSheetList.h (190279 => 190280)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleSheetList.h        2015-09-28 17:33:19 UTC (rev 190279)
+++ trunk/Source/WebCore/css/StyleSheetList.h        2015-09-28 17:43:49 UTC (rev 190280)
</span><span class="lines">@@ -41,6 +41,7 @@
</span><span class="cx">     StyleSheet* item(unsigned index);
</span><span class="cx"> 
</span><span class="cx">     HTMLStyleElement* getNamedItem(const String&amp;) const;
</span><ins>+    Vector&lt;AtomicString&gt; supportedPropertyNames();
</ins><span class="cx"> 
</span><span class="cx">     Document* document() { return m_document; }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredomDOMNamedFlowCollectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/DOMNamedFlowCollection.cpp (190279 => 190280)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DOMNamedFlowCollection.cpp        2015-09-28 17:33:19 UTC (rev 190279)
+++ trunk/Source/WebCore/dom/DOMNamedFlowCollection.cpp        2015-09-28 17:43:49 UTC (rev 190280)
</span><span class="lines">@@ -61,6 +61,12 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+Vector&lt;AtomicString&gt; DOMNamedFlowCollection::supportedPropertyNames()
+{
+    // FIXME: Should be implemented.
+    return Vector&lt;AtomicString&gt;();
+}
+
</ins><span class="cx"> // The HashFunctions object used by the HashSet to compare between RefPtr&lt;NamedFlows&gt;.
</span><span class="cx"> // It is safe to set safeToCompareToEmptyOrDeleted because the HashSet will never contain null pointers or deleted values.
</span><span class="cx"> struct DOMNamedFlowCollection::DOMNamedFlowHashFunctions {
</span></span></pre></div>
<a id="trunkSourceWebCoredomDOMNamedFlowCollectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/DOMNamedFlowCollection.h (190279 => 190280)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DOMNamedFlowCollection.h        2015-09-28 17:33:19 UTC (rev 190279)
+++ trunk/Source/WebCore/dom/DOMNamedFlowCollection.h        2015-09-28 17:43:49 UTC (rev 190280)
</span><span class="lines">@@ -50,6 +50,7 @@
</span><span class="cx">     unsigned long length() const;
</span><span class="cx">     PassRefPtr&lt;WebKitNamedFlow&gt; item(unsigned long index) const;
</span><span class="cx">     RefPtr&lt;WebKitNamedFlow&gt; namedItem(const AtomicString&amp; name) const;
</span><ins>+    Vector&lt;AtomicString&gt; supportedPropertyNames();
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     struct DOMNamedFlowHashFunctions;
</span></span></pre></div>
<a id="trunkSourceWebCoredomNamedNodeMapcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/NamedNodeMap.cpp (190279 => 190280)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/NamedNodeMap.cpp        2015-09-28 17:33:19 UTC (rev 190279)
+++ trunk/Source/WebCore/dom/NamedNodeMap.cpp        2015-09-28 17:43:49 UTC (rev 190280)
</span><span class="lines">@@ -63,6 +63,12 @@
</span><span class="cx">     return m_element.detachAttribute(index);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+Vector&lt;AtomicString&gt; NamedNodeMap::supportedPropertyNames()
+{
+    // FIXME: Should be implemented.
+    return Vector&lt;AtomicString&gt;();
+}
+
</ins><span class="cx"> RefPtr&lt;Node&gt; NamedNodeMap::removeNamedItemNS(const AtomicString&amp; namespaceURI, const AtomicString&amp; localName, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><span class="cx">     unsigned index = m_element.hasAttributes() ? m_element.findAttributeIndexByName(QualifiedName(nullAtom, localName, namespaceURI)) : ElementData::attributeNotFound;
</span></span></pre></div>
<a id="trunkSourceWebCoredomNamedNodeMaph"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/NamedNodeMap.h (190279 => 190280)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/NamedNodeMap.h        2015-09-28 17:33:19 UTC (rev 190279)
+++ trunk/Source/WebCore/dom/NamedNodeMap.h        2015-09-28 17:43:49 UTC (rev 190280)
</span><span class="lines">@@ -53,6 +53,7 @@
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;Node&gt; getNamedItem(const AtomicString&amp;) const;
</span><span class="cx">     RefPtr&lt;Node&gt; removeNamedItem(const AtomicString&amp; name, ExceptionCode&amp;);
</span><ins>+    Vector&lt;AtomicString&gt; supportedPropertyNames();
</ins><span class="cx"> 
</span><span class="cx">     RefPtr&lt;Node&gt; getNamedItemNS(const AtomicString&amp; namespaceURI, const AtomicString&amp; localName) const;
</span><span class="cx">     RefPtr&lt;Node&gt; removeNamedItemNS(const AtomicString&amp; namespaceURI, const AtomicString&amp; localName, ExceptionCode&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLCollectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLCollection.cpp (190279 => 190280)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLCollection.cpp        2015-09-28 17:33:19 UTC (rev 190279)
+++ trunk/Source/WebCore/html/HTMLCollection.cpp        2015-09-28 17:43:49 UTC (rev 190280)
</span><span class="lines">@@ -166,6 +166,15 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+// Documented in https://dom.spec.whatwg.org/#interface-htmlcollection.
+const Vector&lt;AtomicString&gt;&amp; HTMLCollection::supportedPropertyNames()
+{
+    updateNamedElementCache();
+    ASSERT(m_namedElementCache);
+
+    return m_namedElementCache-&gt;propertyNames();
+}
+
</ins><span class="cx"> void HTMLCollection::updateNamedElementCache() const
</span><span class="cx"> {
</span><span class="cx">     if (hasNamedElementCache())
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLCollectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLCollection.h (190279 => 190280)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLCollection.h        2015-09-28 17:33:19 UTC (rev 190279)
+++ trunk/Source/WebCore/html/HTMLCollection.h        2015-09-28 17:43:49 UTC (rev 190280)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx"> public:
</span><span class="cx">     const Vector&lt;Element*&gt;* findElementsWithId(const AtomicString&amp; id) const;
</span><span class="cx">     const Vector&lt;Element*&gt;* findElementsWithName(const AtomicString&amp; name) const;
</span><ins>+    const Vector&lt;AtomicString&gt;&amp; propertyNames() const { return m_propertyNames; }
</ins><span class="cx"> 
</span><span class="cx">     void appendToIdCache(const AtomicString&amp; id, Element&amp;);
</span><span class="cx">     void appendToNameCache(const AtomicString&amp; name, Element&amp;);
</span><span class="lines">@@ -48,10 +49,11 @@
</span><span class="cx">     typedef HashMap&lt;AtomicStringImpl*, Vector&lt;Element*&gt;&gt; StringToElementsMap;
</span><span class="cx"> 
</span><span class="cx">     const Vector&lt;Element*&gt;* find(const StringToElementsMap&amp;, const AtomicString&amp; key) const;
</span><del>-    static void append(StringToElementsMap&amp;, const AtomicString&amp; key, Element&amp;);
</del><ins>+    void append(StringToElementsMap&amp;, const AtomicString&amp; key, Element&amp;);
</ins><span class="cx"> 
</span><span class="cx">     StringToElementsMap m_idMap;
</span><span class="cx">     StringToElementsMap m_nameMap;
</span><ins>+    Vector&lt;AtomicString&gt; m_propertyNames;
</ins><span class="cx"> 
</span><span class="cx"> #if !ASSERT_DISABLED
</span><span class="cx">     bool m_didPopulate { false };
</span><span class="lines">@@ -66,6 +68,7 @@
</span><span class="cx">     // DOM API
</span><span class="cx">     virtual Element* item(unsigned index) const override = 0; // Tighten return type from NodeList::item().
</span><span class="cx">     virtual Element* namedItem(const AtomicString&amp; name) const = 0;
</span><ins>+    const Vector&lt;AtomicString&gt;&amp; supportedPropertyNames();
</ins><span class="cx">     RefPtr&lt;NodeList&gt; tags(const String&amp;);
</span><span class="cx"> 
</span><span class="cx">     // Non-DOM API
</span><span class="lines">@@ -127,17 +130,17 @@
</span><span class="cx"> 
</span><span class="cx"> inline void CollectionNamedElementCache::appendToIdCache(const AtomicString&amp; id, Element&amp; element)
</span><span class="cx"> {
</span><del>-    return append(m_idMap, id, element);
</del><ins>+    append(m_idMap, id, element);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline void CollectionNamedElementCache::appendToNameCache(const AtomicString&amp; name, Element&amp; element)
</span><span class="cx"> {
</span><del>-    return append(m_nameMap, name, element);
</del><ins>+    append(m_nameMap, name, element);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline size_t CollectionNamedElementCache::memoryCost() const
</span><span class="cx"> {
</span><del>-    return (m_idMap.size() + m_nameMap.size()) * sizeof(Element*);
</del><ins>+    return (m_idMap.size() + m_nameMap.size()) * sizeof(Element*) + m_propertyNames.size() * sizeof(AtomicString);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline void CollectionNamedElementCache::didPopulate()
</span><span class="lines">@@ -158,6 +161,8 @@
</span><span class="cx"> 
</span><span class="cx"> inline void CollectionNamedElementCache::append(StringToElementsMap&amp; map, const AtomicString&amp; key, Element&amp; element)
</span><span class="cx"> {
</span><ins>+    if (!m_idMap.contains(key.impl()) &amp;&amp; !m_nameMap.contains(key.impl()))
+        m_propertyNames.append(key);
</ins><span class="cx">     map.add(key.impl(), Vector&lt;Element*&gt;()).iterator-&gt;value.append(&amp;element);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepluginsDOMMimeTypeArraycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/plugins/DOMMimeTypeArray.cpp (190279 => 190280)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/plugins/DOMMimeTypeArray.cpp        2015-09-28 17:33:19 UTC (rev 190279)
+++ trunk/Source/WebCore/plugins/DOMMimeTypeArray.cpp        2015-09-28 17:43:49 UTC (rev 190280)
</span><span class="lines">@@ -86,6 +86,12 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+Vector&lt;AtomicString&gt; DOMMimeTypeArray::supportedPropertyNames()
+{
+    // FIXME: Should be implemented.
+    return Vector&lt;AtomicString&gt;();
+}
+
</ins><span class="cx"> PluginData* DOMMimeTypeArray::getPluginData() const
</span><span class="cx"> {
</span><span class="cx">     if (!m_frame)
</span></span></pre></div>
<a id="trunkSourceWebCorepluginsDOMMimeTypeArrayh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/plugins/DOMMimeTypeArray.h (190279 => 190280)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/plugins/DOMMimeTypeArray.h        2015-09-28 17:33:19 UTC (rev 190279)
+++ trunk/Source/WebCore/plugins/DOMMimeTypeArray.h        2015-09-28 17:43:49 UTC (rev 190280)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx">     unsigned length() const;
</span><span class="cx">     RefPtr&lt;DOMMimeType&gt; item(unsigned index);
</span><span class="cx">     RefPtr&lt;DOMMimeType&gt; namedItem(const AtomicString&amp; propertyName);
</span><ins>+    Vector&lt;AtomicString&gt; supportedPropertyNames();
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     explicit DOMMimeTypeArray(Frame*);
</span></span></pre></div>
<a id="trunkSourceWebCorepluginsDOMPlugincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/plugins/DOMPlugin.cpp (190279 => 190280)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/plugins/DOMPlugin.cpp        2015-09-28 17:33:19 UTC (rev 190279)
+++ trunk/Source/WebCore/plugins/DOMPlugin.cpp        2015-09-28 17:43:49 UTC (rev 190280)
</span><span class="lines">@@ -85,4 +85,10 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+Vector&lt;AtomicString&gt; DOMPlugin::supportedPropertyNames()
+{
+    // FIXME: Should be implemented.
+    return Vector&lt;AtomicString&gt;();
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorepluginsDOMPluginh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/plugins/DOMPlugin.h (190279 => 190280)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/plugins/DOMPlugin.h        2015-09-28 17:33:19 UTC (rev 190279)
+++ trunk/Source/WebCore/plugins/DOMPlugin.h        2015-09-28 17:43:49 UTC (rev 190280)
</span><span class="lines">@@ -44,6 +44,7 @@
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;DOMMimeType&gt; item(unsigned index);
</span><span class="cx">     RefPtr&lt;DOMMimeType&gt; namedItem(const AtomicString&amp; propertyName);
</span><ins>+    Vector&lt;AtomicString&gt; supportedPropertyNames();
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     DOMPlugin(PluginData*, Frame*, PluginInfo);
</span></span></pre></div>
<a id="trunkSourceWebCorepluginsDOMPluginArraycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/plugins/DOMPluginArray.cpp (190279 => 190280)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/plugins/DOMPluginArray.cpp        2015-09-28 17:33:19 UTC (rev 190279)
+++ trunk/Source/WebCore/plugins/DOMPluginArray.cpp        2015-09-28 17:43:49 UTC (rev 190280)
</span><span class="lines">@@ -77,6 +77,12 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+Vector&lt;AtomicString&gt; DOMPluginArray::supportedPropertyNames()
+{
+    // FIXME: Should be implemented.
+    return Vector&lt;AtomicString&gt;();
+}
+
</ins><span class="cx"> void DOMPluginArray::refresh(bool reload)
</span><span class="cx"> {
</span><span class="cx">     Page::refreshPlugins(reload);
</span></span></pre></div>
<a id="trunkSourceWebCorepluginsDOMPluginArrayh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/plugins/DOMPluginArray.h (190279 => 190280)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/plugins/DOMPluginArray.h        2015-09-28 17:33:19 UTC (rev 190279)
+++ trunk/Source/WebCore/plugins/DOMPluginArray.h        2015-09-28 17:43:49 UTC (rev 190280)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx">     unsigned length() const;
</span><span class="cx">     RefPtr&lt;DOMPlugin&gt; item(unsigned index);
</span><span class="cx">     RefPtr&lt;DOMPlugin&gt; namedItem(const AtomicString&amp; propertyName);
</span><ins>+    Vector&lt;AtomicString&gt; supportedPropertyNames();
</ins><span class="cx"> 
</span><span class="cx">     void refresh(bool reload);
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>