[webkit-changes] [WebKit/WebKit] df1483: Mask clipping determination insufficient for <use>...

Nikolas Zimmermann noreply at github.com
Fri Jun 16 04:46:40 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: df148384b18a40059f52a6ad13f05f7c0612ade9
      https://github.com/WebKit/WebKit/commit/df148384b18a40059f52a6ad13f05f7c0612ade9
  Author: Nikolas Zimmermann <nzimmermann at igalia.com>
  Date:   2023-06-16 (Fri, 16 Jun 2023)

  Changed paths:
    A LayoutTests/svg/clip-path/clip-path-use-referencing-clipped-text-expected.html
    A LayoutTests/svg/clip-path/clip-path-use-referencing-clipped-text.html
    A LayoutTests/svg/clip-path/clip-path-use-referencing-text-expected.html
    A LayoutTests/svg/clip-path/clip-path-use-referencing-text.html
    M Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp

  Log Message:
  -----------
  Mask clipping determination insufficient for <use> elements
https://bugs.webkit.org/show_bug.cgi?id=258168

Reviewed by Rob Buis.

To determine if we need mask clipping or can use path clipping,
the renderer is queried for certain information. This is not
sufficient for <use> renderers -- the logic needs to extend to
the referenced renderer as well.

Previously when referencing e.g. a <text> element that is itself
clipped, from an <use> element (that is a child of <clipPath>)
we determined that path clipping is possible, leading to a
fully clipped object (net result: nothing visible).

Fix that issue, and handle <use> elements in the clip mask determination.

Covered by two new tests, exercising the <use> clipping peculiarities.

* LayoutTests/svg/clip-path/clip-path-use-referencing-clipped-text-expected.html: Added.
* LayoutTests/svg/clip-path/clip-path-use-referencing-clipped-text.html: Added.
* LayoutTests/svg/clip-path/clip-path-use-referencing-text-expected.html: Added.
* LayoutTests/svg/clip-path/clip-path-use-referencing-text.html: Added.
Imported from Blink.

* Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp:
(WebCore::RenderSVGResourceClipper::pathOnlyClipping):

Refactor the mask clipping determination logic into a helper lambda.
Re-use that lambda to check if the <use> referenced clip renderer
is required to use mask clipping, or if path clipping is possible.

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




More information about the webkit-changes mailing list