Skip to content

Commit

Permalink
Bug 1752634 [wpt PR 32603] - Add <dimension-token> type-checking to C…
Browse files Browse the repository at this point in the history
…SSNumericValue::parse(), a=testonly

Automatic update from web-platform-tests
Add <dimension-token> type-checking to CSSNumericValue::parse()

This patch implements a recent spec bug fix:

w3c/css-houdini-drafts#1065

Fixed: 1291603
Change-Id: I3adae8148dd47b24d4516448e492daccce7ecd91
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3425673
Auto-Submit: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#965351}

--

wpt-commits: 9c338218c44d4c52f0affc32025fd847b7985f92
wpt-pr: 32603
  • Loading branch information
xiaochengh authored and moz-wptsync-bot committed Feb 26, 2022
1 parent eeaa64d commit f94fb52
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
assert_throws_dom("SyntaxError", () => CSSNumericValue.parse('calc(calc(1px * 2s) + 3%)'));
}, 'Parsing a calc with incompatible units throws a SyntaxError');

test(() => {
assert_throws_dom("SyntaxError", () => CSSNumericValue.parse('1xyz'));
}, 'Parsing a <dimension-token> with invalid units throws a SyntaxError');

test(() => {
assert_style_value_equals(new CSSUnitValue(1, 'px'), CSSNumericValue.parse(' 1px '));
}, 'Parsing ignores surrounding spaces');
Expand Down

0 comments on commit f94fb52

Please sign in to comment.