Closed Bug 2059689 Opened 3 months ago Closed 3 months ago

[wpt-sync] Sync PR 61656 - script: More carefully handle dirty root and descendant damage marking

Categories

(Core :: DOM: Core & HTML, task, P4)

task

Tracking

()

RESOLVED FIXED
155 Branch
Tracking Status
firefox155 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Martin Robinson <mrobinson@igalia.com> wrote:

script: More carefully handle dirty root and descendant damage marking

Script passes a dirty root to layout along with setting the
HAS_DIRTY_DESCENDANTS flag on elements at or below that root indicating
that children need to be traversed. There was an undocumented invariant
that no nodes above that dirty root were marked with
HAS_DIRTY_DESCENDANTS, as the flag itself was used to determine
when the dirty root is raised to some common ancestor of the old dirty
root and a damaged node.

There were some problems with the old implementation and this change
fixes them by hewing closer to Gecko (from which we took this design).
Notably:

  • In the complex situation where we cannot trivially calculate the dirty
    root, we now calculate it by walking up from the old dirty root and
    finding the first element which already has the flag set.
  • When removing nodes from the flat tree, if they were the previous
    dirty root, the dirty root is cleared.
  • Ensure that all marking traversals for HAS_DIRTY_DESCENDANTS flag
    marking happen in the flat tree.
  • When slotting nodes into <slot> elements, the style and layout data
    of fallback content is cleared, and the dirty root is potentially reset.
  • Comments are added everywhere in this tricky algorithm explaining what
    the heck is going on.

Testing: This change adds a new WPT crash test.
Fixes: #<!-- nolink -->46024.
Fixes: #<!-- nolink -->46883.

Reviewed in servo/servo#46906

Component: web-platform-tests → DOM: Core & HTML
Product: Testing → Core

CI Results

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

Total 25 tests

Status Summary

Firefox

PASS: 1[GitHub] 25[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-linux2204-64-wayland-debug, Gecko-linux2204-64-wayland-opt, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, 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

Pushed by wptsync@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/964c21252ea9 https://hg.mozilla.org/integration/autoland/rev/0e05babc9a15 [wpt PR 61656] - script: More carefully handle dirty root and descendant damage marking, a=testonly
Status: NEW → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 155 Branch
You need to log in before you can comment on or make changes to this bug.