summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/dom/shadow/move-style-scoped-to-another-shadowroot-crash.html
blob: b45c0e96f99a182d4c7d3f572515041cd818b960 (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
<!DOCTYPE html>
<html>
<head>
<script src="../../../resources/js-test.js"></script>
<script src="resources/shadow-dom.js"></script>
<script>
description("Test for crbug.com/321495: if no crash occurs, this test passes. Otherwise, fails.");

var youngerShadowRoot, olderShadowRoot, style;

function runTest() {
    document.getElementById('sandbox').appendChild(
        createDOM('div', {'id': 'host'},
            createShadowRoot(),
            createShadowRoot(
                createDOM('div', {'id': 'child'},
                    createDOM('style', {'id': 'style', 'scoped': 'scoped'},
                        document.createTextNode('.c3 { display: inherit; transform: rotate3d(0, 1, 1, 45deg); }'))))));

    olderShadowRoot = getNodeInComposedTree("host/");
    youngerShadowRoot = getNodeInComposedTree("host//");
    style = youngerShadowRoot.getElementById('style');

    olderShadowRoot.appendChild(youngerShadowRoot.getElementById('child'));
    setTimeout('youngerShadowRoot.appendChild(style);', 0);
}
</script>
</head>
<body onload="runTest()">
  <div class="c3"></div>
  <div id="sandbox"></div>
  <pre id="console"></pre>
</body>
</html>