Title: [106336] trunk
Revision
106336
Author
[email protected]
Date
2012-01-30 22:36:02 -0800 (Mon, 30 Jan 2012)

Log Message

Attach light children after removing a shadow root.
https://bugs.webkit.org/show_bug.cgi?id=74267

Reviewed by Ryosuke Niwa.

Source/WebCore:

Tests: fast/dom/shadow/dynamically-created-shadow-root-expected.html
       fast/dom/shadow/dynamically-created-shadow-root.html:

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

LayoutTests:

* fast/dom/shadow/dynamically-created-shadow-root-expected.html:
* fast/dom/shadow/dynamically-created-shadow-root.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (106335 => 106336)


--- trunk/LayoutTests/ChangeLog	2012-01-31 06:23:20 UTC (rev 106335)
+++ trunk/LayoutTests/ChangeLog	2012-01-31 06:36:02 UTC (rev 106336)
@@ -1,3 +1,13 @@
+2011-01-30  Hayato Ito  <[email protected]>
+
+        Attach light children after removing a shadow root.
+        https://bugs.webkit.org/show_bug.cgi?id=74267
+
+        Reviewed by Ryosuke Niwa.
+
+        * fast/dom/shadow/dynamically-created-shadow-root-expected.html:
+        * fast/dom/shadow/dynamically-created-shadow-root.html:
+
 2012-01-30  Raymond Liu  <[email protected]>
 
         Fix ASSERT fail within AudioBus::processWithGainFrom()

Modified: trunk/LayoutTests/fast/dom/shadow/dynamically-created-shadow-root-expected.html (106335 => 106336)


--- trunk/LayoutTests/fast/dom/shadow/dynamically-created-shadow-root-expected.html	2012-01-31 06:23:20 UTC (rev 106335)
+++ trunk/LayoutTests/fast/dom/shadow/dynamically-created-shadow-root-expected.html	2012-01-31 06:36:02 UTC (rev 106336)
@@ -5,5 +5,6 @@
 Can only run within DRT.
 </div>
 <div>Shadow should be rendered.</div>
+<div>Light children should be rendered after a shadow root is removed.</div>
 </body>
 </html>

Modified: trunk/LayoutTests/fast/dom/shadow/dynamically-created-shadow-root.html (106335 => 106336)


--- trunk/LayoutTests/fast/dom/shadow/dynamically-created-shadow-root.html	2012-01-31 06:23:20 UTC (rev 106335)
+++ trunk/LayoutTests/fast/dom/shadow/dynamically-created-shadow-root.html	2012-01-31 06:36:02 UTC (rev 106336)
@@ -4,12 +4,18 @@
 This tests that dynamically created ShadowRoot should be rendered correctly.
 Can only run within DRT.
 </div>
-<div id="host">Light children should not be rendered.</div>
+<div id="host1">Light children should not be rendered.</div>
+<div id="host2">Light children should be rendered after a shadow root is removed.</div>
 <script>
 if (window.internals) {
-    var host = document.querySelector('#host');
-    var shadowRoot = window.internals.ensureShadowRoot(host);
+    var host1 = document.querySelector('#host1');
+    var shadowRoot = window.internals.ensureShadowRoot(host1);
     shadowRoot.appendChild(document.createTextNode('Shadow should be rendered.'));
+
+    var host2 = document.querySelector('#host2');
+    var shadowRoot = window.internals.ensureShadowRoot(host2);
+    shadowRoot.appendChild(document.createTextNode('Shadow should not be rendered.'));
+    window.internals.removeShadowRoot(host2);
 }
 </script>
 </body>

Modified: trunk/Source/WebCore/ChangeLog (106335 => 106336)


--- trunk/Source/WebCore/ChangeLog	2012-01-31 06:23:20 UTC (rev 106335)
+++ trunk/Source/WebCore/ChangeLog	2012-01-31 06:36:02 UTC (rev 106336)
@@ -1,3 +1,16 @@
+2011-01-30  Hayato Ito  <[email protected]>
+
+        Attach light children after removing a shadow root.
+        https://bugs.webkit.org/show_bug.cgi?id=74267
+
+        Reviewed by Ryosuke Niwa.
+
+        Tests: fast/dom/shadow/dynamically-created-shadow-root-expected.html
+               fast/dom/shadow/dynamically-created-shadow-root.html:
+
+        * dom/Element.cpp:
+        (WebCore::Element::removeShadowRoot):
+
 2012-01-30  Sheriff Bot  <[email protected]>
 
         Unreviewed, rolling out r106324.

Modified: trunk/Source/WebCore/dom/Element.cpp (106335 => 106336)


--- trunk/Source/WebCore/dom/Element.cpp	2012-01-31 06:23:20 UTC (rev 106335)
+++ trunk/Source/WebCore/dom/Element.cpp	2012-01-31 06:36:02 UTC (rev 106336)
@@ -1220,6 +1220,11 @@
             oldRoot->removedFromDocument();
         else
             oldRoot->removedFromTree(true);
+        if (attached()) {
+            for (Node* child = firstChild(); child; child = child->nextSibling())
+                if (!child->attached())
+                    child->lazyAttach();
+        }
     }
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to