summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/dom/shadow/base-in-shadow-tree.html
blob: 03d5a67799e09a29cc0e88109880cd24572170ff (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
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div id="container"><a id="anchor-in-host-children" href="/">tehepero</a></div>
<div><a id="anchor-outside-of-shadow" href="/">tehepero</a></div>

<script src="../../js/resources/js-test-pre.js"></script>
<script>
var container = document.getElementById('container');

var shadowRoot = container.createShadowRoot();

var base = document.createElement('base');
base.setAttribute('href', 'http://www.example.com/');
var anchorInShadow = document.createElement('a');
anchorInShadow.setAttribute('href', '/');

shadowRoot.appendChild(base);
shadowRoot.appendChild(anchorInShadow);

var anchorInHostChildren = document.getElementById('anchor-in-host-children');
var anchorOutsideOfShadow = document.getElementById('anchor-outside-of-shadow');

shouldBe('anchorInShadow.href.indexOf("http://www.example.com")', '-1');
shouldBe('anchorInHostChildren.href.indexOf("http://www.example.com")', '-1');
shouldBe('anchorOutsideOfShadow.href.indexOf("http://www.example.com")', '-1');
</script>
<script src="../../js/resources/js-test-post.js"></script>
</body>
</html>