blob: f3b7571950be5a412b78ed736ad022e9167ea719 [file] [log] [blame]
<!DOCTYPE html>
<head>
<script src="resources/shadow-dom.js"></script>
<script src="../../../resources/js-test.js"></script>
</head>
<body>
</body>
<script>
description('crbug.com/337618: computedStyle should be cleared when distribution is updated');
document.body.appendChild(
createDOM('div', {'id': 'host'},
createShadowRoot(
createDOM('div', {'class': 'foo'},
createDOM('content', {'id': 'content', 'select': '*'}))),
createDOM('div', {'id': 'child'},
createShadowRoot(
createDOM('style', {},
document.createTextNode(":host-context(.foo) div { color: green; }")),
createDOM('div', {'id': 'bar'},
document.createTextNode("bar"))))));
shouldBe('window.getComputedStyle(getNodeInComposedTree("child/bar")).color', '"rgb(0, 128, 0)"');
var content = getNodeInComposedTree('host/content');
content.setAttribute('select', '.foobar');
shouldBe('window.getComputedStyle(getNodeInComposedTree("child/bar")).color', '"rgb(0, 0, 0)"');
</script>