Skip to content

Commit cba8486

Browse files
xiaochenghmoz-wptsync-bot
authored andcommitted
Bug 1752634 [wpt PR 32603] - Add <dimension-token> type-checking to CSSNumericValue::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
1 parent 8ee1c41 commit cba8486

File tree

1 file changed

+4
-0
lines changed
  • testing/web-platform/tests/css/css-typed-om/stylevalue-subclasses/numeric-objects

1 file changed

+4
-0
lines changed

testing/web-platform/tests/css/css-typed-om/stylevalue-subclasses/numeric-objects/parse.tentative.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
assert_throws_dom("SyntaxError", () => CSSNumericValue.parse('calc(calc(1px * 2s) + 3%)'));
2424
}, 'Parsing a calc with incompatible units throws a SyntaxError');
2525

26+
test(() => {
27+
assert_throws_dom("SyntaxError", () => CSSNumericValue.parse('1xyz'));
28+
}, 'Parsing a <dimension-token> with invalid units throws a SyntaxError');
29+
2630
test(() => {
2731
assert_style_value_equals(new CSSUnitValue(1, 'px'), CSSNumericValue.parse(' 1px '));
2832
}, 'Parsing ignores surrounding spaces');

0 commit comments

Comments
 (0)