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

Unified Diff: third_party/WebKit/LayoutTests/animations/add-keyframes-recalc.html

Issue 2105743002: Optimize style recalc when adding @keyframes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved logic out of AnimationTimeline. Created 4 years, 6 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 | third_party/WebKit/Source/core/animation/Animation.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/animations/add-keyframes-recalc.html
diff --git a/third_party/WebKit/LayoutTests/animations/add-keyframes-recalc.html b/third_party/WebKit/LayoutTests/animations/add-keyframes-recalc.html
new file mode 100644
index 0000000000000000000000000000000000000000..cd35208cc60a2935b3e9077bd903339c8a1ee1c3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/animations/add-keyframes-recalc.html
@@ -0,0 +1,62 @@
+<!DOCTYPE html>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<div id="anim"></div>
+<script>
+ test(() => assert_not_equals(window.internals, undefined, "No window.internals."), "Needs window.internals for testing");
+ anim.offsetTop;
+</script>
+<style>
+ @keyframes unused {
+ from { color: pink }
+ to { color: orange }
+ }
+</style>
+<script>
+ test(() =>
+ assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 2, "Incorrect element recalc count.")
+ , "Check that adding @keyframes does not cause a style recalc of the anim element when no animations are running.");
+</script>
+<style>
+ #anim {
+ color: red;
+ animation-name: later;
+ animation-duration: 100s;
+ animation-timing-function: step-end;
+ }
+</style>
+<script>
+ test(() =>
+ assert_equals(getComputedStyle(anim).color, "rgb(255, 0, 0)", "Color of #anim is not red.")
+ , "Check initial color of #anim.");
+
+ anim.offsetTop;
+</script>
+<style>
+ @keyframes later {
+ from { color: green }
+ to { color: red }
+ }
alancutter (OOO until 2018) 2016/06/29 12:41:53 We should test that adding a second "@keyframes la
rune 2016/06/29 21:09:46 Done.
+</style>
+<script>
+ test(() =>
+ assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 13, "Incorrect full document recalc count")
+ , "Check that adding @keyframes after keyframe resolution failed, recalculates whole document");
+
+ test(() =>
+ assert_equals(getComputedStyle(anim).color, "rgb(0, 128, 0)", "Color of #anim during animation is not green.")
+ , "Check that @keyframes rule applies.");
+
+ anim.offsetTop;
+</script>
+<style>
+ @keyframes unused2 {
+ from { color: pink }
+ to { color: orange }
+ }
+</style>
+<script>
+ test(() =>
+ assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 3, "Incorrect recalc count.")
alancutter (OOO until 2018) 2016/06/29 12:41:53 I don't agree with using failure messages for the
rune 2016/06/29 21:09:46 Done.
+ , "Check that adding @keyframes causes a style recalc of the anim element when an animation is running.");
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/animation/Animation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698