Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 77685f21f584083f4170cb835c0d517448e46912
      
https://github.com/WebKit/WebKit/commit/77685f21f584083f4170cb835c0d517448e46912
  Author: Chris Dumez <[email protected]>
  Date:   2022-12-19 (Mon, 19 Dec 2022)

  Changed paths:
    M LayoutTests/fast/css/parsing-stroke-width-expected.txt
    M LayoutTests/fast/css/parsing-stroke-width.html
    A LayoutTests/fast/css/stroke-dashoffset-parsing-expected.txt
    A LayoutTests/fast/css/stroke-dashoffset-parsing.html
    A LayoutTests/fast/css/stroke-width-parsing-expected.txt
    A LayoutTests/fast/css/stroke-width-parsing.html
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/stroke-dashoffset-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/stroke-dashoffset.html
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/stroke-width-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/stroke-width.html
    M 
LayoutTests/imported/w3c/web-platform-tests/svg/painting/parsing/stroke-dashoffset-invalid-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/svg/painting/parsing/stroke-dashoffset-valid-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/svg/painting/parsing/stroke-dashoffset-valid.svg
    M 
LayoutTests/imported/w3c/web-platform-tests/svg/painting/parsing/stroke-width-computed-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/svg/painting/parsing/stroke-width-invalid-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/svg/painting/parsing/stroke-width-valid-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/svg/painting/parsing/stroke-width-valid.svg
    M Source/WebCore/css/CSSProperties.json
    M Source/WebCore/css/typedom/CSSUnitValue.cpp
    M Source/WebCore/style/StyleBuilderConverter.h
    M Source/WebCore/style/StyleBuilderCustom.h

  Log Message:
  -----------
  Align `stroke-width` & `stroke-dashoffset` CSS property parsing with the 
specification
https://bugs.webkit.org/show_bug.cgi?id=249510

Reviewed by Cameron McCormack.

Align `stroke-width` & `stroke-dashoffset` CSS property parsing with the 
specification:
- https://svgwg.org/svg2-draft/painting.html#StrokeWidth
- https://svgwg.org/svg2-draft/painting.html#StrokeDashoffsetProperty

For stroke-width:
- Use `<length-percentage [0,inf]> | <number [0,inf]>` parser grammar instead of
  `<length-percentage svg>`. The specification actually says
  `<length-percentage> | <number>` but carries on to say that negative values 
are
  invalid.

For stroke-dashoffset:
- Use `<length-percentage> | <number>` parser grammar instead of
  `<length-percentage svg>`, as per the specification.

* LayoutTests/fast/css/parsing-stroke-width-expected.txt:
* LayoutTests/fast/css/parsing-stroke-width.html:
Update existing test to reflect behavior change.

* LayoutTests/fast/css/stroke-dashoffset-parsing-expected.txt: Added.
* LayoutTests/fast/css/stroke-dashoffset-parsing.html: Added.
* LayoutTests/fast/css/stroke-width-parsing-expected.txt: Added.
* LayoutTests/fast/css/stroke-width-parsing.html: Added.
Extend layout test coverage. Those 2 tests are passing in both Chrome and
Firefox.

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/stroke-dashoffset-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/stroke-dashoffset.html:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/stroke-width-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/stroke-width.html:
Update existing CSS-Typed-OM tests to match the specification for `stroke-width`
and `stroke-dashoffset`. The tests incorrectly didn't allow <number> for these
properties.

* 
LayoutTests/imported/w3c/web-platform-tests/svg/painting/parsing/stroke-dashoffset-invalid-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/svg/painting/parsing/stroke-width-computed-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/svg/painting/parsing/stroke-width-invalid-expected.txt:
Rebaseline WPT tests now that more checks are passing.

* Source/WebCore/css/CSSProperties.json:
- Update parser grammar to match the specification.
- Use convertLengthAllowingNumber() instead of convertLength() since we now 
allow numbers which need
  to be converted to a length by adding 'px' (as per spec).

* Source/WebCore/css/typedom/CSSUnitValue.cpp:
(WebCore::isValueOutOfRangeForProperty):
Update function to correctly report that `stroke-width` doesn't allow negative 
values.

* Source/WebCore/style/StyleBuilderConverter.h:
(WebCore::Style::BuilderConverter::convertLength):
Introduce a new convertLengthAllowingNumber() function which mostly behaves like
convertLength() but also allows numbers, which it silently converts a lengths
by assuming they are pixels. This behavior is used by `stroke-width` and
`stroke-dashoffset`, and mandated by the specification.

Canonical link: https://commits.webkit.org/258107@main


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to