Commit beecbf14 authored by shinyak@chromium.org's avatar shinyak@chromium.org

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.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131615 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 3ee6d9fc
2012-10-17 Shinya Kawanaka <shinyak@chromium.org>
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 <danakj@chromium.org> 2012-10-17 Dana Jansens <danakj@chromium.org>
Layout Test http/tests/workers/text-encoding.html is flaky crashing on debug bots Layout Test http/tests/workers/text-encoding.html is flaky crashing on debug bots
......
<!DOCTYPE html>
<html>
<div id="host1"><div><div><div>dynamically added div</div></div></div></div>
</html>
<!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>
2012-10-17 Shinya Kawanaka <shinyak@chromium.org>
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 <yurys@chromium.org> 2012-10-17 Yury Semikhatsky <yurys@chromium.org>
Web Inspector: no "delete watch expression" context menu item when clicking on the expression value Web Inspector: no "delete watch expression" context menu item when clicking on the expression value
......
...@@ -89,6 +89,9 @@ void ContentDistributor::distribute(Element* host) ...@@ -89,6 +89,9 @@ void ContentDistributor::distribute(Element* host)
distributeNodeChildrenTo(point, older); distributeNodeChildrenTo(point, older);
older->setAssignedTo(point); older->setAssignedTo(point);
} }
if (ElementShadow* shadow = node->parentNode()->isElementNode() ? toElement(node->parentNode())->shadow() : 0)
shadow->invalidateDistribution();
} }
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment