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

Unified Diff: LayoutTests/animations/display-none-cancel-computedstyle.html

Issue 1156213003: Cancel animations before calling ContainerNode::attach in Element::attach. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add a test. Created 5 years, 7 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/animations/display-none-cancel-computedstyle-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/animations/display-none-cancel-computedstyle.html
diff --git a/LayoutTests/animations/display-none-cancel-computedstyle.html b/LayoutTests/animations/display-none-cancel-computedstyle.html
new file mode 100644
index 0000000000000000000000000000000000000000..23467d3de123abd9b1a85c2d7e158140aef7e0ee
--- /dev/null
+++ b/LayoutTests/animations/display-none-cancel-computedstyle.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<script src="../resources/js-test.js"></script>
+<style>
+#child {
+ width: 50px;
+ height: 50px;
+ background: red;
+ border: 1px solid red;
+}
+
+.animate {
+ animation: flash 0.2s infinite;
+}
+
+@keyframes flash {
+ 0% {
+ opacity: 1;
+ }
+ 100% {
+ opacity: 0;
+ }
+}
+</style>
+<div id="container">
+ <div id="child"></div>
+</div>
+<script>
+description("Canceling an animation should not leave dirty bits on display none elements.");
+
+window.jsTestIsAsync = true;
+if (window.testRunner) {
+ testRunner.waitUntilDone();
+ testRunner.dumpAsText();
+}
+
+var child = document.getElementById("child");
+var container = document.getElementById("container");
+
+child.addEventListener("animationstart", function(event) {
+ container.style.display = "none";
+ child.style.borderWidth = "10px";
+ shouldBeEqualToString("getComputedStyle(child).borderWidth", "10px");
+ child.style.borderWidth = "5px";
+ shouldBeEqualToString("getComputedStyle(child).borderWidth", "5px");
+ finishJSTest();
+});
+
+child.classList.add("animate");
+</script>
+
« no previous file with comments | « no previous file | LayoutTests/animations/display-none-cancel-computedstyle-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698