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

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
« no previous file with comments | « no previous file | LayoutTests/fast/dom/shadow/remove-and-insert-style-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../js/resources/js-test-pre.js"></script>
5 </head>
6 <body>
7 <!-- crbug.com/246300 -->
8 <!-- #host shadow root -->
9 <template id="t">
10 <style>
11 #host {
12 height: 50px;
13 width: 50px;
14 background: lightgray;
15 }
16 </style>
17 <div id="container"></div>
18 </template>
19
20 <!-- #container shadow root -->
21 <template id="t2">
22 <style>
23 div {
24 background: black;
25 height: 40px;
26 width: 40px;
27 }
28 #green {
29 background: green;
30 }
31 </style>
32 <div id="green"></div>
33 </template>
34
35 <div id="host"></div>
36 </body>
37 <script>
38 description('Test for Issue: 246300: Styles in nested shadows are not recalculat ed correctly on insertion.');
39
40 var backgroundColor;
41
42 function shouldHaveBackgroundColor(element, bg)
43 {
44 backgroundColor = window.getComputedStyle(element).backgroundColor;
45 shouldBeEqualToString("backgroundColor", bg);
46 }
47
48 var sr = host.webkitCreateShadowRoot();
49 sr.appendChild(t.content.cloneNode(true));
50 var container = sr.querySelector('#container');
51 var sr2 = container.webkitCreateShadowRoot();
52 sr2.appendChild(t2.content.cloneNode(true));
53
54 jsTestIsAsync = true;
55 setTimeout(function() {
56 container.remove();
57 sr.appendChild(container);
58
59 shouldHaveBackgroundColor(sr2.getElementById('green'), 'rgb(0, 128, 0)');
60 finishJSTest();
61 }, 0);
62 </script>
63 <script src="../../js/resources/js-test-post.js"></script>
64 </html>
OLDNEW
« 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