Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Unified Diff: LayoutTests/fast/dom/shadow/remove-and-insert-style.html

Issue 16425002: Moved StyleElement::insertedIntoDocument into didNotifySubtreeInsertions. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/dom/shadow/remove-and-insert-style-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/shadow/remove-and-insert-style.html
diff --git a/LayoutTests/fast/dom/shadow/remove-and-insert-style.html b/LayoutTests/fast/dom/shadow/remove-and-insert-style.html
new file mode 100644
index 0000000000000000000000000000000000000000..34955b592ce3432a8e4464b382d35b65cb4bba81
--- /dev/null
+++ b/LayoutTests/fast/dom/shadow/remove-and-insert-style.html
@@ -0,0 +1,64 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+ <!-- crbug.com/246300 -->
+ <!-- #host shadow root -->
+ <template id="t">
+ <style>
+ #host {
+ height: 50px;
+ width: 50px;
+ background: lightgray;
+ }
+ </style>
+ <div id="container"></div>
+ </template>
+
+ <!-- #container shadow root -->
+ <template id="t2">
+ <style>
+ div {
+ background: black;
+ height: 40px;
+ width: 40px;
+ }
+ #green {
+ background: green;
+ }
+ </style>
+ <div id="green"></div>
+ </template>
+
+ <div id="host"></div>
+</body>
+<script>
+description('Test for Issue: 246300: Styles in nested shadows are not recalculated correctly on insertion.');
+
+var backgroundColor;
+
+function shouldHaveBackgroundColor(element, bg)
+{
+ backgroundColor = window.getComputedStyle(element).backgroundColor;
+ shouldBeEqualToString("backgroundColor", bg);
+}
+
+var sr = host.webkitCreateShadowRoot();
+sr.appendChild(t.content.cloneNode(true));
+var container = sr.querySelector('#container');
+var sr2 = container.webkitCreateShadowRoot();
+sr2.appendChild(t2.content.cloneNode(true));
+
+jsTestIsAsync = true;
+setTimeout(function() {
+ container.remove();
+ sr.appendChild(container);
+
+ shouldHaveBackgroundColor(sr2.getElementById('green'), 'rgb(0, 128, 0)');
+ finishJSTest();
+}, 0);
+</script>
+<script src="../../js/resources/js-test-post.js"></script>
+</html>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/shadow/remove-and-insert-style-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698