Skip to content
Permalink
Browse files
Stop allowing numbers during parsing of baseline-shift CSS property
https://bugs.webkit.org/show_bug.cgi?id=249482

Reviewed by Sam Weinig.

Stop allowing numbers during parsing of baseline-shift CSS property.

Per the specification, we should allow <length-percentage>, not <number>:
- https://w3c.github.io/csswg-drafts/css-inline/#baseline-shift-property

* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/baseline-shift-expected.txt:
Rebaseline WPT test now that more checks are passing.

* Source/WebCore/css/CSSProperties.json:
Drop svg attribute mode since it allows unitless values during parsing.

Canonical link: https://commits.webkit.org/258025@main
  • Loading branch information
cdumez committed Dec 17, 2022
1 parent 5c14835 commit 5e3c6ae374505bbac841e970337a2fd6d9f59dcf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
@@ -26,9 +26,9 @@ PASS Setting 'baseline-shift' to a flexible length: 0fr throws TypeError
PASS Setting 'baseline-shift' to a flexible length: 1fr throws TypeError
PASS Setting 'baseline-shift' to a flexible length: -3.14fr throws TypeError
FAIL Setting 'baseline-shift' to a number: 0 throws TypeError assert_throws_js: function "() => styleMap.set(propertyName, example.input)" did not throw
FAIL Setting 'baseline-shift' to a number: -3.14 throws TypeError assert_throws_js: function "() => styleMap.set(propertyName, example.input)" did not throw
FAIL Setting 'baseline-shift' to a number: 3.14 throws TypeError assert_throws_js: function "() => styleMap.set(propertyName, example.input)" did not throw
FAIL Setting 'baseline-shift' to a number: calc(2 + 3) throws TypeError assert_throws_js: function "() => styleMap.set(propertyName, example.input)" did not throw
PASS Setting 'baseline-shift' to a number: -3.14 throws TypeError
PASS Setting 'baseline-shift' to a number: 3.14 throws TypeError
PASS Setting 'baseline-shift' to a number: calc(2 + 3) throws TypeError
PASS Setting 'baseline-shift' to a transform: translate(50%, 50%) throws TypeError
PASS Setting 'baseline-shift' to a transform: perspective(10em) throws TypeError
PASS Setting 'baseline-shift' to a transform: translate3d(0px, 1px, 2px) translate(0px, 1px) rotate3d(1, 2, 3, 45deg) rotate(45deg) scale3d(1, 2, 3) scale(1, 2) skew(1deg, 1deg) skewX(1deg) skewY(45deg) perspective(1px) matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) matrix(1, 2, 3, 4, 5, 6) throws TypeError
@@ -1470,7 +1470,7 @@
"codegen-properties": {
"custom": "Value",
"svg": true,
"parser-grammar": "baseline | sub | super | <length-percentage svg>"
"parser-grammar": "baseline | sub | super | <length-percentage>"
},
"specification": {
"category": "svg",

0 comments on commit 5e3c6ae

Please sign in to comment.