Index: LayoutTests/fast/dom/shadow/shadowhost-keyframes.html |
diff --git a/LayoutTests/fast/dom/shadow/shadowhost-keyframes.html b/LayoutTests/fast/dom/shadow/shadowhost-keyframes.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b77cbd4a4e20c9ecae9af202ae7662fc6e41cdd5 |
--- /dev/null |
+++ b/LayoutTests/fast/dom/shadow/shadowhost-keyframes.html |
@@ -0,0 +1,43 @@ |
+<!doctype html> |
+<html> |
+<head> |
+<style> |
+@-webkit-keyframes anim { |
+ from { |
+ background-color: red; |
+ } |
+ to { |
+ background-color: green; |
+ } |
+} |
+</style> |
+<script src="../../../resources/js-test.js"></script> |
+</head> |
+<body> |
+ <div id="host"></div> |
+ <div id="result"></div> |
+<script> |
+if (window.testRunner) |
+ testRunner.waitUntilDone(); |
+ |
+function getColor(element) { |
+ return window.getComputedStyle(element).color; |
+} |
+ |
+description('Test if @keyframes works for shadow host when using :host. i.e. crbug.com/332577'); |
+ |
+var host = document.getElementById('host'); |
+var sr = host.createShadowRoot(); |
+sr.innerHTML = '<style>@-webkit-keyframes anim {' |
+ + 'from { color: red; } to { color: green; } }' |
+ + ':host { -webkit-animation: anim 0.5s both; color: red; }</style>' |
+ + 'I should become green'; |
+ |
+window.setTimeout(function() { |
+ shouldBe("getColor(document.getElementById('host'))", '"rgb(0, 128, 0)"'); |
+ if (window.testRunner) |
+ testRunner.notifyDone(); |
+}, 1000); |
+</script> |
+</body> |
+</html> |