Title: [131615] trunk
- Revision
- 131615
- Author
- [email protected]
- Date
- 2012-10-17 10:07:39 -0700 (Wed, 17 Oct 2012)
Log Message
Dynamically added elements do not get re-projected.
https://bugs.webkit.org/show_bug.cgi?id=99227
Reviewed by Dimitri Glazkov.
Source/WebCore:
When distribution happens, we have to invalidate its host shadow's distribution, since the children of the host
is changed.
Test: fast/dom/shadow/content-reprojection-dynamic.html
* html/shadow/ContentDistributor.cpp:
(WebCore::ContentDistributor::distribute):
LayoutTests:
* fast/dom/shadow/content-reprojection-dynamic-expected.html: Added.
* fast/dom/shadow/content-reprojection-dynamic.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (131614 => 131615)
--- trunk/LayoutTests/ChangeLog 2012-10-17 16:55:08 UTC (rev 131614)
+++ trunk/LayoutTests/ChangeLog 2012-10-17 17:07:39 UTC (rev 131615)
@@ -1,3 +1,13 @@
+2012-10-17 Shinya Kawanaka <[email protected]>
+
+ Dynamically added elements do not get re-projected.
+ https://bugs.webkit.org/show_bug.cgi?id=99227
+
+ Reviewed by Dimitri Glazkov.
+
+ * fast/dom/shadow/content-reprojection-dynamic-expected.html: Added.
+ * fast/dom/shadow/content-reprojection-dynamic.html: Added.
+
2012-10-17 Dana Jansens <[email protected]>
Layout Test http/tests/workers/text-encoding.html is flaky crashing on debug bots
Added: trunk/LayoutTests/fast/dom/shadow/content-reprojection-dynamic-expected.html (0 => 131615)
--- trunk/LayoutTests/fast/dom/shadow/content-reprojection-dynamic-expected.html (rev 0)
+++ trunk/LayoutTests/fast/dom/shadow/content-reprojection-dynamic-expected.html 2012-10-17 17:07:39 UTC (rev 131615)
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+
+<html>
+
+<div id="host1"><div><div><div>dynamically added div</div></div></div></div>
+
+</html>
Added: trunk/LayoutTests/fast/dom/shadow/content-reprojection-dynamic.html (0 => 131615)
--- trunk/LayoutTests/fast/dom/shadow/content-reprojection-dynamic.html (rev 0)
+++ trunk/LayoutTests/fast/dom/shadow/content-reprojection-dynamic.html 2012-10-17 17:07:39 UTC (rev 131615)
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+
+<html>
+
+<div id="host1"></div>
+
+<script>
+if (window.testRunner)
+ testRunner.waitUntilDone();
+
+var shadowRoot1 = new WebKitShadowRoot(host1);
+shadowRoot1.innerHTML = '<div><div id="host2"><content></content></div></div>';
+
+var host2 = shadowRoot1.getElementById('host2');
+var shadowRoot2 = new WebKitShadowRoot(host2);
+shadowRoot2.innerHTML = '<div id="host3"><content></content></div>';
+
+var host3 = shadowRoot2.getElementById('host3');
+var shadowRoot3 = new WebKitShadowRoot(host3);
+shadowRoot3.innerHTML = '<div><content></content></div>';
+
+setTimeout(function() {
+ var div = document.createElement('div');
+ div.innerHTML = 'dynamically added div';
+ host1.appendChild(div);
+
+ if (window.testRunner)
+ testRunner.notifyDone();
+}, 0);
+</script>
+
+</html>
Modified: trunk/Source/WebCore/ChangeLog (131614 => 131615)
--- trunk/Source/WebCore/ChangeLog 2012-10-17 16:55:08 UTC (rev 131614)
+++ trunk/Source/WebCore/ChangeLog 2012-10-17 17:07:39 UTC (rev 131615)
@@ -1,3 +1,18 @@
+2012-10-17 Shinya Kawanaka <[email protected]>
+
+ Dynamically added elements do not get re-projected.
+ https://bugs.webkit.org/show_bug.cgi?id=99227
+
+ Reviewed by Dimitri Glazkov.
+
+ When distribution happens, we have to invalidate its host shadow's distribution, since the children of the host
+ is changed.
+
+ Test: fast/dom/shadow/content-reprojection-dynamic.html
+
+ * html/shadow/ContentDistributor.cpp:
+ (WebCore::ContentDistributor::distribute):
+
2012-10-17 Yury Semikhatsky <[email protected]>
Web Inspector: no "delete watch _expression_" context menu item when clicking on the _expression_ value
Modified: trunk/Source/WebCore/html/shadow/ContentDistributor.cpp (131614 => 131615)
--- trunk/Source/WebCore/html/shadow/ContentDistributor.cpp 2012-10-17 16:55:08 UTC (rev 131614)
+++ trunk/Source/WebCore/html/shadow/ContentDistributor.cpp 2012-10-17 17:07:39 UTC (rev 131615)
@@ -89,6 +89,9 @@
distributeNodeChildrenTo(point, older);
older->setAssignedTo(point);
}
+
+ if (ElementShadow* shadow = node->parentNode()->isElementNode() ? toElement(node->parentNode())->shadow() : 0)
+ shadow->invalidateDistribution();
}
}
}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes