Skip to content

Commit 553d467

Browse files
janvargamoz-wptsync-bot
authored andcommitted
Add a WPT for mixed length-percentage CSSTranslate coordinates
Add a WPT for mixed length-percentage CSSTranslate coordinates Add a regression test covering construction of a CSSTranslate from CSSMathSum values containing both a length and a percentage. This verifies that mixed <length-percentage> CSSMathValues are accepted for the X and Y coordinates, as required by the Typed OM specification. Differential Revision: https://phabricator.services.mozilla.com/D315277 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=2057579 gecko-commit: d90e27aeba1d29957a5687e42e2483e0ecd868d4 gecko-reviewers: emilio, firefox-style-system-reviewers
1 parent 14d3819 commit 553d467

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

css/css-typed-om/stylevalue-subclasses/cssTranslate.tentative.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,15 @@
6565
assert_true(result.is2D);
6666
}, 'CSSTranslate can be constructed from CSSMathValues');
6767

68+
test(() => {
69+
const value = new CSSMathSum(CSS.px(-3.14), CSS.percent(3.14));
70+
const result = new CSSTranslate(value, value);
71+
assert_style_value_equals(result.x, value);
72+
assert_style_value_equals(result.y, value);
73+
assert_style_value_equals(result.z, CSS.px(0));
74+
assert_true(result.is2D);
75+
}, 'CSSTranslate can be constructed from mixed length-percentage CSSMathValues');
76+
6877
for (const attr of ['x', 'y']) {
6978
test(() => {
7079
let result = new CSSTranslate(CSS.px(0), CSS.px(0), CSS.px(0));

0 commit comments

Comments
 (0)