Closed Bug 2084435 Opened 1 month ago Closed 26 days ago

[wpt-sync] Sync PR 63910 - [svg] Fall back to masking when SVG clip path union fails

Categories

(Core :: Web Painting, task, P4)

task

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox162 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 63910 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/63910
Details from upstream follow.

Kurt Catti-Schmidt <kschmi@microsoft.com> wrote:

[svg] Fall back to masking when SVG clip path union fails

LayoutSVGResourceClipper::AsPath() combines multiple \<clipPath> children
using SkOpBuilder. If the union failed, Blink ignored the failure and
cached the first child as a valid analytic clip. Painting then used only
that child, while hit testing and clip bounds continued to account for
every child, producing inconsistent rendering and interaction geometry.

Handle union failure by leaving the analytic-path cache invalid and
returning std::nullopt. This invokes the existing mask-based fallback,
which paints every contributing child and keeps painting consistent with
hit testing and intersection geometry. Use the modern
std::optional\<SkPath> -returning SkOpBuilder::resolve() API rather than
its deprecated output-parameter overload.

Add a WPT reftest covering HTML and SVG clip-path consumers. It uses a
valid path ending in a trailing moveto, which causes Skia path-union
resolution to fail, and verifies that all clip-path children still
contribute to the rendered clip. Verified that the new WPT passes in
Firefox as well.

Bug: 574376000
Change-Id: Ia07a8bbcde4e776b7ff576622fef57a7232fab2e
Reviewed-on: https://chromium-review.googlesource.com/8608391
WPT-Export-Revision: a5a54092dee7b0d99abda8a3363e93a7f1d1d412

Component: web-platform-tests → Web Painting
Product: Testing → Core

CI Results

Ran 11 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 245 tests and 3 subtests

Status Summary

Firefox

OK : 6
PASS: 1[GitHub] 3[Gecko-linux2204-64-wayland-debug, Gecko-linux2204-64-wayland-opt] 177[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 391[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
FAIL: 1[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 22[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]

Chrome

FAIL: 1

Safari

PASS: 1

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Tests Disabled in Gecko Infrastructure

Pushed by wptsync@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/1fdb282b16d7 https://hg.mozilla.org/integration/autoland/rev/892ffb2e6da9 [wpt PR 63910] - [svg] Fall back to masking when SVG clip path union fails, a=testonly
Status: NEW → RESOLVED
Closed: 26 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.