[webkit-changes] [WebKit/WebKit] 70f48f: [CSS] Fix serialization issues with clip-path & of...

Tim Nguyen noreply at github.com
Sun Sep 24 16:58:32 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 70f48f9012f4066004dc47c186f8f76cfee1a99e
      https://github.com/WebKit/WebKit/commit/70f48f9012f4066004dc47c186f8f76cfee1a99e
  Author: Tim Nguyen <ntim at apple.com>
  Date:   2023-09-24 (Sun, 24 Sep 2023)

  Changed paths:
    M LayoutTests/fast/masking/parsing-clip-path-shape-expected.txt
    M LayoutTests/fast/masking/parsing-clip-path-shape.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-masking/parsing/clip-path-valid.html
    M LayoutTests/imported/w3c/web-platform-tests/css/motion/parsing/offset-path-computed-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/motion/parsing/offset-path-parsing-valid-expected.txt
    M LayoutTests/svg/clip-path/clip-path-shape-content-box-expected.svg
    M LayoutTests/svg/clip-path/clip-path-shape-fill-expected.svg
    M LayoutTests/svg/clip-path/clip-path-shape-padding-box-expected.svg
    M Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp
    M Source/WebCore/rendering/RenderElement.cpp
    M Source/WebCore/rendering/svg/SVGRenderSupport.cpp
    M Source/WebCore/style/StyleBuilderConverter.h

  Log Message:
  -----------
  [CSS] Fix serialization issues with clip-path & offset-path
https://bugs.webkit.org/show_bug.cgi?id=262009
rdar://115953688

Reviewed by Darin Adler.

Two issues:
- We should serialize in canonical order (<basic-shape> before <geometry-box>)
- `border-box` should be omitted as it is the default <geometry-box> for both properties

This patch also updates the default geometry-box for clip-path to border-box per spec: https://drafts.fxtf.org/css-masking/#typedef-geometry-box

* LayoutTests/fast/masking/parsing-clip-path-shape-expected.txt:
* LayoutTests/fast/masking/parsing-clip-path-shape.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-masking/parsing/clip-path-valid.html:
* LayoutTests/imported/w3c/web-platform-tests/css/motion/parsing/offset-path-computed-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/motion/parsing/offset-path-parsing-valid-expected.txt:

Rebaseline passing tests.

* LayoutTests/svg/clip-path/clip-path-shape-content-box-expected.svg:
* LayoutTests/svg/clip-path/clip-path-shape-fill-expected.svg:
* LayoutTests/svg/clip-path/clip-path-shape-padding-box-expected.svg:

Update tests to account for the new default geometry box.

* Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeRayShape):
(WebCore::CSSPropertyParserHelpers::consumeBasicShapeRayOrBox):

Fix parsing.

* Source/WebCore/rendering/RenderElement.cpp:
(WebCore::RenderElement::referenceBoxRect const):
* Source/WebCore/rendering/svg/SVGRenderSupport.cpp:
(WebCore::clipPathReferenceBox):

Fix the default clip-path reference box.

* Source/WebCore/style/StyleBuilderConverter.h:
(WebCore::Style::BuilderConverter::convertPathOperation):
(WebCore::Style::BuilderConverter::convertShapeValue):

Cleanup.

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




More information about the webkit-changes mailing list