Title: [109417] trunk
Revision
109417
Author
[email protected]
Date
2012-03-01 13:53:23 -0800 (Thu, 01 Mar 2012)

Log Message

:empty still applies to elements made non-empty via page dynamics.
https://bugs.webkit.org/show_bug.cgi?id=79734

Check for :empty style change should be made even if the RenderStyle for the element is NULL
as changes to the element's children can trigger a change in :empty state of the parent element.

Patch by Joe Thomas <[email protected]> on 2012-03-01
Reviewed by Antti Koivisto.

Source/WebCore:

Test: fast/selectors/empty-element-made-non-empty.html

* dom/Element.cpp:
(WebCore::checkForSiblingStyleChanges):

LayoutTests:

* fast/selectors/empty-element-made-non-empty-expected.txt: Added.
* fast/selectors/empty-element-made-non-empty.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (109416 => 109417)


--- trunk/LayoutTests/ChangeLog	2012-03-01 21:52:01 UTC (rev 109416)
+++ trunk/LayoutTests/ChangeLog	2012-03-01 21:53:23 UTC (rev 109417)
@@ -1,3 +1,16 @@
+2012-03-01  Joe Thomas  <[email protected]>
+
+        :empty still applies to elements made non-empty via page dynamics.
+        https://bugs.webkit.org/show_bug.cgi?id=79734
+
+        Check for :empty style change should be made even if the RenderStyle for the element is NULL
+        as changes to the element's children can trigger a change in :empty state of the parent element.
+
+        Reviewed by Antti Koivisto.
+
+        * fast/selectors/empty-element-made-non-empty-expected.txt: Added.
+        * fast/selectors/empty-element-made-non-empty.html: Added.
+
 2012-03-01  Kangil Han  <[email protected]>
 
         [DRT] Remove all PlainTextController usages in existing tests by adding internal API

Added: trunk/LayoutTests/fast/selectors/empty-element-made-non-empty-expected.txt (0 => 109417)


--- trunk/LayoutTests/fast/selectors/empty-element-made-non-empty-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/selectors/empty-element-made-non-empty-expected.txt	2012-03-01 21:53:23 UTC (rev 109417)
@@ -0,0 +1 @@
+TEST PASSED

Added: trunk/LayoutTests/fast/selectors/empty-element-made-non-empty.html (0 => 109417)


--- trunk/LayoutTests/fast/selectors/empty-element-made-non-empty.html	                        (rev 0)
+++ trunk/LayoutTests/fast/selectors/empty-element-made-non-empty.html	2012-03-01 21:53:23 UTC (rev 109417)
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<head>
+<style>
+    p { background-color: green; width: 100px; height: 100px; }
+    p:empty { display: none; }
+</style>
+<script>
+if (window.layoutTestController)
+    layoutTestController.dumpAsText();
+window._onload_ = function() {
+    document.getElementById('id').appendChild(document.createTextNode('TEST PASSED'));
+};
+</script>
+</head>
+<body>
+<p id="id"></p>
+</body>

Modified: trunk/Source/WebCore/ChangeLog (109416 => 109417)


--- trunk/Source/WebCore/ChangeLog	2012-03-01 21:52:01 UTC (rev 109416)
+++ trunk/Source/WebCore/ChangeLog	2012-03-01 21:53:23 UTC (rev 109417)
@@ -1,3 +1,18 @@
+2012-03-01  Joe Thomas  <[email protected]>
+
+        :empty still applies to elements made non-empty via page dynamics.
+        https://bugs.webkit.org/show_bug.cgi?id=79734
+
+        Check for :empty style change should be made even if the RenderStyle for the element is NULL
+        as changes to the element's children can trigger a change in :empty state of the parent element.
+
+        Reviewed by Antti Koivisto.
+
+        Test: fast/selectors/empty-element-made-non-empty.html
+
+        * dom/Element.cpp:
+        (WebCore::checkForSiblingStyleChanges):
+
 2012-02-29  Nat Duca  <[email protected]>
 
         [chromium] Move context lost control code from CCSingleThreadProxy to CCLayerTreeHost

Modified: trunk/Source/WebCore/dom/Element.cpp (109416 => 109417)


--- trunk/Source/WebCore/dom/Element.cpp	2012-03-01 21:52:01 UTC (rev 109416)
+++ trunk/Source/WebCore/dom/Element.cpp	2012-03-01 21:53:23 UTC (rev 109417)
@@ -1215,6 +1215,9 @@
 static void checkForSiblingStyleChanges(Element* e, RenderStyle* style, bool finishedParsingCallback,
                                         Node* beforeChange, Node* afterChange, int childCountDelta)
 {
+    // :empty selector.
+    checkForEmptyStyleChange(e, style);
+    
     if (!style || (e->needsStyleRecalc() && style->childrenAffectedByPositionalRules()))
         return;
 
@@ -1286,9 +1289,6 @@
     if ((style->childrenAffectedByForwardPositionalRules() && afterChange) ||
         (style->childrenAffectedByBackwardPositionalRules() && beforeChange))
         e->setNeedsStyleRecalc();
-    
-    // :empty selector.
-    checkForEmptyStyleChange(e, style);
 }
 
 void Element::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to