Closed Bug 2039528 Opened 1 month ago Closed 1 month ago

[wpt-sync] Sync PR 59237 - Implement new/revised popover=hint behavior

Categories

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

task

Tracking

()

RESOLVED FIXED
152 Branch
Tracking Status
firefox152 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Mason Freed <masonf@chromium.org> wrote:

Implement new/revised popover=hint behavior

See this discussion for more context:

https://github.com/whatwg/html/issues/12304
https://github.com/whatwg/html/pull/12345

This CL implements a simplified behavioral model for popover=hint and
popover=auto, cleanly separating the autoRootedPopoverStack from the
hintRootedPopoverStack and introducing a hintStackParent to track
where the hint stack branches off the auto stack.

The new behavior resolves the following inconsistencies (gated behind
the PopoverHintNewBehavior experimental runtime flag):

  1. Opening a hint popover will not hide unrelated auto popovers.
  2. Opening a hint popover closes only other non-ancestor hint
    popovers.
  3. Clicking outside consistently closes both auto and hint popovers.
  4. Hiding an auto popover closes only its child popovers.
  5. Opening an auto popover inside a hint popover is disallowed and
    will fail.

A new WPT test (popover-hint-hierarchy.html) is added to explicitly
assert these 5 rules, and existing popover WPTs are updated to reflect
the new behavior. A virtual test suite (popover-hint-old-behavior)
is also added to continue testing the legacy behavior. I'm not sure
how to best handle the changed tests (and I guess the new test too)
in the context of a spec PR that is forthcoming. I'd like to be able
to publish (as a WPT PR at least) the changes, to help with the PR
effort. Suggestions appreciated.

A note about the diff: I made all of the feature flag checks look like
if (!feature enabled) { in the hopes that the old code would show
as unchanged in the diff, but gerrit's diff algorithm isn't great.
It's at least a little better like this than if I put the new code
first, so I left it.

Bug: 499019927
Change-Id: I41d8d96be71ba60ec5e7aa640c935258d1e33431
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7727959
Auto-Submit: Mason Freed \<masonf@chromium.org>
Reviewed-by: David Baron \<dbaron@chromium.org>
Commit-Queue: David Baron \<dbaron@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1615186}

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

CI Results

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

Total 4 tests and 6 subtests

Status Summary

Firefox

OK : 4
PASS: 25
FAIL: 17

Chrome

OK : 4
PASS: 37
FAIL: 5

Safari

OK : 4
PASS: 20
FAIL: 22

Links

GitHub PR Head
GitHub PR Base

Details

Firefox-only Failures

New Tests That Don't Pass

  • /html/semantics/popovers/popover-hint-hierarchy.html [wpt.fyi]
    • Opening a hint popover will not hide unrelated auto popovers.: FAIL (Chrome: PASS, Safari: PASS)
    • Opening a hint popover closes only other non-ancestor hint popovers.: FAIL (Chrome: PASS, Safari: FAIL)
    • Clicking outside consistently closes both auto and hint popovers.: FAIL (Chrome: PASS, Safari: FAIL)
    • Clicking outside consistently closes both auto and hint popovers (nested).: FAIL (Chrome: PASS, Safari: FAIL)
    • Hiding an auto popover closes only its child popovers.: FAIL (Chrome: PASS, Safari: FAIL)
    • Opening an auto popover inside a hint popover is disallowed and will fail.: FAIL (Chrome: PASS, Safari: FAIL)
  • /html/semantics/popovers/popover-light-dismiss-hint.html [wpt.fyi]
    • Auto cannot be nested inside hint (invalidauto1): FAIL (Chrome: PASS, Safari: FAIL)
    • Auto cannot be nested inside hint (invalidauto2): FAIL (Chrome: PASS, Safari: FAIL)
  • /html/semantics/popovers/popover-top-layer-nesting-hints.html [wpt.fyi]
    • Nested auto/hint ancestors, target is auto with dialog: FAIL (Chrome: FAIL, Safari: PASS)
    • Nested auto/hint ancestors, target is auto with fullscreen: FAIL (Chrome: FAIL, Safari: FAIL)
    • Unrelated hint, target=auto with dialog: FAIL (Chrome: FAIL, Safari: PASS)
    • Unrelated hint, target=auto with fullscreen: FAIL (Chrome: FAIL, Safari: FAIL)
  • /html/semantics/popovers/popover-types-with-hints.html [wpt.fyi]
    • manuals do not close popovers: FAIL (Chrome: PASS, Safari: PASS)
    • autos close hints but not manuals: FAIL (Chrome: PASS, Safari: FAIL)
    • If a popover=auto is shown, it should hide any open popover=hint, including if the popover=hint is an ancestral popover of the popover=auto. (You can't nest a popover=auto inside a popover=hint): FAIL (Chrome: PASS, Safari: FAIL)
    • If you: a) show a popover=auto (call it D), then b) show a descendent popover=hint of D (call it T), then c) hide D, then T should be hidden. (A popover=hint can be nested inside a popover=auto): FAIL (Chrome: PASS, Safari: FAIL)
    • If you: a) show a popover=auto (call it D), then b) show a non-descendent popover=hint of D (call it T), then c) hide D, then T should not be hidden. (Non-nested popover=hint are not hidden when unrelated popover=autos are hidden): FAIL (Chrome: PASS, Safari: PASS)
Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 152 Branch
You need to log in before you can comment on or make changes to this bug.