Chromium Code Reviews| Index: LayoutTests/fast/html/imports/import-style-tree-order-dedup.html |
| diff --git a/LayoutTests/fast/html/imports/import-style-tree-order-dedup.html b/LayoutTests/fast/html/imports/import-style-tree-order-dedup.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..02fdfedf1a24298dfeeca66a13f63565b50e53fe |
| --- /dev/null |
| +++ b/LayoutTests/fast/html/imports/import-style-tree-order-dedup.html |
| @@ -0,0 +1,60 @@ |
| +<!DOCTYPE html> |
| +<html> |
| +<body> |
|
esprehn
2014/03/03 21:01:45
I'd omit the <html> and <body> elements.
|
| +<script src="../../../resources/js-test.js"></script> |
| + |
| +<link id="owningLink" rel="import" href="resources/style-target-blue.html"> |
| + |
| +<style id="styleRed"> |
| +.target1, .target2, .target3 { |
| + color: red; |
| +} |
| +</style> |
| + |
| +<link id="sharedLink" rel="import" href="resources/style-target-blue.html"> |
| + |
| +<style id="styleGreen"> |
| +.target1 { |
| + color: green; |
| +} |
| +</style> |
| + |
| +<div id="placeholder"></div> |
| + |
| +<span id="target1" class="target1">Hello!</span> |
| +<span id="target2" class="target2">Hello!</span> |
| +<span id="target3" class="target3">Hello!</span> |
| + |
| +<script> |
| +function colorOf(element) |
| +{ |
| + return window.getComputedStyle(element).color; |
| +} |
| + |
| +// owninigLink, styleRed, styleGreen |
| + |
| +shouldBe("colorOf(target1)", "'rgb(0, 128, 0)'"); |
| +shouldBe("colorOf(target2)", "'rgb(255, 0, 0)'"); |
| +shouldBe("colorOf(target3)", "'rgb(255, 0, 0)'"); |
| + |
| +var owningLinkElement = document.getElementById("owningLink"); |
| +document.body.removeChild(owningLinkElement); |
| + |
| +// styleRed, sharedLink, styleGreen |
| + |
| +shouldBe("colorOf(target1)", "'rgb(0, 128, 0)'"); |
| +shouldBe("colorOf(target2)", "'rgb(0, 0, 255)'"); |
| +shouldBe("colorOf(target3)", "'rgb(255, 0, 0)'"); |
| + |
| +document.body.insertBefore(owningLinkElement, placeholder); |
| + |
| +// styleRed, sharedLink, styleGreen - owningLinkElement shouldn't affect others |
| + |
| +shouldBe("colorOf(target1)", "'rgb(0, 128, 0)'"); |
| +shouldBe("colorOf(target2)", "'rgb(0, 0, 255)'"); |
| +shouldBe("colorOf(target3)", "'rgb(255, 0, 0)'"); |
| + |
| +</script> |
| + |
| +</body> |
| +</html> |