Closed Bug 2089414 Opened 13 days ago Closed 4 days ago

[wpt-sync] Sync PR 64446 - WebKit export of https://bugs.webkit.org/show_bug.cgi?id=328003

Categories

(Core :: SVG, 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 64446 into mozilla-central (this bug is closed when the sync is complete).

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

Nikolas Zimmermann <nzimmermann@igalia.com> wrote:

WebKit export of https://bugs.webkit.org/show_bug.cgi?id=328003

WebKit export from bug: REGRESSION(<!---->324026@<!---->main)<!---->:<!----> [<!---->Legacy SVG]<!----> ASSERTION FAILED:<!----> isDescendantOf(<!---->&<!---->view(<!---->)<!---->)<!----> in RenderObject:<!---->:<!---->repaint(<!---->)<!----> for a marker that references its own resource container

<pre>
REGRESSION(<a href="https://commits.webkit.org/324026@main">324026@main</a>): [Legacy SVG] ASSERTION FAILED: isDescendantOf(&view()) in RenderObject::repaint() for a marker that references its own resource container

Since <a href="https://commits.webkit.org/324026@main">324026@main</a>, which registered CSS clients for mask references in the
legacy SVG engine, svg/painting/marker-with-mask-cycle-crash.html
triggers an assertion. The test constructs a reference cycle: a <marker>
references a <mask>, whose content contains a <path> that in turn
references the <marker>.

The assertion results from the following actions during creation of the
<marker> renderer:

  1. RenderElement::initializeStyle() invokes styleDidChange() on the newly
    created renderer, before it has been inserted into the render tree.

  2. During styleDidChange(), the <marker> renderer registers itself as a
    client of the referenced <mask> element.

  3. The resource container registers itself with its tree scope. Since the
    <path> within the <mask> holds a pending reference to the <marker>,
    registration resolves that reference and updates the cached resources
    of the <path>, which in turn invalidates the <mask> and notifies all of its clients.

  4. The notified clients include the <marker> renderer itself. The legacy
    engine tries to repaints it, yet the renderer is still not attached to
    the render tree and RenderObject::repaint() asserts.

A <clipPath> instead of the <mask> leads to the same assertion. That
variant is not a regression from <a href="https://commits.webkit.org/324026@main">324026@main</a>: the legacy engine already
registered CSS clients for clip-path (and filter) references before it,
so it asserted before as well.

Resolve this by deferring resource registration from styleDidChange() to
insertedIntoTree(). The resource container is then part of the render
tree by the time its pending clients are resolved, and any resulting
repaint operates on an attached renderer.

LBSE registers its resource containers in the same way. It didn't assert
only because of its invalidation path returns early for renderers that
still require layout, which is always the case for a newly created renderer.
For consistency, LBSE now defers registration to insertedIntoTree() as well,
and CSSSVGResourceElementClient::resourceChanged() asserts, for both engines,
that the client renderer has a parent.

WebKit-Bug: <a href="https://bugs.webkit.org/show_bug.cgi?id=328003">https://bugs.webkit.org/show_bug.cgi?id=328003</a>
WebKit-Canonical-Link: <a href="https://commits.webkit.org/324619@main">https://commits.webkit.org/324619@main</a>
</pre>

Whiteboard: [wptsync downstream] → [wptsync downstream error]
Component: web-platform-tests → SVG
Product: Testing → Core
Whiteboard: [wptsync downstream error] → [wptsync downstream]

CI Results

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

Total 166 tests

Status Summary

Firefox

OK : 71
PASS: 1[GitHub] 2[Gecko-linux2204-64-wayland-debug, Gecko-linux2204-64-wayland-opt] 658[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 729[Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt] 730[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]
FAIL: 16[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 36[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] 37[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt] 38[Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]

Chrome

PASS: 1

Safari

PASS: 1

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Status: NEW → RESOLVED
Closed: 4 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.