-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[css-typed-om] Fix computed value of an interpolated transform.
Previously we did not handle the case of computing the value of an interpolated transform, which occurs when we interpolate between two different transform types containing percentages. The correct result is currently not spec'd [1], so this patch fixes this by just returning "none" in this case. [1] w3c/css-houdini-drafts#425 Bug: 816803 Change-Id: I97c8f6b71f651a8d547fb4cb307121eba7dabdb6
- Loading branch information
1 parent
66ffd92
commit 4e32298
Showing
2 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
css/css-typed-om/the-stylepropertymap/properties/transform-interpolated.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<!doctype html> | ||
<meta charset="utf-8"> | ||
<title>'transform' property with an interpolated value</title> | ||
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-get"> | ||
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-set"> | ||
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#property-stle-value-normalization"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="../../resources/testhelper.js"></script> | ||
<body> | ||
<div id="log"></div> | ||
<script> | ||
'use strict'; | ||
|
||
// TODO: Try to support this sort of test with testsuite.js | ||
test(t => { | ||
let elem = createDivWithStyle(t); | ||
elem.animate( | ||
{ transform: ['translate(1px, 1%)', 'rotate(45deg)'] } | ||
, { | ||
fill: 'forwards', | ||
iterationStart: 0.5, | ||
}); | ||
|
||
// TODO: The computed value in this case is not fully spec'd | ||
// See https://github.com/w3c/css-houdini-drafts/issues/425 | ||
const result = elem.computedStyleMap().get('transform'); | ||
assert_not_equals(result, null); | ||
}, 'Computed value for interpolated transforms is not null'); | ||
|
||
</script> |