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

Unified Diff: third_party/WebKit/LayoutTests/animations/responsive/resources/responsive-test.js

Issue 1866333002: Support additive animations on CSS property transform (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review changes Created 4 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
Index: third_party/WebKit/LayoutTests/animations/responsive/resources/responsive-test.js
diff --git a/third_party/WebKit/LayoutTests/animations/responsive/resources/responsive-test.js b/third_party/WebKit/LayoutTests/animations/responsive/resources/responsive-test.js
index 05f803e2fa2211aa6491316bf7c594590cc58b4f..5a35f5c3c45b51304f4bf499828c0d075c21138b 100644
--- a/third_party/WebKit/LayoutTests/animations/responsive/resources/responsive-test.js
+++ b/third_party/WebKit/LayoutTests/animations/responsive/resources/responsive-test.js
@@ -143,14 +143,23 @@ function createTargets(bindings, n, container) {
}
function setState(bindings, targets, property, state) {
- if (state.inherited) {
- var parent = targets[0].parentElement;
- console.assert(targets.every(target => target.parentElement === parent));
- bindings.setValue(parent, property, state.inherited);
- }
- if (state.underlying) {
- for (var target of targets) {
- bindings.setValue(target, property, state.underlying);
+ for (var item in state) {
+ switch (item) {
+ case 'inherited':
+ var parent = targets[0].parentElement;
+ console.assert(targets.every(target => target.parentElement === parent));
+ bindings.setValue(parent, property, state.inherited);
+ break;
+ case 'underlying':
+ for (var target of targets) {
+ bindings.setValue(target, property, state.underlying);
+ }
+ break;
+ default:
+ for (var target of targets) {
+ bindings.setValue(target, item, state[item]);
+ }
+ break;
}
}
}

Powered by Google App Engine
This is Rietveld 408576698