Closed Bug 1529036 Opened 6 years ago Closed 6 years ago

Buttons don't receive mouse events from overflowing in-flow descendants

Categories

(Core :: Layout: Form Controls, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla67
Tracking Status
firefox67 --- fixed

People

(Reporter: dholbert, Assigned: MatsPalmgren_bugz)

References

Details

Attachments

(3 files)

STR:

  1. Load attached testcase
  2. Click some of the text that's outside the button.

EXPECTED RESULTS:
Button should receive the click and an alert should appear.

ACTUAL RESULTS:
Button does not receive the click; nothing happens.

Chrome gives EXPECTED RESULTS.
Firefox Nightly 67.0a1 (2019-02-19) gives ACTUAL RESULTS.

(Note: if I make the overflowing content 'position:absolute', then I get EXPECTED RESULTS -- at least, I do as of bug 1089326 which fixed this case for abspos stuff.)

I think this may've been something that we overlooked in bug 1089326's fix (unless this was a case that we intentionally exempted for some reason?)

Flags: needinfo?(bugs)
Attachment #9044996 - Attachment description: testcase 1 → testcase 1: in-flow descendants' overflowing area isn't clickable
Attachment #9044996 - Attachment filename: test.html → test1.html

The same thing happens if I make a descendant overflow by relatively positioning it -- the button doesn't receive its click events.

(Though if I absolutely position it, then the button does receive click events. Attachment 8946239 [details] is a larger testcase that shows the difference between those two behaviors.)

Sounds like some hit testing issue then. It is using display list creation.

Component: DOM: Events → Layout
Flags: needinfo?(bugs)
Component: Layout → Layout: Form Controls

Yeah, looks like that was introduced in bug 1111995. Mats, would making the button anon box inherit border-radius be a better solution instead of clipping?

Blocks: 1111995
Flags: needinfo?(mats)

Hmm, though maybe that's not all, bug 770106 also looks relevant.

Attached patch fix+test (deleted) — Splinter Review
Assignee: nobody → mats
Attachment #9046278 - Flags: review?(emilio)
Comment on attachment 9046278 [details] [diff] [review] fix+test Review of attachment 9046278 [details] [diff] [review]: ----------------------------------------------------------------- Makes sense, thanks for fixing this :) ::: layout/forms/test/test_bug1529036.html @@ +28,5 @@ > + e.addEventListener('click', function(event) { > + ++clicks; > + }); > + } > + nit: Whitespace.
Attachment #9046278 - Flags: review?(emilio) → review+
Pushed by mpalmgren@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/f36ad4139437 Clip <button> to its border area for event hit testing, but not its children. r=emilio
Flags: in-testsuite+
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: