[wpt-sync] Sync PR 63147 - Skip siblings pending re-attach when finding the next layout sibling
Categories
(Core :: DOM: Core & HTML, task, P4)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox159 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 63147 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/63147
Details from upstream follow.
Misha Nasledov <misha@nasledov.com> wrote:
Skip siblings pending re-attach when finding the next layout sibling
moveBefore() does not detach the layout tree of the node it moves. The
node is marked for a forced re-attach instead, so until the next layout
tree rebuild its LayoutObject is still a child of its old parent's
LayoutObject, while in the DOM it is already a sibling of its new
siblings.If one of those new siblings changes between in-flow and out-of-flow
(position: absolute/fixed, or float) in the same frame,
Element::RecalcOwnStyle() removes its LayoutObject and re-inserts it
before LayoutTreeBuilderTraversal::NextSiblingLayoutObject(). That
returned the moved node's stale LayoutObject, which is not in the
parent's layout subtree at all. AddChild() then took the
AddChildBeforeDescendant() path, walked up from the stale object past
the LayoutView looking for a child of the parent, and dereferenced
null.moveBefore() is one way to get there, not the only one: re-slotting a
shadow host's child marks it for a forced re-attach the same way, and
ClusterFuzz reached the same crash through \<select>'s manual slot
assignment. This change also stops the ClusterFuzz testcase for that
bug from crashing.A sibling that is pending re-attach is not a valid insertion point, and
does not need to be one: it is inserted relative to its own siblings
when it is re-attached. Skip such siblings in
NextSiblingLayoutObjectInternal(), next to the existing skip for
LayoutObjects that are reparented into the top layer or an overscroll
area.Fixed: 541682083
Test: external/wpt/dom/nodes/moveBefore/moveBefore-out-of-flow-sibling-crash.html
Change-Id: Ia4fcfef31aa1571d8ea9f73ac29710e1257358e1Reviewed-on: https://chromium-review.googlesource.com/8467632
WPT-Export-Revision: c5f15a7800bf65b349649677db42dc36b5a556ea
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Comment 1•1 month ago
|
||
Pushed to try (stability) https://treeherder.mozilla.org/jobs?repo=try&landoInstance=lando-prod-2025&landoCommitID=99163
| Assignee | ||
Comment 2•1 month ago
|
||
CI Results
Ran 11 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI
Total 63 tests
Status Summary
Firefox
OK : 53
PASS : 1[GitHub] 8[Gecko-linux2204-64-wayland-debug, Gecko-linux2204-64-wayland-opt] 127[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 129[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 : 9
Chrome
CRASH: 1
Safari
PASS : 1
Links
Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base
Details
New Tests That Don't Pass
- /dom/nodes/moveBefore/custom-element-move-reactions.html [wpt.fyi]
- connectedMove runs when custom element is nested within a shadow root:
FAIL
- connectedMove runs when custom element is nested within a shadow root:
- /dom/nodes/moveBefore/preserve-render-blocking-script.html [wpt.fyi]
- A moved script should keep its render-blocking state:
FAIL
- A moved script should keep its render-blocking state:
- /dom/nodes/moveBefore/preserve-render-blocking-style.html [wpt.fyi]
- A moved script should keep its render-blocking state:
FAIL
- A moved script should keep its render-blocking state:
- /dom/nodes/moveBefore/role-updates-after-move.html [wpt.fyi]
- header elements role should become sectionheader when moved into a section:
FAIL
- header elements role should become sectionheader when moved into a section:
- /dom/nodes/moveBefore/selection-preserve.html [wpt.fyi]
- moveBefore should not reset selection with preceding text:
FAIL - moveBefore resets selection that enters a subtree, when the whole selection is moved:
FAIL - moveBefore anchor node moved up to expand selection and absorb nodes:
FAIL - moveBefore focus node moved up to shrink selection and exclude nodes; focus node gets reset:
FAIL - moveBefore selection is not preserved, especially when underlying range gets inverted:
FAIL
- moveBefore should not reset selection with preceding text:
Comment 4•1 month ago
|
||
| bugherder | ||
Description
•