<!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>[188829] 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/188829">188829</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2015-08-22 15:29:26 -0700 (Sat, 22 Aug 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>NodeList should not have a named getter
https://bugs.webkit.org/show_bug.cgi?id=148117
Reviewed by Darin Adler.
Source/WebCore:
Drop the named property getter on NodeList to match the specification:
https://dom.spec.whatwg.org/#interface-nodelist
This change could be a bit risky but:
1. Firefox and IE never had this named property getter on NodeList.
2. Chrome successfuly dropped this named property getter in early 2014:
https://src.chromium.org/viewvc/blink?revision=166356&view=<a href="http://trac.webkit.org/projects/webkit/changeset/3">revision
3</a>. Our named property getter on NodeList is only partly functional:
It only matches by 'id' attribute, not by 'name' attribute.
4. Our APIs that were wrongly returning a NodeList instead of an
HTMLCollection (getElementsByTagName() / getElementsByClassName())
have been fixed in <a href="http://trac.webkit.org/projects/webkit/changeset/188735">r188735</a> and <a href="http://trac.webkit.org/projects/webkit/changeset/188809">r188809</a>. HTMLCollection does have
a named property getter.
5. This named getter adds code complexity.
* bindings/js/JSNodeListCustom.cpp:
(WebCore::createWrapper): Deleted.
* dom/ChildNodeList.cpp:
(WebCore::ChildNodeList::invalidateCache): Deleted.
* dom/ChildNodeList.h:
* dom/LiveNodeList.cpp:
* dom/LiveNodeList.h:
* dom/NodeList.h:
* dom/NodeList.idl:
* dom/StaticNodeList.cpp:
(WebCore::StaticElementList::length): Deleted.
(WebCore::StaticElementList::item): Deleted.
* dom/StaticNodeList.h:
* html/HTMLCollection.h:
LayoutTests:
* fast/dom/childnode-item-after-itemname-expected.txt: Removed.
* fast/dom/childnode-item-after-itemname.html: Removed.
Drop test as it is no longer relevant now that NodeList no longer
has a named property getter.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastdomnameditemswithsymbolnameexpectedtxt">trunk/LayoutTests/fast/dom/named-items-with-symbol-name-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomnameditemswithsymbolnamehtml">trunk/LayoutTests/fast/dom/named-items-with-symbol-name.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSNodeListCustomcpp">trunk/Source/WebCore/bindings/js/JSNodeListCustom.cpp</a></li>
<li><a href="#trunkSourceWebCoredomChildNodeListcpp">trunk/Source/WebCore/dom/ChildNodeList.cpp</a></li>
<li><a href="#trunkSourceWebCoredomChildNodeListh">trunk/Source/WebCore/dom/ChildNodeList.h</a></li>
<li><a href="#trunkSourceWebCoredomLiveNodeListcpp">trunk/Source/WebCore/dom/LiveNodeList.cpp</a></li>
<li><a href="#trunkSourceWebCoredomLiveNodeListh">trunk/Source/WebCore/dom/LiveNodeList.h</a></li>
<li><a href="#trunkSourceWebCoredomNodeListh">trunk/Source/WebCore/dom/NodeList.h</a></li>
<li><a href="#trunkSourceWebCoredomNodeListidl">trunk/Source/WebCore/dom/NodeList.idl</a></li>
<li><a href="#trunkSourceWebCoredomStaticNodeListcpp">trunk/Source/WebCore/dom/StaticNodeList.cpp</a></li>
<li><a href="#trunkSourceWebCoredomStaticNodeListh">trunk/Source/WebCore/dom/StaticNodeList.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLCollectionh">trunk/Source/WebCore/html/HTMLCollection.h</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastdomchildnodeitemafteritemnameexpectedtxt">trunk/LayoutTests/fast/dom/childnode-item-after-itemname-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomchildnodeitemafteritemnamehtml">trunk/LayoutTests/fast/dom/childnode-item-after-itemname.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (188828 => 188829)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-08-22 22:20:46 UTC (rev 188828)
+++ trunk/LayoutTests/ChangeLog        2015-08-22 22:29:26 UTC (rev 188829)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2015-08-22 Chris Dumez <cdumez@apple.com>
+
+ NodeList should not have a named getter
+ https://bugs.webkit.org/show_bug.cgi?id=148117
+
+ Reviewed by Darin Adler.
+
+ * fast/dom/childnode-item-after-itemname-expected.txt: Removed.
+ * fast/dom/childnode-item-after-itemname.html: Removed.
+ Drop test as it is no longer relevant now that NodeList no longer
+ has a named property getter.
+
</ins><span class="cx"> 2015-08-22 Alexey Proskuryakov <ap@apple.com>
</span><span class="cx">
</span><span class="cx"> Tweak a test that became flaky on some machines after r188793.
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomchildnodeitemafteritemnameexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/fast/dom/childnode-item-after-itemname-expected.txt (188828 => 188829)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/childnode-item-after-itemname-expected.txt        2015-08-22 22:20:46 UTC (rev 188828)
+++ trunk/LayoutTests/fast/dom/childnode-item-after-itemname-expected.txt        2015-08-22 22:29:26 UTC (rev 188829)
</span><span class="lines">@@ -1,3 +0,0 @@
</span><del>-This tests accessing the first element in childNodes after accessing the second element by its id. WebKit should retrieve each element correctly, and you should see 2 1 below:
-
-2 1
</del></span></pre></div>
<a id="trunkLayoutTestsfastdomchildnodeitemafteritemnamehtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/fast/dom/childnode-item-after-itemname.html (188828 => 188829)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/childnode-item-after-itemname.html        2015-08-22 22:20:46 UTC (rev 188828)
+++ trunk/LayoutTests/fast/dom/childnode-item-after-itemname.html        2015-08-22 22:29:26 UTC (rev 188829)
</span><span class="lines">@@ -1,18 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<body>
-<p>This tests accessing the first element in childNodes after accessing the second element by its id.
-WebKit should retrieve each element correctly, and you should see 2 1 below:</p>
-<span id="testItem"></span><span id="tests" style="display: none;">1<span id="testItem">2</span></span>
-<script>
-
-if (window.testRunner)
- testRunner.dumpAsText();
-
-var tests = document.querySelector('#tests');
-document.writeln(tests.childNodes['testItem'].textContent);
-document.writeln(tests.childNodes[0].textContent);
-
-</script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestsfastdomnameditemswithsymbolnameexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/named-items-with-symbol-name-expected.txt (188828 => 188829)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/named-items-with-symbol-name-expected.txt        2015-08-22 22:20:46 UTC (rev 188828)
+++ trunk/LayoutTests/fast/dom/named-items-with-symbol-name-expected.txt        2015-08-22 22:29:26 UTC (rev 188829)
</span><span class="lines">@@ -3,11 +3,6 @@
</span><span class="cx"> On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
</span><span class="cx">
</span><span class="cx">
</span><del>-[object NodeList]
-PASS querySelectorAllList.length === 4 is true
-PASS querySelectorAllList[Symbol()] === undefined is true
-PASS querySelectorAllList[Symbol('div')] === undefined is true
-PASS querySelectorAllList['Symbol(div)'] instanceof HTMLDivElement is true
</del><span class="cx">
</span><span class="cx"> [object HTMLCollection]
</span><span class="cx"> PASS getElementsByTagNameList.length === 4 is true
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomnameditemswithsymbolnamehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/named-items-with-symbol-name.html (188828 => 188829)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/named-items-with-symbol-name.html        2015-08-22 22:20:46 UTC (rev 188828)
+++ trunk/LayoutTests/fast/dom/named-items-with-symbol-name.html        2015-08-22 22:29:26 UTC (rev 188829)
</span><span class="lines">@@ -15,13 +15,6 @@
</span><span class="cx"> <script>
</span><span class="cx"> description('This tests Symbol property names with a number of named items collections.');
</span><span class="cx">
</span><del>-var querySelectorAllList = document.querySelectorAll('div');
-debug(String(querySelectorAllList));
-shouldBeTrue("querySelectorAllList.length === 4");
-shouldBeTrue("querySelectorAllList[Symbol()] === undefined");
-shouldBeTrue("querySelectorAllList[Symbol('div')] === undefined");
-shouldBeTrue("querySelectorAllList['Symbol(div)'] instanceof HTMLDivElement");
-
</del><span class="cx"> var getElementsByTagNameList = document.getElementsByTagName('div');
</span><span class="cx"> debug("\n" + String(getElementsByTagNameList));
</span><span class="cx"> shouldBeTrue("getElementsByTagNameList.length === 4");
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (188828 => 188829)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-08-22 22:20:46 UTC (rev 188828)
+++ trunk/Source/WebCore/ChangeLog        2015-08-22 22:29:26 UTC (rev 188829)
</span><span class="lines">@@ -1,3 +1,40 @@
</span><ins>+2015-08-22 Chris Dumez <cdumez@apple.com>
+
+ NodeList should not have a named getter
+ https://bugs.webkit.org/show_bug.cgi?id=148117
+
+ Reviewed by Darin Adler.
+
+ Drop the named property getter on NodeList to match the specification:
+ https://dom.spec.whatwg.org/#interface-nodelist
+
+ This change could be a bit risky but:
+ 1. Firefox and IE never had this named property getter on NodeList.
+ 2. Chrome successfuly dropped this named property getter in early 2014:
+ https://src.chromium.org/viewvc/blink?revision=166356&view=revision
+ 3. Our named property getter on NodeList is only partly functional:
+ It only matches by 'id' attribute, not by 'name' attribute.
+ 4. Our APIs that were wrongly returning a NodeList instead of an
+ HTMLCollection (getElementsByTagName() / getElementsByClassName())
+ have been fixed in r188735 and r188809. HTMLCollection does have
+ a named property getter.
+ 5. This named getter adds code complexity.
+
+ * bindings/js/JSNodeListCustom.cpp:
+ (WebCore::createWrapper): Deleted.
+ * dom/ChildNodeList.cpp:
+ (WebCore::ChildNodeList::invalidateCache): Deleted.
+ * dom/ChildNodeList.h:
+ * dom/LiveNodeList.cpp:
+ * dom/LiveNodeList.h:
+ * dom/NodeList.h:
+ * dom/NodeList.idl:
+ * dom/StaticNodeList.cpp:
+ (WebCore::StaticElementList::length): Deleted.
+ (WebCore::StaticElementList::item): Deleted.
+ * dom/StaticNodeList.h:
+ * html/HTMLCollection.h:
+
</ins><span class="cx"> 2015-08-22 Andreas Kling <akling@apple.com>
</span><span class="cx">
</span><span class="cx"> [JSC] Static hash tables should be 100% compile-time constant.
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSNodeListCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSNodeListCustom.cpp (188828 => 188829)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSNodeListCustom.cpp        2015-08-22 22:20:46 UTC (rev 188828)
+++ trunk/Source/WebCore/bindings/js/JSNodeListCustom.cpp        2015-08-22 22:29:26 UTC (rev 188829)
</span><span class="lines">@@ -51,18 +51,6 @@
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-// FIXME: NodeList should not have a named getter. It currently has one because getElementByTagName()
-// returns a NodeList instead of an HTMLCollection.
-bool JSNodeList::nameGetter(ExecState* exec, PropertyName propertyName, JSValue& value)
-{
- auto item = impl().namedItem(propertyNameToAtomicString(propertyName));
- if (!item)
- return false;
-
- value = toJS(exec, globalObject(), item);
- return true;
-}
-
</del><span class="cx"> JSC::JSValue createWrapper(JSDOMGlobalObject& globalObject, NodeList& nodeList)
</span><span class="cx"> {
</span><span class="cx"> // FIXME: Adopt reportExtraMemoryVisited, and switch to reportExtraMemoryAllocated.
</span></span></pre></div>
<a id="trunkSourceWebCoredomChildNodeListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ChildNodeList.cpp (188828 => 188829)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ChildNodeList.cpp        2015-08-22 22:20:46 UTC (rev 188828)
+++ trunk/Source/WebCore/dom/ChildNodeList.cpp        2015-08-22 22:29:26 UTC (rev 188829)
</span><span class="lines">@@ -81,23 +81,6 @@
</span><span class="cx"> current = current->previousSibling();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-Node* ChildNodeList::namedItem(const AtomicString& name) const
-{
- // FIXME: According to the spec child node list should not have namedItem().
- if (m_parent.get().inDocument()) {
- Element* element = m_parent.get().treeScope().getElementById(name);
- if (element && element->parentNode() == m_parent.ptr())
- return element;
- if (!element || !m_parent.get().treeScope().containsMultipleElementsWithId(name))
- return nullptr;
- }
- for (auto& element : childrenOfType<Element>(m_parent)) {
- if (element.hasID() && element.idForStyleResolution() == name)
- return const_cast<Element*>(&element);
- }
- return nullptr;
-}
-
</del><span class="cx"> void ChildNodeList::invalidateCache()
</span><span class="cx"> {
</span><span class="cx"> m_indexCache.invalidate(*this);
</span></span></pre></div>
<a id="trunkSourceWebCoredomChildNodeListh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ChildNodeList.h (188828 => 188829)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ChildNodeList.h        2015-08-22 22:20:46 UTC (rev 188828)
+++ trunk/Source/WebCore/dom/ChildNodeList.h        2015-08-22 22:29:26 UTC (rev 188829)
</span><span class="lines">@@ -48,7 +48,6 @@
</span><span class="cx">
</span><span class="cx"> virtual unsigned length() const override { return 0; }
</span><span class="cx"> virtual Node* item(unsigned) const override { return nullptr; }
</span><del>- virtual Node* namedItem(const AtomicString&) const override { return nullptr; }
</del><span class="cx"> virtual size_t memoryCost() const override { return 0; }
</span><span class="cx">
</span><span class="cx"> virtual bool isEmptyNodeList() const override { return true; }
</span><span class="lines">@@ -83,7 +82,6 @@
</span><span class="cx">
</span><span class="cx"> virtual unsigned length() const override;
</span><span class="cx"> virtual Node* item(unsigned index) const override;
</span><del>- virtual Node* namedItem(const AtomicString&) const override;
</del><span class="cx"> virtual size_t memoryCost() const override { return m_indexCache.memoryCost(); }
</span><span class="cx">
</span><span class="cx"> virtual bool isChildNodeList() const override { return true; }
</span></span></pre></div>
<a id="trunkSourceWebCoredomLiveNodeListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/LiveNodeList.cpp (188828 => 188829)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/LiveNodeList.cpp        2015-08-22 22:20:46 UTC (rev 188828)
+++ trunk/Source/WebCore/dom/LiveNodeList.cpp        2015-08-22 22:29:26 UTC (rev 188829)
</span><span class="lines">@@ -50,35 +50,4 @@
</span><span class="cx"> return ownerNode();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-Node* LiveNodeList::namedItem(const AtomicString& elementId) const
-{
- // FIXME: Why doesn't this look into the name attribute like HTMLCollection::namedItem does?
- Node& rootNode = this->rootNode();
-
- if (rootNode.inDocument()) {
- Element* element = rootNode.treeScope().getElementById(elementId);
- if (element && elementMatches(*element) && element->isDescendantOf(&rootNode))
- return element;
- if (!element)
- return nullptr;
- // In the case of multiple nodes with the same name, just fall through.
- }
-
- if (elementId.isEmpty())
- return nullptr;
-
- unsigned length = this->length();
- for (unsigned i = 0; i < length; i++) {
- Node* node = item(i);
- if (!is<Element>(*node))
- continue;
- Element& element = downcast<Element>(*node);
- // FIXME: This should probably be using getIdAttribute instead of idForStyleResolution.
- if (element.hasID() && element.idForStyleResolution() == elementId)
- return node;
- }
-
- return nullptr;
-}
-
</del><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoredomLiveNodeListh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/LiveNodeList.h (188828 => 188829)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/LiveNodeList.h        2015-08-22 22:20:46 UTC (rev 188828)
+++ trunk/Source/WebCore/dom/LiveNodeList.h        2015-08-22 22:29:26 UTC (rev 188829)
</span><span class="lines">@@ -45,8 +45,6 @@
</span><span class="cx"> LiveNodeList(ContainerNode& ownerNode, NodeListInvalidationType);
</span><span class="cx"> virtual ~LiveNodeList();
</span><span class="cx">
</span><del>- virtual Node* namedItem(const AtomicString&) const override final;
-
</del><span class="cx"> virtual bool elementMatches(Element&) const = 0;
</span><span class="cx"> virtual bool isRootedAtDocument() const = 0;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodeListh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/NodeList.h (188828 => 188829)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/NodeList.h        2015-08-22 22:20:46 UTC (rev 188828)
+++ trunk/Source/WebCore/dom/NodeList.h        2015-08-22 22:29:26 UTC (rev 188829)
</span><span class="lines">@@ -39,7 +39,6 @@
</span><span class="cx"> // DOM methods & attributes for NodeList
</span><span class="cx"> virtual unsigned length() const = 0;
</span><span class="cx"> virtual Node* item(unsigned index) const = 0;
</span><del>- virtual Node* namedItem(const AtomicString&) const = 0;
</del><span class="cx">
</span><span class="cx"> // Other methods (not part of DOM)
</span><span class="cx"> virtual bool isLiveNodeList() const { return false; }
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodeListidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/NodeList.idl (188828 => 188829)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/NodeList.idl        2015-08-22 22:20:46 UTC (rev 188828)
+++ trunk/Source/WebCore/dom/NodeList.idl        2015-08-22 22:29:26 UTC (rev 188829)
</span><span class="lines">@@ -20,16 +20,12 @@
</span><span class="cx">
</span><span class="cx"> [
</span><span class="cx"> CustomIsReachable,
</span><del>- CustomNamedGetter,
</del><span class="cx"> CustomToJSObject,
</span><span class="cx"> JSCustomHeader,
</span><span class="cx"> SkipVTableValidation,
</span><span class="cx"> ReportExtraMemoryCost,
</span><span class="cx"> ] interface NodeList {
</span><del>-
</del><span class="cx"> getter Node item(unsigned long index);
</span><del>-
</del><span class="cx"> readonly attribute unsigned long length;
</span><del>-
</del><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoredomStaticNodeListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/StaticNodeList.cpp (188828 => 188829)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/StaticNodeList.cpp        2015-08-22 22:20:46 UTC (rev 188828)
+++ trunk/Source/WebCore/dom/StaticNodeList.cpp        2015-08-22 22:29:26 UTC (rev 188829)
</span><span class="lines">@@ -43,18 +43,6 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-Node* StaticNodeList::namedItem(const AtomicString& elementId) const
-{
- if (elementId.isEmpty())
- return nullptr;
- for (unsigned i = 0, length = m_nodes.size(); i < length; ++i) {
- Node& node = const_cast<Node&>(m_nodes[i].get());
- if (is<Element>(node) && downcast<Element>(node).getIdAttribute() == elementId)
- return &node;
- }
- return nullptr;
-}
-
</del><span class="cx"> unsigned StaticElementList::length() const
</span><span class="cx"> {
</span><span class="cx"> return m_elements.size();
</span><span class="lines">@@ -67,16 +55,4 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-Node* StaticElementList::namedItem(const AtomicString& elementId) const
-{
- if (elementId.isEmpty())
- return nullptr;
- for (unsigned i = 0, length = m_elements.size(); i < length; ++i) {
- Element& element = const_cast<Element&>(m_elements[i].get());
- if (element.getIdAttribute() == elementId)
- return &element;
- }
- return nullptr;
-}
-
</del><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoredomStaticNodeListh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/StaticNodeList.h (188828 => 188829)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/StaticNodeList.h        2015-08-22 22:20:46 UTC (rev 188828)
+++ trunk/Source/WebCore/dom/StaticNodeList.h        2015-08-22 22:29:26 UTC (rev 188829)
</span><span class="lines">@@ -53,7 +53,6 @@
</span><span class="cx">
</span><span class="cx"> virtual unsigned length() const override;
</span><span class="cx"> virtual Node* item(unsigned index) const override;
</span><del>- virtual Node* namedItem(const AtomicString&) const override;
</del><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> StaticNodeList() { }
</span><span class="lines">@@ -77,7 +76,6 @@
</span><span class="cx">
</span><span class="cx"> virtual unsigned length() const override;
</span><span class="cx"> virtual Node* item(unsigned index) const override;
</span><del>- virtual Node* namedItem(const AtomicString&) const override;
</del><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> StaticElementList()
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLCollectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLCollection.h (188828 => 188829)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLCollection.h        2015-08-22 22:20:46 UTC (rev 188828)
+++ trunk/Source/WebCore/html/HTMLCollection.h        2015-08-22 22:29:26 UTC (rev 188829)
</span><span class="lines">@@ -65,7 +65,7 @@
</span><span class="cx">
</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><del>- virtual Element* namedItem(const AtomicString& name) const override = 0; // Tighten return type from NodeList::namedItem().
</del><ins>+ virtual Element* namedItem(const AtomicString& name) const = 0;
</ins><span class="cx"> RefPtr<NodeList> tags(const String&);
</span><span class="cx">
</span><span class="cx"> // Non-DOM API
</span></span></pre>
</div>
</div>
</body>
</html>