<!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 <sam@webkit.org>
+
+ 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 <zalan@apple.com>
</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 "PASS" messages, followed by "TEST COMPLETE".
+
+
+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>+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<script src="../../resources/js-test-pre.js"></script>
+</head>
+<body>
+<script>
+
+description("Tests the basic functionality of the `children` property on ParentNode.");
+
+shouldBeType("document.children", "HTMLCollection");
+shouldBeType("document.documentElement.children", "HTMLCollection");
+shouldBeType("document.createDocumentFragment().children", "HTMLCollection");
+
+shouldBe("document.children.length", "1");
+shouldBe("document.children[0]", "document.documentElement");
+
+shouldBe("document.documentElement.children.length", "2");
+shouldBe("document.documentElement.children[0]", "document.head");
+shouldBe("document.documentElement.children[1]", "document.body");
+
+var documentFragment = document.createDocumentFragment();
+var child1 = document.createElement("div");
+var child2 = document.createElement("div");
+documentFragment.appendChild(child1);
+documentFragment.appendChild(child2);
+
+shouldBe("documentFragment.children.length", "2");
+shouldBe("documentFragment.children[0]", "child1");
+shouldBe("documentFragment.children[1]", "child2");
+
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</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["accessKey"] is
</span><span class="cx"> PASS a["innerText"] is nerget
</span><span class="cx"> PASS a["outerText"] is nerget
</span><del>-PASS a["children"] is [object HTMLCollection]
</del><span class="cx"> PASS a["contentEditable"] is inherit
</span><span class="cx"> PASS a["isContentEditable"] is false
</span><span class="cx"> PASS a["spellcheck"] is true
</span><span class="lines">@@ -48,7 +47,7 @@
</span><span class="cx"> PASS a["style"] is [object CSSStyleDeclaration]
</span><span class="cx"> PASS a["id"] is foo
</span><span class="cx"> PASS a["offsetLeft"] is 8
</span><del>-PASS a["offsetTop"] is 759
</del><ins>+PASS a["offsetTop"] is 744
</ins><span class="cx"> PASS a["offsetWidth"] is 40
</span><span class="cx"> PASS a["offsetHeight"] is 18
</span><span class="cx"> PASS a["clientLeft"] is 0
</span><span class="lines">@@ -69,6 +68,7 @@
</span><span class="cx"> PASS a["webkitRegionOverset"] is undefined
</span><span class="cx"> PASS a["previousElementSibling"] is [object HTMLDivElement]
</span><span class="cx"> PASS a["nextElementSibling"] is [object HTMLScriptElement]
</span><ins>+PASS a["children"] is [object HTMLCollection]
</ins><span class="cx"> PASS a["firstElementChild"] is null
</span><span class="cx"> PASS a["lastElementChild"] is null
</span><span class="cx"> PASS a["childElementCount"] 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 <sam@webkit.org>
+
+ 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 <zalan@apple.com>
</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 "Editor.h"
</span><span class="cx"> #include "FloatRect.h"
</span><span class="cx"> #include "FrameView.h"
</span><ins>+#include "HTMLFormControlsCollection.h"
+#include "HTMLOptionsCollection.h"
+#include "HTMLTableRowsCollection.h"
</ins><span class="cx"> #include "InlineTextBox.h"
</span><span class="cx"> #include "InsertionPoint.h"
</span><span class="cx"> #include "JSLazyEventListener.h"
</span><span class="lines">@@ -912,26 +915,46 @@
</span><span class="cx"> return ensureRareData().ensureNodeLists().addCacheWithAtomicName<RadioNodeList>(*this, name);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+Ref<HTMLCollection> ContainerNode::children()
+{
+ return ensureCachedHTMLCollection(NodeChildren);
+}
+
</ins><span class="cx"> Element* ContainerNode::firstElementChild() const
</span><span class="cx"> {
</span><del>- ASSERT(is<Document>(*this) || is<DocumentFragment>(*this) || is<Element>(*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<Document>(*this) || is<DocumentFragment>(*this) || is<Element>(*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<Document>(*this) || is<DocumentFragment>(*this) || is<Element>(*this));
-
</del><span class="cx"> auto children = childrenOfType<Element>(*this);
</span><span class="cx"> return std::distance(children.begin(), children.end());
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+Ref<HTMLCollection> ContainerNode::ensureCachedHTMLCollection(CollectionType type)
+{
+ if (HTMLCollection* collection = cachedHTMLCollection(type))
+ return *collection;
+
+ if (type == TableRows)
+ return ensureRareData().ensureNodeLists().addCachedCollection<HTMLTableRowsCollection>(downcast<HTMLTableElement>(*this), type);
+ else if (type == SelectOptions)
+ return ensureRareData().ensureNodeLists().addCachedCollection<HTMLOptionsCollection>(downcast<HTMLSelectElement>(*this), type);
+ else if (type == FormControls) {
+ ASSERT(hasTagName(HTMLNames::formTag) || hasTagName(HTMLNames::fieldsetTag));
+ return ensureRareData().ensureNodeLists().addCachedCollection<HTMLFormControlsCollection>(*this, type);
+ }
+ return ensureRareData().ensureNodeLists().addCachedCollection<HTMLCollection>(*this, type);
+}
+
+HTMLCollection* ContainerNode::cachedHTMLCollection(CollectionType type)
+{
+ return hasRareData() && rareData()->nodeLists() ? rareData()->nodeLists()->cachedCollection<HTMLCollection>(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 "CollectionType.h"
</ins><span class="cx"> #include "ExceptionCodePlaceholder.h"
</span><span class="cx"> #include "Node.h"
</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<RadioNodeList> radioNodeList(const AtomicString&);
</span><span class="cx">
</span><span class="cx"> // From the ParentNode interface - https://dom.spec.whatwg.org/#interface-parentnode
</span><ins>+ Ref<HTMLCollection> 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<HTMLCollection> ensureCachedHTMLCollection(CollectionType);
+ HTMLCollection* cachedHTMLCollection(CollectionType);
+
</ins><span class="cx"> private:
</span><span class="cx"> void removeBetween(Node* previousChild, Node* nextChild, Node& oldChild);
</span><span class="cx"> void insertBeforeCommon(Node& nextChild, Node& 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 "HTMLCanvasElement.h"
</span><span class="cx"> #include "HTMLCollection.h"
</span><span class="cx"> #include "HTMLDocument.h"
</span><del>-#include "HTMLFormControlsCollection.h"
</del><span class="cx"> #include "HTMLLabelElement.h"
</span><span class="cx"> #include "HTMLNameCollection.h"
</span><del>-#include "HTMLOptionsCollection.h"
</del><span class="cx"> #include "HTMLParserIdioms.h"
</span><span class="cx"> #include "HTMLSelectElement.h"
</span><del>-#include "HTMLTableRowsCollection.h"
</del><span class="cx"> #include "HTMLTemplateElement.h"
</span><span class="cx"> #include "IdTargetObserverRegistry.h"
</span><span class="cx"> #include "InsertionPoint.h"
</span><span class="lines">@@ -3056,27 +3053,6 @@
</span><span class="cx"> dispatchSubtreeModifiedEvent();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-Ref<HTMLCollection> Element::ensureCachedHTMLCollection(CollectionType type)
-{
- if (HTMLCollection* collection = cachedHTMLCollection(type))
- return *collection;
-
- if (type == TableRows) {
- return ensureRareData().ensureNodeLists().addCachedCollection<HTMLTableRowsCollection>(downcast<HTMLTableElement>(*this), type);
- } else if (type == SelectOptions) {
- return ensureRareData().ensureNodeLists().addCachedCollection<HTMLOptionsCollection>(downcast<HTMLSelectElement>(*this), type);
- } else if (type == FormControls) {
- ASSERT(hasTagName(formTag) || hasTagName(fieldsetTag));
- return ensureRareData().ensureNodeLists().addCachedCollection<HTMLFormControlsCollection>(*this, type);
- }
- return ensureRareData().ensureNodeLists().addCachedCollection<HTMLCollection>(*this, type);
-}
-
-HTMLCollection* Element::cachedHTMLCollection(CollectionType type)
-{
- return hasRareData() && rareData()->nodeLists() ? rareData()->nodeLists()->cachedCollection<HTMLCollection>(type) : 0;
-}
-
</del><span class="cx"> IntSize Element::savedLayerScrollOffset() const
</span><span class="cx"> {
</span><span class="cx"> return hasRareData() ? elementRareData()->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 "CollectionType.h"
</del><span class="cx"> #include "Document.h"
</span><span class="cx"> #include "ElementData.h"
</span><span class="cx"> #include "HTMLNames.h"
</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<HTMLCollection> 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<CharacterData>(*this) || is<Element>(*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<CharacterData>(*this) || is<Element>(*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 ? "yes" : "no");
</span><span class="cx"> }
</span><span class="cx">
</span><del>-Ref<HTMLCollection> HTMLElement::children()
-{
- return ensureCachedHTMLCollection(NodeChildren);
-}
-
</del><span class="cx"> bool HTMLElement::rendererIsNeeded(const RenderStyle& 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<HTMLElement> create(const QualifiedName& tagName, Document&);
</span><span class="cx">
</span><del>- Ref<HTMLCollection> 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) && 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>