summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/dom/shadow/style-of-distributed-node.html
blob: 3727019641a4f39ada6b91474345e9cc50fa54a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<!DOCTYPE html>
<html>
<head>
<script src="../../../resources/js-test.js"></script>
<script>
function getColorProperty(id) {
    return window.getComputedStyle(document.getElementById(id)).color;
}

function log(message) {
    var console = document.getElementById('console');
    console.innerHTML += message + '\n';
}
</script>
</head>
<body>
<pre id="console"></div>
<div id="test">
    <div id="host" style="color: red">
        <div id="child-a"></div>
        <div id="child-b"></div>
    </div>
</div>
<script>
description("Tests to ensure that styles of distributed nodes are different if their parent styles are different.");

var sr = document.getElementById("host").createShadowRoot();
sr.innerHTML = '<content select="#child-a"></content><div style="color: blue"><content select="#child-b"></content></div>';

shouldBe('getColorProperty("child-a")', '"rgb(255, 0, 0)"');
shouldBe('getColorProperty("child-b")', '"rgb(0, 0, 255)"');

document.getElementById("test").innerHTML = '';
</script>
</body>
</html>