<!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>[184420] 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/184420">184420</a></dd>
<dt>Author</dt> <dd>weinig@apple.com</dd>
<dt>Date</dt> <dd>2015-05-15 15:55:53 -0700 (Fri, 15 May 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Move HTMLElement's children property to ParentNode
https://bugs.webkit.org/show_bug.cgi?id=145072

Reviewed by Chris Dumez.

Source/WebCore:

Match the latest DOM standard and other browsers by moving the children property
to ParentNode, thus exposing it on Element, Document and DocumentFragment.

Test: fast/dom/ParentNode-children.html

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::children):
Moved implementation from HTMLElement to here.

(WebCore::ContainerNode::ensureCachedHTMLCollection):
(WebCore::ContainerNode::cachedHTMLCollection):
Moved implementation from Element to here so that ContainerNode::children
can use it.

(WebCore::ContainerNode::firstElementChild):
(WebCore::ContainerNode::lastElementChild):
(WebCore::ContainerNode::childElementCount):
Remove unnecessary assertions.

* dom/ContainerNode.h:
Moved declarations from HTMLElement and Element to here.

* dom/Element.cpp:
(WebCore::Element::ensureCachedHTMLCollection): Deleted.
(WebCore::Element::cachedHTMLCollection): Deleted.
* dom/Element.h:
Moved to ContainerNode.

* dom/Node.cpp:
(WebCore::Node::previousElementSibling):
(WebCore::Node::nextElementSibling):
Remove unnecessary assertions.

* dom/ParentNode.idl:
Moved the children property here from HTMLElement.

* html/HTMLElement.cpp:
(WebCore::HTMLElement::children): Deleted.
* html/HTMLElement.h:
Moved to ContainerNode.

* html/HTMLElement.idl:
Get rid of the children property for all bindings except Objective-C which needs
to keep it to avoid changing the public API.

LayoutTests:

* fast/dom/ParentNode-children-expected.txt: Added.
* fast/dom/ParentNode-children.html: Added.
Test children on Element, Document and DocumentFragment.

* fast/dom/xmlserializer-serialize-to-string-exception-expected.txt:
Update results since document.children is no longer undefined.

