Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 897e0e8f7d8a30e32066ada735fcb452036789ac
      
https://github.com/WebKit/WebKit/commit/897e0e8f7d8a30e32066ada735fcb452036789ac
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-06-20 (Sat, 20 Jun 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-masking/clip-path/clip-path-nested-clippath-zoom-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-masking/clip-path/clip-path-nested-clippath-zoom.html
    M Source/WebCore/rendering/svg/legacy/LegacyRenderSVGResourceClipper.cpp

  Log Message:
  -----------
  [LegacySVG] Nested clip-path (clip-path on a clipPath) ignores zoom
https://bugs.webkit.org/show_bug.cgi?id=317512
rdar://180162723

Reviewed by Nikolas Zimmermann.

This patch aligns WebKit with Blink / Chromium.

When a <clipPath> is itself clipped by another clipPath, the painted-mask
clipping path recurses into 
LegacyRenderSVGResourceClipper::applyClippingToContext()
to apply the nested clip. That recursive call omitted the trailing usedZoom
argument, so it silently fell back to the default value of 1. As a result a
nested userSpaceOnUse clip was not scaled by the zoom factor, while the outer
clip was, producing a clipped region of the wrong size under non-default zoom.

Fix by forwarding usedZoom to the nested applyClippingToContext() call, matching
how it is threaded through the rest of the clipping code.

NOTE: This bug is not present in Layer Based SVG Engine (LBSE).

Test: 
imported/w3c/web-platform-tests/css/css-masking/clip-path/clip-path-nested-clippath-zoom.html

* Source/WebCore/rendering/svg/legacy/LegacyRenderSVGResourceClipper.cpp:
(WebCore::LegacyRenderSVGResourceClipper::applyClippingToContext): Pass usedZoom
to the nested clipper so the inner clip is scaled consistently with the outer 
clip.

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-masking/clip-path/clip-path-nested-clippath-zoom.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-masking/clip-path/clip-path-nested-clippath-zoom-expected.html:
 Added.

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



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

Reply via email to