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

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

Issue 2361733004: Adding @keyframes rules only affects TreeScope plus host. (Closed)
Patch Set: Moved scope check to CSSAnimations Created 4 years, 3 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-in-shadow-recalc.html
diff --git a/third_party/WebKit/LayoutTests/animations/add-keyframes-in-shadow-recalc.html b/third_party/WebKit/LayoutTests/animations/add-keyframes-in-shadow-recalc.html
new file mode 100644
index 0000000000000000000000000000000000000000..ef481a3d5a0a7ca0426abc059fdda08c33120d7a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/animations/add-keyframes-in-shadow-recalc.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<div id="host"></div>
+<div></div>
+<div></div>
+<div></div>
+<div></div>
+<script>
+ test(() => assert_not_equals(window.internals, undefined, "Needs window.internals for testing."), "Check that window.internals is defined");
+
+ var root = host.attachShadow({mode:"open"});
+ root.innerHTML = "<div></div><div></div><div></div>";
+ host.offsetTop;
+
+ test(() => {
+ var sheet = document.createElement("style");
+ sheet.appendChild(document.createTextNode(`
+ @keyframes unused {
+ from { color: pink }
+ to { color: orange }
+ }`));
+ root.appendChild(sheet);
+ // TODO(rune@opera.com): This count should be 1 when async stylesheet
+ // update with RuleSet invalidations land. Currently we always do a
+ // subtree recalc for stylesheet mutations in shadow trees.
+ assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 5,
+ "Recalc for shadow tree, including host and inserted style element.");
+ }, "Check that adding @keyframes does not cause a style recalc of the host element when no animations are 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