Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6050a91d396cdfc1200117dbe456ea291e64860c
      
https://github.com/WebKit/WebKit/commit/6050a91d396cdfc1200117dbe456ea291e64860c
  Author: Nikolas Zimmermann <[email protected]>
  Date:   2026-08-07 (Fri, 07 Aug 2026)

  Changed paths:
    M LayoutTests/platform/mac-tahoe-wk2-lbse-text/TestExpectations
    A 
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/dynamic-updates/SVGMaskElement-dom-height-attr-expected.png
    A 
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/dynamic-updates/SVGMaskElement-dom-maskContentUnits-attr-expected.png
    A 
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/dynamic-updates/SVGMaskElement-dom-maskUnits-attr-expected.png
    A 
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/dynamic-updates/SVGMaskElement-dom-width-attr-expected.png
    A 
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/dynamic-updates/SVGMaskElement-dom-x-attr-expected.png
    A 
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/dynamic-updates/SVGMaskElement-dom-y-attr-expected.png
    A 
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/dynamic-updates/SVGMaskElement-svgdom-height-prop-expected.png
    A 
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/dynamic-updates/SVGMaskElement-svgdom-maskContentUnits-prop-expected.png
    A 
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/dynamic-updates/SVGMaskElement-svgdom-maskUnits-prop-expected.png
    A 
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/dynamic-updates/SVGMaskElement-svgdom-width-prop-expected.png
    A 
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/dynamic-updates/SVGMaskElement-svgdom-x-prop-expected.png
    A 
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/dynamic-updates/SVGMaskElement-svgdom-y-prop-expected.png
    A 
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/repaint/mask-clip-target-transform-expected.png
    M Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp
    M Source/WebCore/rendering/svg/RenderSVGResourceMasker.h
    M Source/WebCore/svg/SVGMaskElement.cpp

  Log Message:
  -----------
  [LBSE] Fix remaining mask issues
https://bugs.webkit.org/show_bug.cgi?id=321215

Reviewed by Simon Fraser.

RenderSVGResourceMasker cancelled 'adjustedPaintOffset' against
objectBoundingBox() instead of nominalSVGLayoutLocation(), displacing the mask
of any target whose children carry transforms. It also ignored the mask region
given by x/y/width/height, so mask content reaching past it was not cut off and
a mask covering nothing left its target fully visible. Confining the image also
makes painting clip to that region, and a rectangular clip is not antialiased,
so a fractional region rounds the outermost row and column of the mask away.
Round it _outwards_ to the whole pixels the image is rasterized over.

Two problems concerned the cached mask image: nothing dropped it on layout, so
a resized viewport went on masking with an image rasterized for the percentage
lengths of the old one. It was also allocated through ImageBuffer::create()
rather than through the context, which in the GPU process leaves the context
without a handle to it, so every paint has to upload the mask again...

Finally, SVGMaskElement::calculateMaskContentRepaintRect() skipped mask
children with 'visibility: hidden', whose descendants can turn visibility back
on.

The fixes combined, fix all remaining issues with SVG masks in LBSE.

* LayoutTests/platform/mac-tahoe-wk2-lbse-text/TestExpectations:
* 
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/dynamic-updates/SVGMaskElement-dom-height-attr-expected.png:
 Added.
* 
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/dynamic-updates/SVGMaskElement-dom-maskContentUnits-attr-expected.png:
 Added.
* 
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/dynamic-updates/SVGMaskElement-dom-maskUnits-attr-expected.png:
 Added.
* 
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/dynamic-updates/SVGMaskElement-dom-width-attr-expected.png:
 Added.
* 
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/dynamic-updates/SVGMaskElement-dom-x-attr-expected.png:
 Added.
* 
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/dynamic-updates/SVGMaskElement-dom-y-attr-expected.png:
 Added.
* 
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/dynamic-updates/SVGMaskElement-svgdom-height-prop-expected.png:
 Added.
* 
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/dynamic-updates/SVGMaskElement-svgdom-maskContentUnits-prop-expected.png:
 Added.
* 
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/dynamic-updates/SVGMaskElement-svgdom-maskUnits-prop-expected.png:
 Added.
* 
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/dynamic-updates/SVGMaskElement-svgdom-width-prop-expected.png:
 Added.
* 
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/dynamic-updates/SVGMaskElement-svgdom-x-prop-expected.png:
 Added.
* 
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/dynamic-updates/SVGMaskElement-svgdom-y-prop-expected.png:
 Added.
* 
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/repaint/mask-clip-target-transform-expected.png:
 Added.
* Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp:
(WebCore::createImageBuffer):
(WebCore::RenderSVGResourceMasker::applyMask):
(WebCore::RenderSVGResourceMasker::maskBoundsInLocalCoordinates):
(WebCore::RenderSVGResourceMasker::resourceBoundingBox):
* Source/WebCore/rendering/svg/RenderSVGResourceMasker.h:
* Source/WebCore/svg/SVGMaskElement.cpp:
(WebCore::SVGMaskElement::calculateMaskContentRepaintRect):

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



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

Reply via email to