Closed Bug 1431804 Opened 2 years ago Closed 2 years ago

Buttons don't receive clicks on overflowing pieces of descendants


(Core :: Layout, defect, P3)

57 Branch





(Reporter: dholbert, Unassigned)


(Whiteboard: [webcompat])


(2 files)

Attached file testcase 1
 1. Load testcase.
 2. Click the purple area, *outside the bounds* of the black-bordered rect.

EXPECTED RESULTS: An alert should show up.
ACTUAL RESULTS: No alert shows up (i.e. the container didn't receive the click)
Attached file reference case 1
Here's a reference case, which only differs from the testcase in that it's got a <div> instead of a <button>.  It gives "expected results".  Hence, this seems to be a button-specific quirk.
Comparison to other engines:
 * Edge 16, Chrome 65, and Opera (latest as well as 12.15 Presto) all give EXPECTED RESULTS.
 * Safari 11 clips the overflowing element at the button-boundary, so it's not possible to perform step 2 there.
 * Firefox (release 57 & nightly 59) gives ACTUAL RESULTS.

So we're alone in our behavior here (and our behavior does seem broken, when compared to the reference case).

(This is the root cause of - that's what prompted this bug report.)
Whiteboard: [webcompat]
(CC :smaug in case he has any knowledge about this from a DOM/Event-targeting perspective)
Summary: Buttons don't receive clicks on overflowing elements → Buttons don't receive clicks on overflowing pieces of descendants
(Just wondering, shouldn't this be handled by display list?)
[ Triage 2017/02/20: P3 ]
Priority: -- → P3
(In reply to Xidorn Quan [:xidorn] UTC+10 from comment #4)
> (Just wondering, shouldn't this be handled by display list?)

Hit-testing is indeed done via a display list, and it's entirely possible that the bug lies in that code somewhere. (But the difference between <button> vs. other elements is interesting & indicates that there's something subtle & button-specific here.)
FWIW something I learnt while digging into some loosely related code is that buttons have custom display-list building code for event delivery:

Which is probably related here.
Closed: 2 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1089326
You need to log in before you can comment on or make changes to this bug.