Label does not re-dispatch click event from image to target
Categories
(Core :: DOM: Events, defect, P5)
Tracking
()
People
(Reporter: vhilla, Unassigned)
References
(Blocks 1 open bug)
Details
Nightly Version 118.0a1 (2023-08-06) (64-bit), Ubuntu
Steps to reproduce
- Open this test case
data:text/html,
<label>
<button onclick="alert('clicked')">btn</button>
<image ismap src="https://upload.wikimedia.org/wikipedia/commons/6/66/SMPTE_Color_Bars.svg">
</label>
- Click somewhere within the image
Expected behavior
An alert opens because the label activates the button
Actual behavior
Nothing happens
Reason
HTMLImageElement::GetEventTargetParent
sets mMultipleActionsPrevented
thereby preventing not only links from submitting (as intended) but also other elements with activation behavior from triggering.
Possible solutions might be
Reporter | ||
Comment 1•8 months ago
|
||
I can imagine that there are also cases where the a
element doesn't become activation target, i.e. link should not be triggered but still is, as nsImageFrame does this regardless of who is activation target. Maybe we should adopt the approach around HTMLInputElement
with type=image
where the frame stores the last clicked point in a property on the input element, see here.
Reporter | ||
Updated•8 months ago
|
Description
•