Title: [132954] branches/safari-536.28-branch

Diff

Modified: branches/safari-536.28-branch/LayoutTests/ChangeLog (132953 => 132954)


--- branches/safari-536.28-branch/LayoutTests/ChangeLog	2012-10-30 23:11:59 UTC (rev 132953)
+++ branches/safari-536.28-branch/LayoutTests/ChangeLog	2012-10-30 23:17:34 UTC (rev 132954)
@@ -1,3 +1,17 @@
+2012-10-30  Lucas Forschler  <[email protected]>
+
+        Merge r116255.
+
+    2012-05-06  MORITA Hajime  <[email protected]>
+
+            [Shadow DOM] Node distribution should be refreshed before style recalc.
+            https://bugs.webkit.org/show_bug.cgi?id=85259
+
+            Reviewed by Dimitri Glazkov.
+
+            * fast/dom/shadow/shadow-dynamic-style-change-via-mutation-and-selector-expected.txt: Added.
+            * fast/dom/shadow/shadow-dynamic-style-change-via-mutation-and-selector.html: Added.
+
 2012-08-31  Timothy Hatcher  <[email protected]>
 
         Merge r127047.
@@ -10368,3 +10382,4 @@
 .
 .
 .
+.

Copied: branches/safari-536.28-branch/LayoutTests/fast/dom/shadow/shadow-dynamic-style-change-via-mutation-and-selector-expected.txt (from rev 116255, trunk/LayoutTests/fast/dom/shadow/shadow-dynamic-style-change-via-mutation-and-selector-expected.txt) (0 => 132954)


--- branches/safari-536.28-branch/LayoutTests/fast/dom/shadow/shadow-dynamic-style-change-via-mutation-and-selector-expected.txt	                        (rev 0)
+++ branches/safari-536.28-branch/LayoutTests/fast/dom/shadow/shadow-dynamic-style-change-via-mutation-and-selector-expected.txt	2012-10-30 23:17:34 UTC (rev 132954)
@@ -0,0 +1 @@
+

Copied: branches/safari-536.28-branch/LayoutTests/fast/dom/shadow/shadow-dynamic-style-change-via-mutation-and-selector.html (from rev 116255, trunk/LayoutTests/fast/dom/shadow/shadow-dynamic-style-change-via-mutation-and-selector.html) (0 => 132954)


--- branches/safari-536.28-branch/LayoutTests/fast/dom/shadow/shadow-dynamic-style-change-via-mutation-and-selector.html	                        (rev 0)
+++ branches/safari-536.28-branch/LayoutTests/fast/dom/shadow/shadow-dynamic-style-change-via-mutation-and-selector.html	2012-10-30 23:17:34 UTC (rev 132954)
@@ -0,0 +1,32 @@
+<style>
+.baz:nth-last-child(odd) { display: block;  }
+</style>
+<script>
+function test() {
+    var foo = document.createElement('div');
+    document.documentElement.appendChild(foo);
+
+    var bar = document.createElement('div');
+    var barShadow = new WebKitShadowRoot(bar);
+    bar.setAttribute('class', 'bar');
+    document.documentElement.appendChild(bar);
+
+    baz = document.createElement('span');
+    baz.setAttribute('class', 'baz');
+    bar.appendChild(baz);
+
+    var qux = document.createElement('div');
+    bar.appendChild(qux);
+
+    var ip = document.createElement('shadow');
+    barShadow.appendChild(ip);
+
+    document.documentElement.offsetLeft;
+    foo.appendChild(qux);
+    layoutTestController.notifyDone();
+}
+
+layoutTestController.waitUntilDone();
+layoutTestController.dumpAsText();
+window._onload_ = test;
+</script>

Modified: branches/safari-536.28-branch/Source/WebCore/ChangeLog (132953 => 132954)


--- branches/safari-536.28-branch/Source/WebCore/ChangeLog	2012-10-30 23:11:59 UTC (rev 132953)
+++ branches/safari-536.28-branch/Source/WebCore/ChangeLog	2012-10-30 23:17:34 UTC (rev 132954)
@@ -1,3 +1,28 @@
+2012-10-30  Lucas Forschler  <[email protected]>
+
+        Merge r116255.
+
+    2012-05-06  MORITA Hajime  <[email protected]>
+
+            [Shadow DOM] Node distribution should be refreshed before style recalc.
+            https://bugs.webkit.org/show_bug.cgi?id=85259
+
+            Reviewed by Dimitri Glazkov.
+
+            Element::recalcStyle() calls child element's recalcStyle()
+            recursively, following ShadowTree::recalcShadowTreeStyle(). But
+            recalcShadowTreeStyle() should be called before such recursion if
+            necessary.
+
+            This is because style calculation and following renderer attachment
+            of each child element depends on up-to-date node distribution result
+            which is computed during the recalcShadowTreeStyle().
+
+            Test: fast/dom/shadow/shadow-dynamic-style-change-via-mutation-and-selector.html
+
+            * dom/Element.cpp: Moved recalcShadowTreeStyle() before child traversals.
+            (WebCore::Element::recalcStyle):
+
 2012-09-18  Lucas Forschler  <[email protected]>
 
     Merge r128845.
@@ -205342,3 +205367,4 @@
 .
 .
 .
+.

Modified: branches/safari-536.28-branch/Source/WebCore/dom/Element.cpp (132953 => 132954)


--- branches/safari-536.28-branch/Source/WebCore/dom/Element.cpp	2012-10-30 23:11:59 UTC (rev 132953)
+++ branches/safari-536.28-branch/Source/WebCore/dom/Element.cpp	2012-10-30 23:17:34 UTC (rev 132954)
@@ -1152,6 +1152,16 @@
         }
     }
     StyleResolverParentPusher parentPusher(this);
+
+    // FIXME: This does not care about sibling combinators. Will be necessary in XBL2 world.
+    if (hasShadowRoot()) {
+        ShadowTree* tree = shadowTree();
+        if (change >= Inherit || tree->childNeedsStyleRecalc() || tree->needsStyleRecalc()) {
+            parentPusher.push();
+            tree->recalcShadowTreeStyle(change);
+        }
+    }
+
     // FIXME: This check is good enough for :hover + foo, but it is not good enough for :hover + foo + bar.
     // For now we will just worry about the common case, since it's a lot trickier to get the second case right
     // without doing way too much re-resolution.
@@ -1175,14 +1185,6 @@
         forceCheckOfNextElementSibling = childRulesChanged && hasDirectAdjacentRules;
         forceCheckOfAnyElementSibling = forceCheckOfAnyElementSibling || (childRulesChanged && hasIndirectAdjacentRules);
     }
-    // FIXME: This does not care about sibling combinators. Will be necessary in XBL2 world.
-    if (hasShadowRoot()) {
-        ShadowTree* tree = shadowTree();
-        if (change >= Inherit || tree->childNeedsStyleRecalc() || tree->needsStyleRecalc()) {
-            parentPusher.push();
-            tree->recalcShadowTreeStyle(change);
-        }
-    }
 
     clearNeedsStyleRecalc();
     clearChildNeedsStyleRecalc();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to