[wpt-sync] Sync PR 58955 - Fix reentrancy crash when hint popover closing mutates auto ancestor
Categories
(Core :: DOM: Core & HTML, task, P4)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox151 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 58955 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/58955
Details from upstream follow.
Mason Freed <masonf@chromium.org> wrote:
Fix reentrancy crash when hint popover closing mutates auto ancestor
When a popover=auto or a popover=hint (without an ancestor in the hint
stack) is shown, the entire hint stack must be closed before the auto
stack is closed. During the hide process for the hint stack,
beforetoggleevents are fired which can mutate the DOM.Previously, the
auto_ancestorwas computed before the hint stack
was closed in the popover=auto path. If abeforetoggleevent handler
mutated the newly discoveredauto_ancestor(e.g. by changing its
popovertype tomanualor removing it), the subsequent call to
HideAllPopoversUntil(auto_ancestor)wouldCHECK-fail because the
expected endpoint in the stack was no longer valid.This patch fixes the crash and refactors the stack management logic by
safely computing theauto_ancestorafter
CloseEntirePopoverStack(hint_stack)has executed and after uniform
reentrancy/validity checks have been applied to both popover=auto and
popover=hint paths. By consolidating this logic, it also removes
unnecessary branching and duplication.Fixed: 496629066
Change-Id: Ia38283f58d957ce02d355a096c66713d6b6cb16a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7709272
Reviewed-by: David Baron \<dbaron@chromium.org>
Auto-Submit: Mason Freed \<masonf@chromium.org>
Commit-Queue: Mason Freed \<masonf@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1609360}
| Assignee | ||
Updated•3 months ago
|
| Assignee | ||
Comment 1•3 months ago
|
||
| Assignee | ||
Comment 2•3 months ago
|
||
CI Results
Ran 11 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI
Total 107 tests
Status Summary
Firefox
OK : 78
PASS : 4[GitHub] 11[Gecko-linux2204-64-wayland-debug, Gecko-linux2204-64-wayland-opt] 3827[Gecko-windows11-32-24h2-debug, Gecko-windows11-32-24h2-opt] 3844[Gecko-windows11-64-24h2-debug, Gecko-windows11-64-24h2-opt] 3845[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 : 20[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-32-24h2-debug, Gecko-windows11-32-24h2-opt] 21[Gecko-windows11-64-24h2-debug, Gecko-windows11-64-24h2-opt]
Chrome
PASS : 1
CRASH: 3
Safari
PASS : 4
Links
Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base
Details
New Tests That Don't Pass
- /html/semantics/popovers/light-dismiss-event-ordering.tentative.html [wpt.fyi]
- Tests the order of pointer/mouse events during popover light dismiss.:
FAIL
- Tests the order of pointer/mouse events during popover light dismiss.:
- /html/semantics/popovers/light-dismiss-remove-target.html [wpt.fyi]
- Light dismiss should still happen if the clicked element is removed during pointerdown.:
FAIL
- Light dismiss should still happen if the clicked element is removed during pointerdown.:
- /html/semantics/popovers/popover-active-document.html [wpt.fyi]
- showPopover should throw when the document isn't active:
FAIL
- showPopover should throw when the document isn't active:
- /html/semantics/popovers/popover-focus-5.html?commandfor [wpt.fyi]
- Focusing elements inside a popover with a details element inside, and the after button adjacent to invoker, using commandfor:
FAIL - Focusing elements inside a popover with custom-element with a slotted button, followed by a details element, where the after button is adjacent to the invoker, using commandfor:
FAIL
- Focusing elements inside a popover with a details element inside, and the after button adjacent to invoker, using commandfor:
- /html/semantics/popovers/popover-focus-5.html?popovertargetelement [wpt.fyi]
- Focusing elements inside a popover with a details element inside, and the after button adjacent to invoker, using popovertargetelement:
FAIL - Focusing elements inside a popover with custom-element with a slotted button, followed by a details element, where the after button is adjacent to the invoker, using popovertargetelement:
FAIL
- Focusing elements inside a popover with a details element inside, and the after button adjacent to invoker, using popovertargetelement:
- /html/semantics/popovers/popover-focus-5.html?commandforelement [wpt.fyi]
- Focusing elements inside a popover with a details element inside, and the after button adjacent to invoker, using commandforelement:
FAIL - Focusing elements inside a popover with custom-element with a slotted button, followed by a details element, where the after button is adjacent to the invoker, using commandforelement:
FAIL
- Focusing elements inside a popover with a details element inside, and the after button adjacent to invoker, using commandforelement:
- /html/semantics/popovers/popover-focus-5.html?imperative [wpt.fyi]
- Focusing elements inside a popover with a details element inside, and the after button adjacent to invoker, using imperative:
FAIL - Focusing elements inside a popover with custom-element with a slotted button, followed by a details element, where the after button is adjacent to the invoker, using imperative:
FAIL
- Focusing elements inside a popover with a details element inside, and the after button adjacent to invoker, using imperative:
- /html/semantics/popovers/popover-focus-inert-invoker.html [wpt.fyi]
- Popover focus navigation with an inert invoker:
FAIL
- Popover focus navigation with an inert invoker:
- /html/semantics/popovers/popover-focus-inside-shadow-dom.html [wpt.fyi]
- Focus behavior of popover elements inside shadow DOM:
FAIL
- Focus behavior of popover elements inside shadow DOM:
- /html/semantics/popovers/popover-focus-inside-slot.html [wpt.fyi]
- Focus behavior of popover elements inside slot:
FAIL
- Focus behavior of popover elements inside slot:
- /html/semantics/popovers/popover-light-dismiss-contextmenu.html [wpt.fyi]
- Popovers should not be light dismissed during contextmenu event.:
FAIL
- Popovers should not be light dismissed during contextmenu event.:
- /html/semantics/popovers/popover-light-dismiss-touch-scroll.html [wpt.fyi]
- Popovers should not be light dismissed when scrolling via touch.:
FAIL
- Popovers should not be light dismissed when scrolling via touch.:
- /html/semantics/popovers/popover-overlay.html [wpt.fyi]
- dialog.show() should not put popover dialog in top layer:
FAIL - dialog.showModal() should put popover dialog in top layer:
FAIL - dialog.showPopover() should put popover dialog in top layer:
FAIL - div.showPopover() should put popover div in top layer:
FAIL
- dialog.show() should not put popover dialog in top layer:
- /html/semantics/popovers/popover-anchor-nested-display.tentative.html [wpt.fyi]:
FAIL[Gecko-windows11-64-24h2-debug,Gecko-windows11-64-24h2-opt],PASS[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]
Description
•