Diff
Modified: trunk/LayoutTests/ChangeLog (121455 => 121456)
--- trunk/LayoutTests/ChangeLog 2012-06-28 19:56:36 UTC (rev 121455)
+++ trunk/LayoutTests/ChangeLog 2012-06-28 20:02:07 UTC (rev 121456)
@@ -1,3 +1,17 @@
+2012-06-28 Andrei Onea <[email protected]>
+
+ [CSSRegions]Rename NamedFlow::contentNodes to NamedFlow::getContent()
+ https://bugs.webkit.org/show_bug.cgi?id=90163
+
+ Reviewed by Andreas Kling.
+
+ Changed test for NameFlow::contentNodes to reflect new spec, which uses
+ NameFlow::getContent().
+
+ * fast/regions/webkit-named-flow-content-nodes-expected.txt: Removed.
+ * fast/regions/webkit-named-flow-get-content-expected.txt: Added.
+ * fast/regions/webkit-named-flow-get-content.html: Renamed from LayoutTests/fast/regions/webkit-named-flow-content-nodes.html.
+
2012-06-28 Ryosuke Niwa <[email protected]>
REGRESSION(r121232): named properties on document and window may return wrong object
Deleted: trunk/LayoutTests/fast/regions/webkit-named-flow-content-nodes-expected.txt (121455 => 121456)
--- trunk/LayoutTests/fast/regions/webkit-named-flow-content-nodes-expected.txt 2012-06-28 19:56:36 UTC (rev 121455)
+++ trunk/LayoutTests/fast/regions/webkit-named-flow-content-nodes-expected.txt 2012-06-28 20:02:07 UTC (rev 121456)
@@ -1,38 +0,0 @@
-Test for 80134: [CSSRegions]Implement NamedFlow::contentNodes
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS namedFlowContentNodes is non-null.
-PASS namedFlowContentNodes.length is 0
-PASS namedFlowContentNodes instanceof NodeList is true
-PASS namedFlowContentNodes2.length is 0
-PASS namedFlowContentNodes3.length is 1
-PASS namedFlowContentNodes3.item(0).id is "article"
-PASS namedFlowContentNodes4.length is 1
-PASS namedFlowContentNodes4.item(0).id is "article"
-PASS namedFlowContentNodes5.length is 2
-PASS namedFlowContentNodes5.item(0).id is "article2"
-PASS namedFlowContentNodes5.item(1).id is "article"
-PASS namedFlowContentNodes6.length is 2
-PASS namedFlowContentNodes7.length is 2
-PASS namedFlowContentNodes8.length is 3
-PASS namedFlowContentNodes9.length is 3
-PASS namedFlowContentNodes9.item(0).id is "article2"
-PASS namedFlowContentNodes9.item(1).id is "span1"
-PASS namedFlowContentNodes9.item(2).id is "article"
-PASS namedFlowContentNodes10.length is 3
-PASS namedFlowContentNodes10.item(0).id is "article"
-PASS namedFlowContentNodes11.length is 5
-PASS namedFlowContentNodes12.length is 1
-PASS namedFlowContentNodes12.item(0).id is "article"
-PASS namedFlowContentNodes10.length is 0
-PASS namedFlowContentNodes11.length is 0
-PASS namedFlowContentNodes12.length is 1
-PASS namedFlowContentNodes12.item(0).id is "article"
-PASS namedFlowContentNodes13.length is 0
-PASS namedFlowContentNodes14.length is 0
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
Deleted: trunk/LayoutTests/fast/regions/webkit-named-flow-content-nodes.html (121455 => 121456)
--- trunk/LayoutTests/fast/regions/webkit-named-flow-content-nodes.html 2012-06-28 19:56:36 UTC (rev 121455)
+++ trunk/LayoutTests/fast/regions/webkit-named-flow-content-nodes.html 2012-06-28 20:02:07 UTC (rev 121456)
@@ -1,138 +0,0 @@
-<!doctype html>
-<html>
- <head>
- <script src=""
- <style>
- #region { -webkit-flow-from: flow; width: 250px; height: 150px; }
- </style>
- </head>
- <body>
- <!--
- 1. The content nodes collection for a named flow 'flow' contains only those elements that have
- the style property -webkit-flow-into set to 'flow'.
- 2. If an element has an ancestor with -webkit-flow-into = 'flow' but does not have its '-webkit-flow-into'
- set to 'flow' will not be listed among the content nodes for named flow 'flow'.
- 3. Elements with '-webkit-flow-into' set to 'flow' and 'display:none' should be listed among the content nodes
- for named flow object 'flow'.
- 4. The collection of nodes is returned in document order.
- -->
- <script>
- if (window.layoutTestController)
- window.layoutTestController.dumpAsText();
- description("Test for 80134: [CSSRegions]Implement NamedFlow::contentNodes");
-
- // First time ask for a named flow object, the contentNodes should be empty.
- var namedFlowContentNodes = document.webkitGetFlowByName("flow").contentNodes;
- shouldBeNonNull("namedFlowContentNodes");
- shouldEvaluateTo("namedFlowContentNodes.length", 0);
- shouldBeTrue("namedFlowContentNodes instanceof NodeList");
-
- // Add an element that would be collected by the named flow but do not add it to the DOM, the contentNodes should be empty.
- var article = document.createElement("div");
- article.id = "article";
- article.style.webkitFlowInto = "flow";
- var namedFlowContentNodes2 = document.webkitGetFlowByName("flow").contentNodes;
- shouldEvaluateTo("namedFlowContentNodes2.length", 0);
-
- // Append the above element to the DOM. It will be collected by the flow, therefore the contentNodes should have 1 element.
- document.body.appendChild(article);
- var namedFlowContentNodes3 = document.webkitGetFlowByName("flow").contentNodes;
- shouldEvaluateTo("namedFlowContentNodes3.length", 1);
- shouldBeEqualToString("namedFlowContentNodes3.item(0).id", "article");
-
- // Append a child element to the article above but do not set its style to flow into 'flow'.
- // The contentNodes should still have 1 element.
- var pNode = document.createElement("p");
- pNode.id = "p1";
- document.getElementById("article").appendChild(pNode);
- var namedFlowContentNodes4 = document.webkitGetFlowByName("flow").contentNodes;
- shouldEvaluateTo("namedFlowContentNodes4.length", 1);
- shouldBeEqualToString("namedFlowContentNodes4.item(0).id", "article");
-
- // Add another element directly to the flow and set its 'display' property to 'none', it should be part of the flow.
- var article2 = document.createElement("div");
- article2.id = "article2";
- article2.style.webkitFlowInto = "flow";
- article2.style.display = "none";
- document.body.insertBefore(article2, article);
-
- var namedFlowContentNodes5 = document.webkitGetFlowByName("flow").contentNodes;
- shouldEvaluateTo("namedFlowContentNodes5.length", 2);
- shouldBeEqualToString("namedFlowContentNodes5.item(0).id", "article2");
- shouldBeEqualToString("namedFlowContentNodes5.item(1).id", "article");
-
- // Adding a region element to flow content into should not influence the content nodes collection.
- var regionNode = document.createElement("div");
- regionNode.id = "region";
- document.body.appendChild(regionNode);
- var namedFlowContentNodes6 = document.webkitGetFlowByName("flow").contentNodes;
- shouldEvaluateTo("namedFlowContentNodes6.length", 2);
-
- // Change display:none for the 'article2' element, the list of contentNodes should stay the same
- document.getElementById("article2").style.display = "block";
- var namedFlowContentNodes7 = document.webkitGetFlowByName("flow").contentNodes;
- shouldEvaluateTo("namedFlowContentNodes7.length", 2);
-
- // Add a p and a span under p. Make the span directly collected by the flow. The contentNodes collection should have 3 elements.
- pNode = document.createElement("p");
- pNode.id = "p2";
- var spanNode = document.createElement("span");
- spanNode.id = "span1";
- spanNode.style.webkitFlowInto = "flow";
- pNode.appendChild(spanNode);
- document.getElementById("article2").appendChild(pNode);
-
- var namedFlowContentNodes8 = document.webkitGetFlowByName("flow").contentNodes;
- shouldEvaluateTo("namedFlowContentNodes8.length", 3);
-
- // Change display of article node to none, the collection should still have 3 elements.
- document.getElementById("article").style.display = "none";
- var namedFlowContentNodes9 = document.webkitGetFlowByName("flow").contentNodes;
- shouldEvaluateTo("namedFlowContentNodes9.length", 3);
- shouldBeEqualToString("namedFlowContentNodes9.item(0).id", "article2");
- shouldBeEqualToString("namedFlowContentNodes9.item(1).id", "span1");
- shouldBeEqualToString("namedFlowContentNodes9.item(2).id", "article");
-
- // Take 'article' node from last position and insert it before 'article2'
- article = document.getElementById("article");
- document.body.insertBefore(document.body.removeChild(article), article2);
- var namedFlowContentNodes10 = document.webkitGetFlowByName("flow").contentNodes;
- shouldEvaluateTo("namedFlowContentNodes10.length", 3);
- shouldBeEqualToString("namedFlowContentNodes10.item(0).id", "article");
-
- // Clone 'article2' including its children.
- var article2Clone = document.getElementById("article2").cloneNode(true);
- document.body.appendChild(article2Clone);
- var namedFlowContentNodes11 = document.webkitGetFlowByName("flow").contentNodes;
- shouldEvaluateTo("namedFlowContentNodes11.length", 5);
- // Remove article2 nodes from document, they should be removed from flow.
- document.body.removeChild(article2);
- document.body.removeChild(article2Clone);
- var namedFlowContentNodes12 = document.webkitGetFlowByName("flow").contentNodes;
- shouldEvaluateTo("namedFlowContentNodes12.length", 1);
- shouldBeEqualToString("namedFlowContentNodes12.item(0).id", "article");
-
- // Get the content nodes for another flow, flow2.
- var namedFlowContentNodes10 = document.webkitGetFlowByName("flow2").contentNodes;
- shouldEvaluateTo("namedFlowContentNodes10.length", "0");
-
- // Move the content node 'article' from named flow 'flow' to named flow 'flow2'
- document.getElementById("article").style.webkitFlowInto = "flow2";
- var namedFlowContentNodes11 = document.webkitGetFlowByName("flow").contentNodes;
- var namedFlowContentNodes12 = document.webkitGetFlowByName("flow2").contentNodes;
- shouldEvaluateTo("namedFlowContentNodes11.length", "0");
- shouldEvaluateTo("namedFlowContentNodes12.length", "1");
- shouldBeEqualToString("namedFlowContentNodes12.item(0).id", "article");
-
- // Remove the content node from dom, content nodes for both 'flow' and 'flow2' should be empty
- document.body.removeChild(document.getElementById("article"));
- var namedFlowContentNodes13 = document.webkitGetFlowByName("flow").contentNodes;
- var namedFlowContentNodes14 = document.webkitGetFlowByName("flow2").contentNodes;
- shouldEvaluateTo("namedFlowContentNodes13.length", "0");
- shouldEvaluateTo("namedFlowContentNodes14.length", "0");
-
- document.getElementById("region").style.visibility = "hidden";
- </script>
- <script src=""
- </body>
-</html>
Added: trunk/LayoutTests/fast/regions/webkit-named-flow-get-content-expected.txt (0 => 121456)
--- trunk/LayoutTests/fast/regions/webkit-named-flow-get-content-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/regions/webkit-named-flow-get-content-expected.txt 2012-06-28 20:02:07 UTC (rev 121456)
@@ -0,0 +1,38 @@
+Test for 90163: [CSSRegions]Rename NamedFlow::contentNodes to NamedFlow::getContent()
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS namedFlowContent is non-null.
+PASS namedFlowContent.length is 0
+PASS namedFlowContent instanceof NodeList is true
+PASS namedFlowContent2.length is 0
+PASS namedFlowContent3.length is 1
+PASS namedFlowContent3.item(0).id is "article"
+PASS namedFlowContent4.length is 1
+PASS namedFlowContent4.item(0).id is "article"
+PASS namedFlowContent5.length is 2
+PASS namedFlowContent5.item(0).id is "article2"
+PASS namedFlowContent5.item(1).id is "article"
+PASS namedFlowContent6.length is 2
+PASS namedFlowContent7.length is 2
+PASS namedFlowContent8.length is 3
+PASS namedFlowContent9.length is 3
+PASS namedFlowContent9.item(0).id is "article2"
+PASS namedFlowContent9.item(1).id is "span1"
+PASS namedFlowContent9.item(2).id is "article"
+PASS namedFlowContent10.length is 3
+PASS namedFlowContent10.item(0).id is "article"
+PASS namedFlowContent11.length is 5
+PASS namedFlowContent12.length is 1
+PASS namedFlowContent12.item(0).id is "article"
+PASS namedFlowContent10.length is 0
+PASS namedFlowContent11.length is 0
+PASS namedFlowContent12.length is 1
+PASS namedFlowContent12.item(0).id is "article"
+PASS namedFlowContent13.length is 0
+PASS namedFlowContent14.length is 0
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Copied: trunk/LayoutTests/fast/regions/webkit-named-flow-get-content.html (from rev 121455, trunk/LayoutTests/fast/regions/webkit-named-flow-content-nodes.html) (0 => 121456)
--- trunk/LayoutTests/fast/regions/webkit-named-flow-get-content.html (rev 0)
+++ trunk/LayoutTests/fast/regions/webkit-named-flow-get-content.html 2012-06-28 20:02:07 UTC (rev 121456)
@@ -0,0 +1,138 @@
+<!doctype html>
+<html>
+ <head>
+ <script src=""
+ <style>
+ #region { -webkit-flow-from: flow; width: 250px; height: 150px; }
+ </style>
+ </head>
+ <body>
+ <!--
+ 1. The content nodes collection for a named flow 'flow' contains only those elements that have
+ the style property -webkit-flow-into set to 'flow'.
+ 2. If an element has an ancestor with -webkit-flow-into = 'flow' but does not have its '-webkit-flow-into'
+ set to 'flow' will not be listed among the content nodes for named flow 'flow'.
+ 3. Elements with '-webkit-flow-into' set to 'flow' and 'display:none' should be listed among the content nodes
+ for named flow object 'flow'.
+ 4. The collection of nodes is returned in document order.
+ -->
+ <script>
+ if (window.layoutTestController)
+ window.layoutTestController.dumpAsText();
+ description("Test for 90163: [CSSRegions]Rename NamedFlow::contentNodes to NamedFlow::getContent()");
+
+ // First time ask for a named flow object, the contentNodes should be empty.
+ var namedFlowContent = document.webkitGetFlowByName("flow").getContent();
+ shouldBeNonNull("namedFlowContent");
+ shouldEvaluateTo("namedFlowContent.length", 0);
+ shouldBeTrue("namedFlowContent instanceof NodeList");
+
+ // Add an element that would be collected by the named flow but do not add it to the DOM, the contentNodes should be empty.
+ var article = document.createElement("div");
+ article.id = "article";
+ article.style.webkitFlowInto = "flow";
+ var namedFlowContent2 = document.webkitGetFlowByName("flow").getContent();
+ shouldEvaluateTo("namedFlowContent2.length", 0);
+
+ // Append the above element to the DOM. It will be collected by the flow, therefore the contentNodes should have 1 element.
+ document.body.appendChild(article);
+ var namedFlowContent3 = document.webkitGetFlowByName("flow").getContent();
+ shouldEvaluateTo("namedFlowContent3.length", 1);
+ shouldBeEqualToString("namedFlowContent3.item(0).id", "article");
+
+ // Append a child element to the article above but do not set its style to flow into 'flow'.
+ // The contentNodes should still have 1 element.
+ var pNode = document.createElement("p");
+ pNode.id = "p1";
+ document.getElementById("article").appendChild(pNode);
+ var namedFlowContent4 = document.webkitGetFlowByName("flow").getContent();
+ shouldEvaluateTo("namedFlowContent4.length", 1);
+ shouldBeEqualToString("namedFlowContent4.item(0).id", "article");
+
+ // Add another element directly to the flow and set its 'display' property to 'none', it should be part of the flow.
+ var article2 = document.createElement("div");
+ article2.id = "article2";
+ article2.style.webkitFlowInto = "flow";
+ article2.style.display = "none";
+ document.body.insertBefore(article2, article);
+
+ var namedFlowContent5 = document.webkitGetFlowByName("flow").getContent();
+ shouldEvaluateTo("namedFlowContent5.length", 2);
+ shouldBeEqualToString("namedFlowContent5.item(0).id", "article2");
+ shouldBeEqualToString("namedFlowContent5.item(1).id", "article");
+
+ // Adding a region element to flow content into should not influence the content nodes collection.
+ var regionNode = document.createElement("div");
+ regionNode.id = "region";
+ document.body.appendChild(regionNode);
+ var namedFlowContent6 = document.webkitGetFlowByName("flow").getContent();
+ shouldEvaluateTo("namedFlowContent6.length", 2);
+
+ // Change display:none for the 'article2' element, the list of contentNodes should stay the same
+ document.getElementById("article2").style.display = "block";
+ var namedFlowContent7 = document.webkitGetFlowByName("flow").getContent();
+ shouldEvaluateTo("namedFlowContent7.length", 2);
+
+ // Add a p and a span under p. Make the span directly collected by the flow. The contentNodes collection should have 3 elements.
+ pNode = document.createElement("p");
+ pNode.id = "p2";
+ var spanNode = document.createElement("span");
+ spanNode.id = "span1";
+ spanNode.style.webkitFlowInto = "flow";
+ pNode.appendChild(spanNode);
+ document.getElementById("article2").appendChild(pNode);
+
+ var namedFlowContent8 = document.webkitGetFlowByName("flow").getContent();
+ shouldEvaluateTo("namedFlowContent8.length", 3);
+
+ // Change display of article node to none, the collection should still have 3 elements.
+ document.getElementById("article").style.display = "none";
+ var namedFlowContent9 = document.webkitGetFlowByName("flow").getContent();
+ shouldEvaluateTo("namedFlowContent9.length", 3);
+ shouldBeEqualToString("namedFlowContent9.item(0).id", "article2");
+ shouldBeEqualToString("namedFlowContent9.item(1).id", "span1");
+ shouldBeEqualToString("namedFlowContent9.item(2).id", "article");
+
+ // Take 'article' node from last position and insert it before 'article2'
+ article = document.getElementById("article");
+ document.body.insertBefore(document.body.removeChild(article), article2);
+ var namedFlowContent10 = document.webkitGetFlowByName("flow").getContent();
+ shouldEvaluateTo("namedFlowContent10.length", 3);
+ shouldBeEqualToString("namedFlowContent10.item(0).id", "article");
+
+ // Clone 'article2' including its children.
+ var article2Clone = document.getElementById("article2").cloneNode(true);
+ document.body.appendChild(article2Clone);
+ var namedFlowContent11 = document.webkitGetFlowByName("flow").getContent();
+ shouldEvaluateTo("namedFlowContent11.length", 5);
+ // Remove article2 nodes from document, they should be removed from flow.
+ document.body.removeChild(article2);
+ document.body.removeChild(article2Clone);
+ var namedFlowContent12 = document.webkitGetFlowByName("flow").getContent();
+ shouldEvaluateTo("namedFlowContent12.length", 1);
+ shouldBeEqualToString("namedFlowContent12.item(0).id", "article");
+
+ // Get the content nodes for another flow, flow2.
+ var namedFlowContent10 = document.webkitGetFlowByName("flow2").getContent();
+ shouldEvaluateTo("namedFlowContent10.length", "0");
+
+ // Move the content node 'article' from named flow 'flow' to named flow 'flow2'
+ document.getElementById("article").style.webkitFlowInto = "flow2";
+ var namedFlowContent11 = document.webkitGetFlowByName("flow").getContent();
+ var namedFlowContent12 = document.webkitGetFlowByName("flow2").getContent();
+ shouldEvaluateTo("namedFlowContent11.length", "0");
+ shouldEvaluateTo("namedFlowContent12.length", "1");
+ shouldBeEqualToString("namedFlowContent12.item(0).id", "article");
+
+ // Remove the content node from dom, content nodes for both 'flow' and 'flow2' should be empty
+ document.body.removeChild(document.getElementById("article"));
+ var namedFlowContent13 = document.webkitGetFlowByName("flow").getContent();
+ var namedFlowContent14 = document.webkitGetFlowByName("flow2").getContent();
+ shouldEvaluateTo("namedFlowContent13.length", "0");
+ shouldEvaluateTo("namedFlowContent14.length", "0");
+
+ document.getElementById("region").style.visibility = "hidden";
+ </script>
+ <script src=""
+ </body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (121455 => 121456)
--- trunk/Source/WebCore/ChangeLog 2012-06-28 19:56:36 UTC (rev 121455)
+++ trunk/Source/WebCore/ChangeLog 2012-06-28 20:02:07 UTC (rev 121456)
@@ -1,3 +1,22 @@
+2012-06-28 Andrei Onea <[email protected]>
+
+ [CSSRegions]Rename NamedFlow::contentNodes to NamedFlow::getContent()
+ https://bugs.webkit.org/show_bug.cgi?id=90163
+
+ Reviewed by Andreas Kling.
+
+ Latest CSS Regions spec defines the NamedFlow interface as having a function named getContent,
+ rather than an attribute named contentNodes.
+ http://www.w3.org/TR/css3-regions/#the-namedflow-interface
+
+ Test: fast/regions/webkit-named-flow-get-content.html
+
+ * dom/WebKitNamedFlow.cpp:
+ (WebCore::WebKitNamedFlow::getContent):
+ * dom/WebKitNamedFlow.h:
+ (WebKitNamedFlow):
+ * dom/WebKitNamedFlow.idl:
+
2012-06-28 Ryosuke Niwa <[email protected]>
REGRESSION(r121232): named properties on document and window may return wrong object
Modified: trunk/Source/WebCore/dom/WebKitNamedFlow.cpp (121455 => 121456)
--- trunk/Source/WebCore/dom/WebKitNamedFlow.cpp 2012-06-28 19:56:36 UTC (rev 121455)
+++ trunk/Source/WebCore/dom/WebKitNamedFlow.cpp 2012-06-28 20:02:07 UTC (rev 121456)
@@ -79,7 +79,7 @@
return StaticNodeList::adopt(regionNodes);
}
-PassRefPtr<NodeList> WebKitNamedFlow::contentNodes() const
+PassRefPtr<NodeList> WebKitNamedFlow::getContent()
{
m_parentFlowThread->document()->updateLayoutIgnorePendingStylesheets();
Modified: trunk/Source/WebCore/dom/WebKitNamedFlow.h (121455 => 121456)
--- trunk/Source/WebCore/dom/WebKitNamedFlow.h 2012-06-28 19:56:36 UTC (rev 121455)
+++ trunk/Source/WebCore/dom/WebKitNamedFlow.h 2012-06-28 20:02:07 UTC (rev 121456)
@@ -52,7 +52,7 @@
String name() const;
bool overset() const;
PassRefPtr<NodeList> getRegionsByContentNode(Node*);
- PassRefPtr<NodeList> contentNodes() const;
+ PassRefPtr<NodeList> getContent();
private:
WebKitNamedFlow(RenderNamedFlowThread*);
Modified: trunk/Source/WebCore/dom/WebKitNamedFlow.idl (121455 => 121456)
--- trunk/Source/WebCore/dom/WebKitNamedFlow.idl 2012-06-28 19:56:36 UTC (rev 121455)
+++ trunk/Source/WebCore/dom/WebKitNamedFlow.idl 2012-06-28 20:02:07 UTC (rev 121456)
@@ -34,7 +34,7 @@
readonly attribute DOMString name;
readonly attribute boolean overset;
NodeList getRegionsByContentNode(in Node contentNode);
- readonly attribute NodeList contentNodes;
+ NodeList getContent();
};
}