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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../js/resources/js-test-pre.js"></script>
5 <script>
6 if (window.testRunner)
7 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.
8 </script>
9 </head>
10 <body>
11 <!-- crbug.com/246300 -->
12 <!-- #host shadow root -->
13 <template id="t">
14 <style>
15 #host {
16 height: 50px;
17 width: 50px;
18 background: lightgray;
19 }
20 </style>
21 <div id="container"></div>
22 </template>
23
24 <!-- #container shadow root -->
25 <template id="t2">
26 <style>
27 div {
28 background: black;
29 height: 40px;
30 width: 40px;
31 }
32 #green {
33 background: green;
34 }
35 </style>
36 <div id="green"></div>
37 </template>
38
39 <div id="host"></div>
40 </body>
41 <script>
42 description('Test for Issue: 246300: Styles in nested shadows are not recalculat ed correctly on insertion.');
43
44 var backgroundColor;
45
46 function shouldHaveBackgroundColor(element, bg)
47 {
48 backgroundColor = window.getComputedStyle(element).backgroundColor;
49 shouldBeEqualToString("backgroundColor", bg);
50 }
51
52 var sr = host.webkitCreateShadowRoot();
53 sr.appendChild(t.content.cloneNode(true));
54 var container = sr.querySelector('#container');
55 var sr2 = container.webkitCreateShadowRoot();
56 sr2.appendChild(t2.content.cloneNode(true));
57
58 setTimeout(function() {
59 container.remove();
60 sr.appendChild(container);
61
62 shouldHaveBackgroundColor(sr2.getElementById('green'), 'rgb(0, 128, 0)');
63 testRunner.notifyDone();
Hajime Morrita 2013/06/05 07:21:06 Call fnishJSTest().
tasak 2013/06/05 08:30:52 Done.
64 }, 0);
65 </script>
66 </html>
OLDNEW
« 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