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

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
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..3e46026887e47aaafb92bfc0fed22793e55b1942
--- /dev/null
+++ b/LayoutTests/fast/dom/shadow/remove-and-insert-style.html
@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../js/resources/js-test-pre.js"></script>
+<script>
+if (window.testRunner)
+ testRunner.waitUntilDone();
Hajime Morrita 2013/06/05 07:21:06 You can just set window.jsTestIsAsync = true. No t
tasak 2013/06/05 08:30:52 Done.
+</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));
+
+setTimeout(function() {
+ container.remove();
+ sr.appendChild(container);
+
+ shouldHaveBackgroundColor(sr2.getElementById('green'), 'rgb(0, 128, 0)');
+ testRunner.notifyDone();
Hajime Morrita 2013/06/05 07:21:06 Call fnishJSTest().
tasak 2013/06/05 08:30:52 Done.
+}, 0);
+</script>
+</html>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/shadow/remove-and-insert-style-expected.txt » ('j') | Source/core/html/HTMLStyleElement.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698