* js/dom/dom-static-property-for-in-iteration-expected.txt:
Update results.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastdomxmlserializerserializetostringexceptionexpectedtxt">trunk/LayoutTests/fast/dom/xmlserializer-serialize-to-string-exception-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsdomdomstaticpropertyforiniterationexpectedtxt">trunk/LayoutTests/js/dom/dom-static-property-for-in-iteration-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoredomContainerNodecpp">trunk/Source/WebCore/dom/ContainerNode.cpp</a></li>
<li><a href="#trunkSourceWebCoredomContainerNodeh">trunk/Source/WebCore/dom/ContainerNode.h</a></li>
<li><a href="#trunkSourceWebCoredomElementcpp">trunk/Source/WebCore/dom/Element.cpp</a></li>
<li><a href="#trunkSourceWebCoredomElementh">trunk/Source/WebCore/dom/Element.h</a></li>
<li><a href="#trunkSourceWebCoredomNodecpp">trunk/Source/WebCore/dom/Node.cpp</a></li>
<li><a href="#trunkSourceWebCoredomParentNodeidl">trunk/Source/WebCore/dom/ParentNode.idl</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLElementcpp">trunk/Source/WebCore/html/HTMLElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLElementh">trunk/Source/WebCore/html/HTMLElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLElementidl">trunk/Source/WebCore/html/HTMLElement.idl</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastdomParentNodechildrenexpectedtxt">trunk/LayoutTests/fast/dom/ParentNode-children-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomParentNodechildrenhtml">trunk/LayoutTests/fast/dom/ParentNode-children.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (184419 => 184420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-05-15 21:59:50 UTC (rev 184419)
+++ trunk/LayoutTests/ChangeLog        2015-05-15 22:55:53 UTC (rev 184420)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2015-05-15  Sam Weinig  &lt;sam@webkit.org&gt;
+
+        Move HTMLElement's children property to ParentNode
+        https://bugs.webkit.org/show_bug.cgi?id=145072
+
+        Reviewed by Chris Dumez.
+
+        * fast/dom/ParentNode-children-expected.txt: Added.
+        * fast/dom/ParentNode-children.html: Added.
+        Test children on Element, Document and DocumentFragment.
+
+        * fast/dom/xmlserializer-serialize-to-string-exception-expected.txt:
+        Update results since document.children is no longer undefined.
+
+        * js/dom/dom-static-property-for-in-iteration-expected.txt:
+        Update results.
+
</ins><span class="cx"> 2015-05-15  Zalan Bujtas  &lt;zalan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         White edge on animating panel on http://rokkosunnyvale.com
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomParentNodechildrenexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/ParentNode-children-expected.txt (0 => 184420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/ParentNode-children-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/dom/ParentNode-children-expected.txt        2015-05-15 22:55:53 UTC (rev 184420)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+Tests the basic functionality of the `children` property on ParentNode.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS document.children is an instance of HTMLCollection
+PASS document.documentElement.children is an instance of HTMLCollection
+PASS document.createDocumentFragment().children is an instance of HTMLCollection
+PASS document.children.length is 1
+PASS document.children[0] is document.documentElement
+PASS document.documentElement.children.length is 2
+PASS document.documentElement.children[0] is document.head
+PASS document.documentElement.children[1] is document.body
+PASS documentFragment.children.length is 2
+PASS documentFragment.children[0] is child1
+PASS documentFragment.children[1] is child2
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomParentNodechildrenhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/ParentNode-children.html (0 => 184420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/ParentNode-children.html                                (rev 0)
+++ trunk/LayoutTests/fast/dom/ParentNode-children.html        2015-05-15 22:55:53 UTC (rev 184420)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+
+description(&quot;Tests the basic functionality of the `children` property on ParentNode.&quot;);
+
+shouldBeType(&quot;document.children&quot;, &quot;HTMLCollection&quot;);
+shouldBeType(&quot;document.documentElement.children&quot;, &quot;HTMLCollection&quot;);
+shouldBeType(&quot;document.createDocumentFragment().children&quot;, &quot;HTMLCollection&quot;);
+
+shouldBe(&quot;document.children.length&quot;, &quot;1&quot;);
+shouldBe(&quot;document.children[0]&quot;, &quot;document.documentElement&quot;);
+
+shouldBe(&quot;document.documentElement.children.length&quot;, &quot;2&quot;);
+shouldBe(&quot;document.documentElement.children[0]&quot;, &quot;document.head&quot;);
+shouldBe(&quot;document.documentElement.children[1]&quot;, &quot;document.body&quot;);
+
+var documentFragment = document.createDocumentFragment();
+var child1 = document.createElement(&quot;div&quot;);
+var child2 = document.createElement(&quot;div&quot;);
+documentFragment.appendChild(child1);
+documentFragment.appendChild(child2);
+
+shouldBe(&quot;documentFragment.children.length&quot;, &quot;2&quot;);
+shouldBe(&quot;documentFragment.children[0]&quot;, &quot;child1&quot;);
+shouldBe(&quot;documentFragment.children[1]&quot;, &quot;child2&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="trunkLayoutTestsfastdomxmlserializerserializetostringexceptionexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/xmlserializer-serialize-to-string-exception-expected.txt (184419 => 184420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/xmlserializer-serialize-to-string-exception-expected.txt        2015-05-15 21:59:50 UTC (rev 184419)
+++ trunk/LayoutTests/fast/dom/xmlserializer-serialize-to-string-exception-expected.txt        2015-05-15 22:55:53 UTC (rev 184420)
</span><span class="lines">@@ -12,7 +12,7 @@
</span><span class="cx"> Exception thrown = [TypeError: Type error]
</span><span class="cx"> PASS
</span><span class="cx"> 
</span><del>-4. Verifying XMLSerializer.serializeToString() should THROW exception with node value = undefined
</del><ins>+4. Verifying XMLSerializer.serializeToString() should THROW exception with node value = [object HTMLCollection]
</ins><span class="cx"> Exception thrown = [TypeError: Type error]
</span><span class="cx"> PASS
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsjsdomdomstaticpropertyforiniterationexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/dom/dom-static-property-for-in-iteration-expected.txt (184419 => 184420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/dom-static-property-for-in-iteration-expected.txt        2015-05-15 21:59:50 UTC (rev 184419)
+++ trunk/LayoutTests/js/dom/dom-static-property-for-in-iteration-expected.txt        2015-05-15 22:55:53 UTC (rev 184420)
</span><span class="lines">@@ -39,7 +39,6 @@
</span><span class="cx"> PASS a[&quot;accessKey&quot;] is 
</span><span class="cx"> PASS a[&quot;innerText&quot;] is nerget
</span><span class="cx"> PASS a[&quot;outerText&quot;] is nerget
</span><del>-PASS a[&quot;children&quot;] is [object HTMLCollection]
</del><span class="cx"> PASS a[&quot;contentEditable&quot;] is inherit
</span><span class="cx"> PASS a[&quot;isContentEditable&quot;] is false
</span><span class="cx"> PASS a[&quot;spellcheck&quot;] is true
</span><span class="lines">@@ -48,7 +47,7 @@
</span><span class="cx"> PASS a[&quot;style&quot;] is [object CSSStyleDeclaration]
</span><span class="cx"> PASS a[&quot;id&quot;] is foo
</span><span class="cx"> PASS a[&quot;offsetLeft&quot;] is 8
</span><del>-PASS a[&quot;offsetTop&quot;] is 759
</del><ins>+PASS a[&quot;offsetTop&quot;] is 744
</ins><span class="cx"> PASS a[&quot;offsetWidth&quot;] is 40
</span><span class="cx"> PASS a[&quot;offsetHeight&quot;] is 18
</span><span class="cx"> PASS a[&quot;clientLeft&quot;] is 0
</span><span class="lines">@@ -69,6 +68,7 @@
</span><span class="cx"> PASS a[&quot;webkitRegionOverset&quot;] is undefined
</span><span class="cx"> PASS a[&quot;previousElementSibling&quot;] is [object HTMLDivElement]
</span><span class="cx"> PASS a[&quot;nextElementSibling&quot;] is [object HTMLScriptElement]
</span><ins>+PASS a[&quot;children&quot;] is [object HTMLCollection]
</ins><span class="cx"> PASS a[&quot;firstElementChild&quot;] is null
</span><span class="cx"> PASS a[&quot;lastElementChild&quot;] is null
</span><span class="cx"> PASS a[&quot;childElementCount&quot;] is 0
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (184419 => 184420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-05-15 21:59:50 UTC (rev 184419)
+++ trunk/Source/WebCore/ChangeLog        2015-05-15 22:55:53 UTC (rev 184420)
</span><span class="lines">@@ -1,3 +1,55 @@
</span><ins>+2015-05-15  Sam Weinig  &lt;sam@webkit.org&gt;
+
+        Move HTMLElement's children property to ParentNode
+        https://bugs.webkit.org/show_bug.cgi?id=145072
+
+        Reviewed by Chris Dumez.
+
+        Match the latest DOM standard and other browsers by moving the children property
+        to ParentNode, thus exposing it on Element, Document and DocumentFragment.
+
+        Test: fast/dom/ParentNode-children.html
+
+        * dom/ContainerNode.cpp:
+        (WebCore::ContainerNode::children):
+        Moved implementation from HTMLElement to here.
+
+        (WebCore::ContainerNode::ensureCachedHTMLCollection):
+        (WebCore::ContainerNode::cachedHTMLCollection):
+        Moved implementation from Element to here so that ContainerNode::children
+        can use it.
+
+        (WebCore::ContainerNode::firstElementChild):
+        (WebCore::ContainerNode::lastElementChild):
+        (WebCore::ContainerNode::childElementCount):
+        Remove unnecessary assertions.
+
+        * dom/ContainerNode.h:
+        Moved declarations from HTMLElement and Element to here.
+
+        * dom/Element.cpp:
+        (WebCore::Element::ensureCachedHTMLCollection): Deleted.
+        (WebCore::Element::cachedHTMLCollection): Deleted.
+        * dom/Element.h:
+        Moved to ContainerNode.
+
+        * dom/Node.cpp:
+        (WebCore::Node::previousElementSibling):
+        (WebCore::Node::nextElementSibling):
+        Remove unnecessary assertions.
+
+        * dom/ParentNode.idl:
+        Moved the children property here from HTMLElement.
+
+        * html/HTMLElement.cpp:
+        (WebCore::HTMLElement::children): Deleted.
+        * html/HTMLElement.h:
+        Moved to ContainerNode.
+
+        * html/HTMLElement.idl:
+        Get rid of the children property for all bindings except Objective-C which needs
+        to keep it to avoid changing the public API.
+
</ins><span class="cx"> 2015-05-15  Zalan Bujtas  &lt;zalan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         WebCore ASan debug build fails. ERROR: WebCore has a weak external symbol in it.
</span></span></pre></div>
<a id="trunkSourceWebCoredomContainerNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ContainerNode.cpp (184419 => 184420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ContainerNode.cpp        2015-05-15 21:59:50 UTC (rev 184419)
+++ trunk/Source/WebCore/dom/ContainerNode.cpp        2015-05-15 22:55:53 UTC (rev 184420)
</span><span class="lines">@@ -32,6 +32,9 @@
</span><span class="cx"> #include &quot;Editor.h&quot;
</span><span class="cx"> #include &quot;FloatRect.h&quot;
</span><span class="cx"> #include &quot;FrameView.h&quot;
</span><ins>+#include &quot;HTMLFormControlsCollection.h&quot;
+#include &quot;HTMLOptionsCollection.h&quot;
+#include &quot;HTMLTableRowsCollection.h&quot;
</ins><span class="cx"> #include &quot;InlineTextBox.h&quot;
</span><span class="cx"> #include &quot;InsertionPoint.h&quot;
</span><span class="cx"> #include &quot;JSLazyEventListener.h&quot;
</span><span class="lines">@@ -912,26 +915,46 @@
</span><span class="cx">     return ensureRareData().ensureNodeLists().addCacheWithAtomicName&lt;RadioNodeList&gt;(*this, name);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+Ref&lt;HTMLCollection&gt; ContainerNode::children()
+{
+    return ensureCachedHTMLCollection(NodeChildren);
+}
+
</ins><span class="cx"> Element* ContainerNode::firstElementChild() const
</span><span class="cx"> {
</span><del>-    ASSERT(is&lt;Document&gt;(*this) || is&lt;DocumentFragment&gt;(*this) || is&lt;Element&gt;(*this));
-
</del><span class="cx">     return ElementTraversal::firstChild(*this);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Element* ContainerNode::lastElementChild() const
</span><span class="cx"> {
</span><del>-    ASSERT(is&lt;Document&gt;(*this) || is&lt;DocumentFragment&gt;(*this) || is&lt;Element&gt;(*this));
-
</del><span class="cx">     return ElementTraversal::lastChild(*this);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> unsigned ContainerNode::childElementCount() const
</span><span class="cx"> {
</span><del>-    ASSERT(is&lt;Document&gt;(*this) || is&lt;DocumentFragment&gt;(*this) || is&lt;Element&gt;(*this));
-
</del><span class="cx">     auto children = childrenOfType&lt;Element&gt;(*this);
</span><span class="cx">     return std::distance(children.begin(), children.end());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+Ref&lt;HTMLCollection&gt; ContainerNode::ensureCachedHTMLCollection(CollectionType type)
+{
+    if (HTMLCollection* collection = cachedHTMLCollection(type))
+        return *collection;
+
+    if (type == TableRows)
+        return ensureRareData().ensureNodeLists().addCachedCollection&lt;HTMLTableRowsCollection&gt;(downcast&lt;HTMLTableElement&gt;(*this), type);
+    else if (type == SelectOptions)
+        return ensureRareData().ensureNodeLists().addCachedCollection&lt;HTMLOptionsCollection&gt;(downcast&lt;HTMLSelectElement&gt;(*this), type);
+    else if (type == FormControls) {
+        ASSERT(hasTagName(HTMLNames::formTag) || hasTagName(HTMLNames::fieldsetTag));
+        return ensureRareData().ensureNodeLists().addCachedCollection&lt;HTMLFormControlsCollection&gt;(*this, type);
+    }
+    return ensureRareData().ensureNodeLists().addCachedCollection&lt;HTMLCollection&gt;(*this, type);
+}
+
+HTMLCollection* ContainerNode::cachedHTMLCollection(CollectionType type)
+{
+    return hasRareData() &amp;&amp; rareData()-&gt;nodeLists() ? rareData()-&gt;nodeLists()-&gt;cachedCollection&lt;HTMLCollection&gt;(type) : nullptr;
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoredomContainerNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ContainerNode.h (184419 => 184420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ContainerNode.h        2015-05-15 21:59:50 UTC (rev 184419)
+++ trunk/Source/WebCore/dom/ContainerNode.h        2015-05-15 22:55:53 UTC (rev 184420)
</span><span class="lines">@@ -24,11 +24,13 @@
</span><span class="cx"> #ifndef ContainerNode_h
</span><span class="cx"> #define ContainerNode_h
</span><span class="cx"> 
</span><ins>+#include &quot;CollectionType.h&quot;
</ins><span class="cx"> #include &quot;ExceptionCodePlaceholder.h&quot;
</span><span class="cx"> #include &quot;Node.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+class HTMLCollection;
</ins><span class="cx"> class QualifiedName;
</span><span class="cx"> class RenderElement;
</span><span class="cx"> 
</span><span class="lines">@@ -146,6 +148,7 @@
</span><span class="cx">     RefPtr&lt;RadioNodeList&gt; radioNodeList(const AtomicString&amp;);
</span><span class="cx"> 
</span><span class="cx">     // From the ParentNode interface - https://dom.spec.whatwg.org/#interface-parentnode
</span><ins>+    Ref&lt;HTMLCollection&gt; children();
</ins><span class="cx">     Element* firstElementChild() const;
</span><span class="cx">     Element* lastElementChild() const;
</span><span class="cx">     unsigned childElementCount() const;
</span><span class="lines">@@ -163,6 +166,9 @@
</span><span class="cx">     void setFirstChild(Node* child) { m_firstChild = child; }
</span><span class="cx">     void setLastChild(Node* child) { m_lastChild = child; }
</span><span class="cx"> 
</span><ins>+    Ref&lt;HTMLCollection&gt; ensureCachedHTMLCollection(CollectionType);
+    HTMLCollection* cachedHTMLCollection(CollectionType);
+
</ins><span class="cx"> private:
</span><span class="cx">     void removeBetween(Node* previousChild, Node* nextChild, Node&amp; oldChild);
</span><span class="cx">     void insertBeforeCommon(Node&amp; nextChild, Node&amp; oldChild);
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.cpp (184419 => 184420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.cpp        2015-05-15 21:59:50 UTC (rev 184419)
+++ trunk/Source/WebCore/dom/Element.cpp        2015-05-15 22:55:53 UTC (rev 184420)
</span><span class="lines">@@ -48,13 +48,10 @@
</span><span class="cx"> #include &quot;HTMLCanvasElement.h&quot;
</span><span class="cx"> #include &quot;HTMLCollection.h&quot;
</span><span class="cx"> #include &quot;HTMLDocument.h&quot;
</span><del>-#include &quot;HTMLFormControlsCollection.h&quot;
</del><span class="cx"> #include &quot;HTMLLabelElement.h&quot;
</span><span class="cx"> #include &quot;HTMLNameCollection.h&quot;
</span><del>-#include &quot;HTMLOptionsCollection.h&quot;
</del><span class="cx"> #include &quot;HTMLParserIdioms.h&quot;
</span><span class="cx"> #include &quot;HTMLSelectElement.h&quot;
</span><del>-#include &quot;HTMLTableRowsCollection.h&quot;
</del><span class="cx"> #include &quot;HTMLTemplateElement.h&quot;
</span><span class="cx"> #include &quot;IdTargetObserverRegistry.h&quot;
</span><span class="cx"> #include &quot;InsertionPoint.h&quot;
</span><span class="lines">@@ -3056,27 +3053,6 @@
</span><span class="cx">     dispatchSubtreeModifiedEvent();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Ref&lt;HTMLCollection&gt; Element::ensureCachedHTMLCollection(CollectionType type)
-{
-    if (HTMLCollection* collection = cachedHTMLCollection(type))
-        return *collection;
-
-    if (type == TableRows) {
-        return ensureRareData().ensureNodeLists().addCachedCollection&lt;HTMLTableRowsCollection&gt;(downcast&lt;HTMLTableElement&gt;(*this), type);
-    } else if (type == SelectOptions) {
-        return ensureRareData().ensureNodeLists().addCachedCollection&lt;HTMLOptionsCollection&gt;(downcast&lt;HTMLSelectElement&gt;(*this), type);
-    } else if (type == FormControls) {
-        ASSERT(hasTagName(formTag) || hasTagName(fieldsetTag));
-        return ensureRareData().ensureNodeLists().addCachedCollection&lt;HTMLFormControlsCollection&gt;(*this, type);
-    }
-    return ensureRareData().ensureNodeLists().addCachedCollection&lt;HTMLCollection&gt;(*this, type);
-}
-
-HTMLCollection* Element::cachedHTMLCollection(CollectionType type)
-{
-    return hasRareData() &amp;&amp; rareData()-&gt;nodeLists() ? rareData()-&gt;nodeLists()-&gt;cachedCollection&lt;HTMLCollection&gt;(type) : 0;
-}
-
</del><span class="cx"> IntSize Element::savedLayerScrollOffset() const
</span><span class="cx"> {
</span><span class="cx">     return hasRareData() ? elementRareData()-&gt;savedLayerScrollOffset() : IntSize();
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.h (184419 => 184420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.h        2015-05-15 21:59:50 UTC (rev 184419)
+++ trunk/Source/WebCore/dom/Element.h        2015-05-15 22:55:53 UTC (rev 184420)
</span><span class="lines">@@ -25,7 +25,6 @@
</span><span class="cx"> #ifndef Element_h
</span><span class="cx"> #define Element_h
</span><span class="cx"> 
</span><del>-#include &quot;CollectionType.h&quot;
</del><span class="cx"> #include &quot;Document.h&quot;
</span><span class="cx"> #include &quot;ElementData.h&quot;
</span><span class="cx"> #include &quot;HTMLNames.h&quot;
</span><span class="lines">@@ -498,9 +497,6 @@
</span><span class="cx">     void clearTabIndexExplicitlyIfNeeded();
</span><span class="cx">     void setTabIndexExplicitly(short);
</span><span class="cx"> 
</span><del>-    Ref&lt;HTMLCollection&gt; ensureCachedHTMLCollection(CollectionType);
-    HTMLCollection* cachedHTMLCollection(CollectionType);
-
</del><span class="cx">     // classAttributeChanged() exists to share code between
</span><span class="cx">     // parseAttribute (called via setAttribute()) and
</span><span class="cx">     // svgAttributeChanged (called when element.className.baseValue is set)
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Node.cpp (184419 => 184420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Node.cpp        2015-05-15 21:59:50 UTC (rev 184419)
+++ trunk/Source/WebCore/dom/Node.cpp        2015-05-15 22:55:53 UTC (rev 184420)
</span><span class="lines">@@ -432,15 +432,11 @@
</span><span class="cx"> 
</span><span class="cx"> Element* Node::previousElementSibling() const
</span><span class="cx"> {
</span><del>-    ASSERT(is&lt;CharacterData&gt;(*this) || is&lt;Element&gt;(*this));
-
</del><span class="cx">     return ElementTraversal::previousSibling(*this);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Element* Node::nextElementSibling() const
</span><span class="cx"> {
</span><del>-    ASSERT(is&lt;CharacterData&gt;(*this) || is&lt;Element&gt;(*this));
-
</del><span class="cx">     return ElementTraversal::nextSibling(*this);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredomParentNodeidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ParentNode.idl (184419 => 184420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ParentNode.idl        2015-05-15 21:59:50 UTC (rev 184419)
+++ trunk/Source/WebCore/dom/ParentNode.idl        2015-05-15 22:55:53 UTC (rev 184420)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> [
</span><span class="cx">     NoInterfaceObject,
</span><span class="cx"> ] interface ParentNode {
</span><ins>+    readonly attribute HTMLCollection children;
</ins><span class="cx">     readonly attribute Element firstElementChild;
</span><span class="cx">     readonly attribute Element lastElementChild;
</span><span class="cx">     readonly attribute unsigned long childElementCount;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLElement.cpp (184419 => 184420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLElement.cpp        2015-05-15 21:59:50 UTC (rev 184419)
+++ trunk/Source/WebCore/html/HTMLElement.cpp        2015-05-15 22:55:53 UTC (rev 184420)
</span><span class="lines">@@ -861,11 +861,6 @@
</span><span class="cx">     setAttribute(translateAttr, enable ? &quot;yes&quot; : &quot;no&quot;);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Ref&lt;HTMLCollection&gt; HTMLElement::children()
-{
-    return ensureCachedHTMLCollection(NodeChildren);
-}
-
</del><span class="cx"> bool HTMLElement::rendererIsNeeded(const RenderStyle&amp; style)
</span><span class="cx"> {
</span><span class="cx">     if (hasTagName(noscriptTag)) {
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLElement.h (184419 => 184420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLElement.h        2015-05-15 21:59:50 UTC (rev 184419)
+++ trunk/Source/WebCore/html/HTMLElement.h        2015-05-15 22:55:53 UTC (rev 184420)
</span><span class="lines">@@ -42,8 +42,6 @@
</span><span class="cx"> public:
</span><span class="cx">     static Ref&lt;HTMLElement&gt; create(const QualifiedName&amp; tagName, Document&amp;);
</span><span class="cx"> 
</span><del>-    Ref&lt;HTMLCollection&gt; children();
-
</del><span class="cx">     WEBCORE_EXPORT virtual String title() const override final;
</span><span class="cx"> 
</span><span class="cx">     virtual short tabIndex() const override;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLElementidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLElement.idl (184419 => 184420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLElement.idl        2015-05-15 21:59:50 UTC (rev 184419)
+++ trunk/Source/WebCore/html/HTMLElement.idl        2015-05-15 22:55:53 UTC (rev 184420)
</span><span class="lines">@@ -48,7 +48,9 @@
</span><span class="cx">     [RaisesException] void insertAdjacentText([Default=Undefined] optional DOMString where,
</span><span class="cx">                             [Default=Undefined] optional DOMString text);
</span><span class="cx"> 
</span><ins>+#if defined(LANGUAGE_OBJECTIVE_C) &amp;&amp; LANGUAGE_OBJECTIVE_C
</ins><span class="cx">     readonly attribute HTMLCollection children;
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">              [TreatNullAs=NullString, SetterRaisesException] attribute DOMString contentEditable;
</span><span class="cx">     readonly attribute boolean isContentEditable;
</span></span></pre>
</div>
</div>

</body>
</html>