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

Unified Diff: third_party/WebKit/LayoutTests/animations/custom-properties/registered-inheritance.html

Issue 2630503002: Add code path for registered custom properties in CSSInterpolationType (Closed)
Patch Set: Moar buttons Created 3 years, 11 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/LayoutTests/animations/custom-properties/registered-neutral-keyframe.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/animations/custom-properties/registered-inheritance.html
diff --git a/third_party/WebKit/LayoutTests/animations/custom-properties/registered-inheritance.html b/third_party/WebKit/LayoutTests/animations/custom-properties/registered-inheritance.html
new file mode 100644
index 0000000000000000000000000000000000000000..98d512f4cd61bb1382b8bd1f5320a8ae63b860c3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/animations/custom-properties/registered-inheritance.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<style>
+@keyframes test {
+ from {
+ --inherited: from;
+ --non-inherited: from;
+ }
+ to {
+ --inherited: to;
+ --non-inherited: to;
+ }
+}
+#container {
+ animation: test 1s;
+}
+</style>
+<div id="container">
+ <div id="child"></div>
+</div>
+<script>
+CSS.registerProperty({
+ name: '--inherited',
+ syntax: '*',
+ initialValue: 'initialValue',
+ inherits: true,
+});
+CSS.registerProperty({
+ name: '--non-inherited',
+ syntax: '*',
+ initialValue: 'initialValue',
+ inherits: false,
+});
+
+function read(element, property) {
+ return getComputedStyle(element).getPropertyValue(property);
+}
+
+test(() => {
+ container.style.animationDelay = '-0.25s';
+ assert_equals(read(container, '--inherited'), ' from', 'container at 25%');
+ assert_equals(read(child, '--inherited'), ' from', 'child at 25%');
+
+ container.style.animationDelay = '-0.75s';
+ assert_equals(read(container, '--inherited'), ' to', 'container at 75%');
+ assert_equals(read(child, '--inherited'), ' to', 'child at 75%');
+}, 'CSS Animations on registered inherited custom properties should get inherited');
+
+test(() => {
+ container.style.animationDelay = '-0.25s';
+ assert_equals(read(container, '--non-inherited'), ' from', 'container at 25%');
+ assert_equals(read(child, '--non-inherited'), 'initialValue', 'child at 25%');
+
+ container.style.animationDelay = '-0.75s';
+ assert_equals(read(container, '--non-inherited'), ' to', 'container at 75%');
+ assert_equals(read(child, '--non-inherited'), 'initialValue', 'child at 75%');
+}, 'CSS Animations on registered non-inherited custom properties should not get inherited');
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/animations/custom-properties/registered-neutral-keyframe.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698