Index: LayoutTests/fast/dom/shadow/getComputedStyle-with-distribution.html |
diff --git a/LayoutTests/fast/dom/shadow/getComputedStyle-with-distribution.html b/LayoutTests/fast/dom/shadow/getComputedStyle-with-distribution.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..af37ddc4cf6eb0fc270aaf2d0bf390f414770e5b |
--- /dev/null |
+++ b/LayoutTests/fast/dom/shadow/getComputedStyle-with-distribution.html |
@@ -0,0 +1,28 @@ |
+<!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(getNodeInTreeOfTrees("child/bar")).color', '"rgb(0, 128, 0)"'); |
+ |
+var content = getNodeInTreeOfTrees('host/content'); |
+content.setAttribute('select', '.foobar'); |
+shouldBe('window.getComputedStyle(getNodeInTreeOfTrees("child/bar")).color', '"rgb(0, 0, 0)"'); |
+</script> |