REGRESSION (r111229): css1/basic/inheritance.html is failing
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Mar 2012 18:37:58 +0000 (18:37 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Mar 2012 18:37:58 +0000 (18:37 +0000)
https://bugs.webkit.org/show_bug.cgi?id=81684

Reverted r111229.

Rubber-stamped by Dave Hyatt.

Source/WebCore:

* dom/Document.cpp:
(WebCore::Document::webkitGetFlowByName):
* dom/Document.h:
(Document):
* dom/Element.cpp:
(WebCore::Element::detach):
* dom/NodeRenderingContext.cpp:
(WebCore::NodeRenderingContext::moveToFlowThreadIfNeeded):
* dom/WebKitNamedFlow.cpp:
(WebCore):
* dom/WebKitNamedFlow.h:
(WebCore):
(WebKitNamedFlow):
* dom/WebKitNamedFlow.idl:

LayoutTests:

* fast/regions/webkit-named-flow-content-nodes-expected.txt: Removed.
* fast/regions/webkit-named-flow-content-nodes.html: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@111419 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/regions/webkit-named-flow-content-nodes-expected.txt [deleted file]
LayoutTests/fast/regions/webkit-named-flow-content-nodes.html [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/NodeRenderingContext.cpp
Source/WebCore/dom/WebKitNamedFlow.cpp
Source/WebCore/dom/WebKitNamedFlow.h
Source/WebCore/dom/WebKitNamedFlow.idl

index 4da7138bd88b3e7592d8edfa7df5205210e706fc..43cc0af3785d38b2d9cf3871a90b6333fffeeff5 100644 (file)
@@ -1,3 +1,15 @@
+2012-03-20  Dan Bernstein  <mitz@apple.com>
+
+        REGRESSION (r111229): css1/basic/inheritance.html is failing
+        https://bugs.webkit.org/show_bug.cgi?id=81684
+
+        Reverted r111229.
+
+        Rubber-stamped by Dave Hyatt.
+
+        * fast/regions/webkit-named-flow-content-nodes-expected.txt: Removed.
+        * fast/regions/webkit-named-flow-content-nodes.html: Removed.
+
 2012-03-20  Dan Bernstein  <mitz@apple.com>
 
         Updated expected results for a test, while <http://webkit.org/b/81679> is tracking this
diff --git a/LayoutTests/fast/regions/webkit-named-flow-content-nodes-expected.txt b/LayoutTests/fast/regions/webkit-named-flow-content-nodes-expected.txt
deleted file mode 100644 (file)
index f97d24d..0000000
+++ /dev/null
@@ -1,33 +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
-WARN: shouldBe() expects string arguments
-PASS true 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 successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/LayoutTests/fast/regions/webkit-named-flow-content-nodes.html b/LayoutTests/fast/regions/webkit-named-flow-content-nodes.html
deleted file mode 100644 (file)
index 0eebe9e..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-<!doctype html>
-<html>
-    <head>
-        <script src="../../fast/js/resources/js-test-pre.js"></script>
-        <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");
-
-            document.getElementById("region").style.visibility = "hidden";
-        </script>
-        <script src="../../fast/js/resources/js-test-post.js"></script>
-    </body>
-</html>
index 1991970abe476391dc0c3c55432665c79de0b34d..9b4411ca4221e347c9426ca62dda00eae7e271ce 100644 (file)
@@ -1,3 +1,27 @@
+2012-03-20  Dan Bernstein  <mitz@apple.com>
+
+        REGRESSION (r111229): css1/basic/inheritance.html is failing
+        https://bugs.webkit.org/show_bug.cgi?id=81684
+
+        Reverted r111229.
+
+        Rubber-stamped by Dave Hyatt.
+
+        * dom/Document.cpp:
+        (WebCore::Document::webkitGetFlowByName):
+        * dom/Document.h:
+        (Document):
+        * dom/Element.cpp:
+        (WebCore::Element::detach):
+        * dom/NodeRenderingContext.cpp:
+        (WebCore::NodeRenderingContext::moveToFlowThreadIfNeeded):
+        * dom/WebKitNamedFlow.cpp:
+        (WebCore):
+        * dom/WebKitNamedFlow.h:
+        (WebCore):
+        (WebKitNamedFlow):
+        * dom/WebKitNamedFlow.idl:
+
 2012-03-20  Vineet Chaudhary  <rgf748@motorola.com>
 
         https://bugs.webkit.org/show_bug.cgi?id=80696
index 7af50c073f0995db567ee55801ca3dd03e0729f1..e75c9d3d7b6d4a6ad338064cf6e0278de9888aa1 100644 (file)
@@ -1038,23 +1038,13 @@ static bool validFlowName(const String& flowName)
 
 PassRefPtr<WebKitNamedFlow> Document::webkitGetFlowByName(const String& flowName)
 {
-    return webkitGetFlowByName(flowName, CheckFlowNameForInvalidValues);
-}
-
-PassRefPtr<WebKitNamedFlow> Document::webkitGetFlowByName(const String& flowName, FlowNameCheck flowNameCheck)
-{
-    if (!cssRegionsEnabled() || !renderer())
+    if (!cssRegionsEnabled() || flowName.isEmpty() || !validFlowName(flowName) || !renderer())
         return 0;
 
-    if (flowNameCheck == CheckFlowNameForInvalidValues) {
-        if (flowName.isEmpty() || !validFlowName(flowName))
-            return 0;
-
-        // Make a slower check for invalid flow name
-        CSSParser parser(true);
-        if (!parser.parseFlowThread(flowName, this))
-            return 0;
-    }
+    // Make a slower check for invalid flow name
+    CSSParser p(true);
+    if (!p.parseFlowThread(flowName, this))
+        return 0;
 
     if (RenderView* view = renderer()->view())
         return view->ensureRenderFlowThreadWithName(flowName)->ensureNamedFlow();
index 7ac7bd78c5dad9dc5e73b92d4ad63d3a3fce03f5..cc81b32f048ef2d161366beeda6b6a810906c13a 100644 (file)
@@ -352,12 +352,7 @@ public:
     PassRefPtr<Element> createElement(const QualifiedName&, bool createdByParser);
 
     bool cssRegionsEnabled() const;
-    enum FlowNameCheck {
-        CheckFlowNameForInvalidValues,
-        DoNotCheckFlowNameForInvalidValues
-    };
     PassRefPtr<WebKitNamedFlow> webkitGetFlowByName(const String&);
-    PassRefPtr<WebKitNamedFlow> webkitGetFlowByName(const String&, FlowNameCheck);
 
     bool regionBasedColumnsEnabled() const;
 
index 920db33f9be342949f63699d9263599eb9cf7256..f7b6697312b640351518dd3eac47369d6da936c3 100644 (file)
@@ -66,9 +66,8 @@
 #include "ShadowRoot.h"
 #include "Text.h"
 #include "TextIterator.h"
-#include "WebKitAnimationList.h"
 #include "WebKitMutationObserver.h"
-#include "WebKitNamedFlow.h"
+#include "WebKitAnimationList.h"
 #include "XMLNSNames.h"
 #include "XMLNames.h"
 #include "htmlediting.h"
@@ -980,15 +979,6 @@ void Element::detach()
 {
     RenderWidget::suspendWidgetHierarchyUpdates();
 
-    if (document()->cssRegionsEnabled()) {
-        RenderStyle* style = renderer() ? renderer()->style() : computedStyle();
-        if (style && !style->flowThread().isEmpty()) {
-            RefPtr<WebKitNamedFlow> namedFlow = document()->webkitGetFlowByName(style->flowThread(), Document::DoNotCheckFlowNameForInvalidValues);
-            if (namedFlow)
-                namedFlow->unregisterContentNode(this);
-        }
-    }
-
     cancelFocusAppearanceUpdate();
     if (hasRareData())
         rareData()->resetComputedStyle();
index 525e112180dd3c8a363721e052a4e5c041213da9..93f3166685e1f78cc3a8426aacda671aa930d487 100644 (file)
@@ -38,7 +38,6 @@
 #include "RenderView.h"
 #include "ShadowRoot.h"
 #include "ShadowTree.h"
-#include "WebKitNamedFlow.h"
 
 #if ENABLE(SVG)
 #include "SVGNames.h"
@@ -328,7 +327,6 @@ void NodeRenderingContext::moveToFlowThreadIfNeeded()
     m_flowThread = m_style->flowThread();
     ASSERT(m_node->document()->renderView());
     m_parentFlowRenderer = m_node->document()->renderView()->ensureRenderFlowThreadWithName(m_flowThread);
-    m_parentFlowRenderer->ensureNamedFlow()->registerContentNode(m_node);
 }
 
 NodeRendererFactory::NodeRendererFactory(Node* node)
index b1574054de7523da2d9f6d6c7d23f000551aae01..8764ff9cf22f1edec67c4f442dc9b2eaad6c4f3f 100644 (file)
 #include "config.h"
 #include "WebKitNamedFlow.h"
 
-#include "Node.h"
-#include "NodeList.h"
 #include "RenderFlowThread.h"
-#include "RenderRegion.h"
-#include "StaticNodeList.h"
 
 namespace WebCore {
 
@@ -53,39 +49,6 @@ bool WebKitNamedFlow::overflow() const
     return m_parentFlowThread->overflow();
 }
 
-PassRefPtr<NodeList> WebKitNamedFlow::contentNodes() const
-{
-    m_parentFlowThread->document()->updateLayoutIgnorePendingStylesheets();
-
-    Vector<RefPtr<Node> > contentNodes;
-    for (NamedFlowContentNodes::const_iterator it = m_contentNodes.begin(); it != m_contentNodes.end(); ++it) {
-        Node* node = const_cast<Node*>(*it);
-        ASSERT(node->computedStyle()->flowThread() == m_parentFlowThread->flowThread());
-        contentNodes.append(node);
-    }
-
-    return StaticNodeList::adopt(contentNodes);
-}
-
-// The content nodes list contains those nodes with -webkit-flow-into: flow.
-// An element with display:none should also be listed among those nodes.
-// The list of nodes is orderer.
-void WebKitNamedFlow::registerContentNode(Node* contentNode)
-{
-    ASSERT(contentNode && contentNode->isElementNode());
-
-    // Find the first content node following the new content node.
-    for (NamedFlowContentNodes::iterator it = m_contentNodes.begin(); it != m_contentNodes.end(); ++it) {
-        Node* node = *it;
-        unsigned short position = contentNode->compareDocumentPosition(node);
-        if (position & Node::DOCUMENT_POSITION_FOLLOWING) {
-            m_contentNodes.insertBefore(node, contentNode);
-            return;
-        }
-    }
-    m_contentNodes.add(contentNode);
-}
-
 PassRefPtr<NodeList> WebKitNamedFlow::getRegionsByContentNode(Node* contentNode)
 {
     if (!contentNode)
index 5b6516079784d82f2b6f246f5b0a97992741c88c..e0cf788701da1c7785aa0ec2f83d339edc447206 100644 (file)
 #ifndef WebKitNamedFlow_h
 #define WebKitNamedFlow_h
 
-#include <Node.h>
-#include <wtf/ListHashSet.h>
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
 
 namespace WebCore {
 
-class NodeList;
 class RenderFlowThread;
 
 class WebKitNamedFlow : public RefCounted<WebKitNamedFlow> {
@@ -50,19 +47,12 @@ public:
     ~WebKitNamedFlow();
 
     bool overflow() const;
-    PassRefPtr<NodeList> contentNodes() const;
     PassRefPtr<NodeList> getRegionsByContentNode(Node*);
 
-    void registerContentNode(Node* contentNode);
-    void unregisterContentNode(Node* contentNode) { m_contentNodes.remove(contentNode); }
-
 private:
     WebKitNamedFlow(RenderFlowThread*);
 
     RenderFlowThread* m_parentFlowThread;
-
-    typedef ListHashSet<Node*> NamedFlowContentNodes;
-    NamedFlowContentNodes m_contentNodes;
 };
 
 }
index c8d3f2dfece3fd1c2fe9a2ca3d27560f220f8957..10a4d9e981c60be3053c661108a498d0d0378720 100644 (file)
@@ -32,7 +32,6 @@ module core {
         JSGenerateToJSObject
     ] WebKitNamedFlow {
         readonly attribute boolean overflow;
-        readonly attribute NodeList contentNodes;
         NodeList getRegionsByContentNode(in Node contentNode);
     };
 }