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

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: Updated to ToT 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 <html>
3 <body>
esprehn 2014/03/03 21:01:45 I'd omit the <html> and <body> elements.
4 <script src="../../../resources/js-test.js"></script>
5
6 <link id="owningLink" rel="import" href="resources/style-target-blue.html">
7
8 <style id="styleRed">
9 .target1, .target2, .target3 {
10 color: red;
11 }
12 </style>
13
14 <link id="sharedLink" rel="import" href="resources/style-target-blue.html">
15
16 <style id="styleGreen">
17 .target1 {
18 color: green;
19 }
20 </style>
21
22 <div id="placeholder"></div>
23
24 <span id="target1" class="target1">Hello!</span>
25 <span id="target2" class="target2">Hello!</span>
26 <span id="target3" class="target3">Hello!</span>
27
28 <script>
29 function colorOf(element)
30 {
31 return window.getComputedStyle(element).color;
32 }
33
34 // owninigLink, styleRed, styleGreen
35
36 shouldBe("colorOf(target1)", "'rgb(0, 128, 0)'");
37 shouldBe("colorOf(target2)", "'rgb(255, 0, 0)'");
38 shouldBe("colorOf(target3)", "'rgb(255, 0, 0)'");
39
40 var owningLinkElement = document.getElementById("owningLink");
41 document.body.removeChild(owningLinkElement);
42
43 // styleRed, sharedLink, styleGreen
44
45 shouldBe("colorOf(target1)", "'rgb(0, 128, 0)'");
46 shouldBe("colorOf(target2)", "'rgb(0, 0, 255)'");
47 shouldBe("colorOf(target3)", "'rgb(255, 0, 0)'");
48
49 document.body.insertBefore(owningLinkElement, placeholder);
50
51 // styleRed, sharedLink, styleGreen - owningLinkElement shouldn't affect others
52
53 shouldBe("colorOf(target1)", "'rgb(0, 128, 0)'");
54 shouldBe("colorOf(target2)", "'rgb(0, 0, 255)'");
55 shouldBe("colorOf(target3)", "'rgb(255, 0, 0)'");
56
57 </script>
58
59 </body>
60 </html>
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