Closed Bug 1382110 Opened 4 years ago Closed 2 years ago

Click event is not triggerable by button::after

Categories

(Core :: DOM: Events, defect, P3)

defect

Tracking

()

RESOLVED FIXED

People

(Reporter: rexboy, Unassigned)

References

Details

(Keywords: css2, Whiteboard: [webcompat:p3])

Attachments

(1 file)

See example:
https://jsfiddle.net/xzb031x0/3/

1. create a button and add onclick event listener
2. create an ::after element by css to that button
3. move ::after to an arbitrary position by "position: absolute" with "left:" and "top:"
4. try clicking on that after element

Expected:
  The onclick listener to the button should be triggered.
Actual:
  The onclick listener to the button is not triggered.


If I'm using a div rather than a button, the behavior above no longer exist. This seems to be confused and I'm not sure if this is intentional. In some cases we have to use button rather than workaround by using div.
Keywords: css2
Component: General → DOM: Events
Product: Firefox → Core
See Also: → 1383660
Maybe smaug knows what's up here?
Flags: needinfo?(bugs)
Priority: -- → P3
I don't even know which spec might hint the right behavior here.
Of course hit testing itself isn't spec'ed at all.

But this has been our behavior forever.
Flags: needinfo?(bugs)
Attached file testcase.html
Given that Edge, Chrome, and Safari all trigger click events in this test-case, and this is something that users are now noticing this on YouTube (see webcompat.com issue #13547), I think this is something we should address.
Flags: webcompat?
Whiteboard: [webcompat]
Setting to [webcompat:p3] since this affects functionality on Youtube.
Whiteboard: [webcompat] → [webcompat:p3]

This was fixed by Bug 1089326. \o/

(just marking as fixed, not a dupe. if someone cares, please change)

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Depends on: 1089326
You need to log in before you can comment on or make changes to this bug.