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

Side by Side Diff: LayoutTests/fast/html/imports/import-style-tree-order-dedup.html

Issue 179873020: [import] The first <link rel=import> should win in the cascading order computation. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Landing Created 6 years, 9 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/html/imports/import-style-tree-order-dedup-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 <body>
3 <script src="../../../resources/js-test.js"></script>
4
5 <link id="owningLink" rel="import" href="resources/style-target-blue.html">
6
7 <style id="styleRed">
8 .target1, .target2, .target3 {
9 color: red;
10 }
11 </style>
12
13 <link id="sharedLink" rel="import" href="resources/style-target-blue.html">
14
15 <style id="styleGreen">
16 .target1 {
17 color: green;
18 }
19 </style>
20
21 <div id="placeholder"></div>
22
23 <span id="target1" class="target1">Hello!</span>
24 <span id="target2" class="target2">Hello!</span>
25 <span id="target3" class="target3">Hello!</span>
26
27 <script>
28 function colorOf(element)
29 {
30 return window.getComputedStyle(element).color;
31 }
32
33 // owninigLink, styleRed, styleGreen
34
35 shouldBe("colorOf(target1)", "'rgb(0, 128, 0)'");
36 shouldBe("colorOf(target2)", "'rgb(255, 0, 0)'");
37 shouldBe("colorOf(target3)", "'rgb(255, 0, 0)'");
38
39 var owningLinkElement = document.getElementById("owningLink");
40 document.body.removeChild(owningLinkElement);
41
42 // styleRed, sharedLink, styleGreen
43
44 shouldBe("colorOf(target1)", "'rgb(0, 128, 0)'");
45 shouldBe("colorOf(target2)", "'rgb(0, 0, 255)'");
46 shouldBe("colorOf(target3)", "'rgb(255, 0, 0)'");
47
48 document.body.insertBefore(owningLinkElement, placeholder);
49
50 // styleRed, sharedLink, styleGreen - owningLinkElement shouldn't affect others
51
52 shouldBe("colorOf(target1)", "'rgb(0, 128, 0)'");
53 shouldBe("colorOf(target2)", "'rgb(0, 0, 255)'");
54 shouldBe("colorOf(target3)", "'rgb(255, 0, 0)'");
55
56 </script>
57 </body>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/html/imports/import-style-tree-order-dedup-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698