Closed Bug 1761839 Opened 3 years ago Closed 3 years ago

Clicking on a dialog backdrop selects everything inside the dialog

Categories

(Core :: DOM: Core & HTML, defect)

Firefox 100
defect

Tracking

()

VERIFIED FIXED
100 Branch
Tracking Status
firefox-esr91 --- disabled
firefox98 --- wontfix
firefox99 --- wontfix
firefox100 --- verified

People

(Reporter: hi, Assigned: emilio)

References

Details

Attachments

(2 files)

Steps to reproduce:

Create a <dialog> and use the .showModal() method to open it. When it is open, click anywhere on the backdrop (anywhere outside the dialog itself).

Actual results:

When you click on the backdrop, it causes everything inside the dialog to be selected.

Example here: https://codepen.io/kevinpowell/pen/ZEvKgyN

Expected results:

Clicking outside the dialog itself should result in nothing happening.

You can force this by declaring ::backdrop { pointer-events: none } in CSS, but that shouldn't be required.

I can reproduce the issue in Nightly100.0a1 Wundows10.
And I can also reproduce the issue in 91.7esr when set dom.dialog_element.enabled to true.

Status: UNCONFIRMED → NEW
Component: Untriaged → DOM: UI Events & Focus Handling
Ever confirmed: true
Product: Firefox → Core
Component: DOM: UI Events & Focus Handling → DOM: Selection
Blocks: 1733536
Component: DOM: Selection → DOM: Core & HTML
Assignee: nobody → emilio

Our selection code doesn't deal too well with pseudo frames in the top
layer. This prevents the bad interaction.

Instead of enforcing it in C++ use a UA rule instead, so that authors
can override it if needed.

Depends on D142582

Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ad790a1f6c5f Prevent undesired interactions between backdrop and selection. r=sefeng https://hg.mozilla.org/integration/autoland/rev/bb6c65e9df92 Allow user-select: none to override modal dialog selectability. r=sefeng
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/33459 for changes under testing/web-platform/tests
Upstream PR merged by moz-wptsync-bot
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 100 Branch
Flags: qe-verify+

I was able to reproduce the issue without the fix on Ubuntu 20.4 using build 100.0a1(20220330214842)
Verified as fixed on Ubuntu20.4/ Mac 10.13/ Win10 using build 100.0b5(20220412185818).

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: