Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(393)

Unified Diff: LayoutTests/fast/dom/shadow/getComputedStyle-with-distribution.html

Issue 240293007: Added layout test for getComputedStyle with distribution. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/dom/shadow/getComputedStyle-with-distribution-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/shadow/getComputedStyle-with-distribution-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698