[webkit-changes] [WebKit/WebKit] b21155: [CSS Shape function] Support interpolation between...

Simon Fraser noreply at github.com
Wed Aug 14 10:18:00 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b211550f85e310471c6e0bf994638fc44ef69966
      https://github.com/WebKit/WebKit/commit/b211550f85e310471c6e0bf994638fc44ef69966
  Author: Simon Fraser <simon.fraser at apple.com>
  Date:   2024-08-14 (Wed, 14 Aug 2024)

  Changed paths:
    M LayoutTests/TestExpectations
    M LayoutTests/imported/w3c/web-platform-tests/css/css-masking/animations/clip-path-interpolation-shape-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-masking/animations/clip-path-interpolation-shape.html
    M LayoutTests/imported/w3c/web-platform-tests/css/motion/animation/offset-path-interpolation-008-expected.txt
    M Source/WebCore/rendering/style/BasicShapes.cpp
    M Source/WebCore/rendering/style/BasicShapesShape.cpp
    M Source/WebCore/rendering/style/BasicShapesShape.h
    M Source/WebCore/svg/SVGPathConsumer.h

  Log Message:
  -----------
  [CSS Shape function] Support interpolation between path() and shape()
https://bugs.webkit.org/show_bug.cgi?id=277709
rdar://133325334

Reviewed by Antti Koivisto.

Support interpolation between `path()` and `shape()` functions as described in [1], where the output is
a `shape()`.

Have `BasicShapePath::canBlend()` and `BasicShapeShape::canBlend()` check to see if the other object
is something that can be blended with, then call into `canBlendWithPath()`. This creates a temporary
BasicShapeShape object to answer the question.

Implement `BasicShapeShape::createFromPath()` to create a BasicShapeShape from a BasicShapePath, using a
`SVGPathParser` with a custom `SVGPathConsumer`. Note an ambiguity in the spec [2] around initial Move
commands vs the "from" in `shape()`.

[1] https://drafts.csswg.org/css-shapes-2/#interpolating-shape
[2] https://github.com/w3c/csswg-drafts/issues/10740

* LayoutTests/TestExpectations:
* LayoutTests/imported/w3c/web-platform-tests/css/css-masking/animations/clip-path-interpolation-shape-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-masking/animations/clip-path-interpolation-shape.html: "via" -> "using"
* LayoutTests/imported/w3c/web-platform-tests/css/motion/animation/offset-path-interpolation-008-expected.txt:
* Source/WebCore/rendering/style/BasicShapes.cpp:
(WebCore::BasicShapePath::canBlend const):
(WebCore::BasicShapePath::blend const):
* Source/WebCore/rendering/style/BasicShapesShape.cpp:
(WebCore::BasicShapeShape::createFromPath):
(WebCore::BasicShapeShape::canBlend const):
(WebCore::BasicShapeShape::canBlendWithPath const):
(WebCore::BasicShapeShape::blend const):
(WebCore::BasicShapeShape::blendWithPath):
* Source/WebCore/rendering/style/BasicShapesShape.h:
* Source/WebCore/svg/SVGPathConsumer.h: Name the arguments, since the order is very non-obvious.

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



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list