`mousemove` events for outside `<iframe>` are fired in the subdocument even if preceding `mousedown` in the subdocument is canceled
Categories
(Core :: DOM: Events, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox85 | --- | affected |
People
(Reporter: masayuki, Unassigned)
References
(Blocks 1 open bug)
Details
(Keywords: parity-chrome)
STR:
- Load data:text/html,<p>here is an iframe</p><iframe width=800 srcdoc="<span onmousedown=event.preventDefault()>Here prevents default of mousedown</span><br><span>Here does nothing</span><p></p><script>window.addEventListener('mousemove', event => {document.querySelector('p').textContent=
mousemove on ${event.target.nodeName}: ${event.clientX}, ${event.clientY}
}, true);</script>"><iframe> - Mousedown in "Here prevents default of mousedown".
- Keep pressing the mouse button and drag outside the
<iframe>
AR:
mousemove
events are fired on the document node of the subdocument.
ER:
I'm not sure from point of view of standards, but Chrome fires mousemove
events under the cursor (i.e., in the outer document).
This is different from this test:
https://searchfox.org/mozilla-central/rev/ffdb6a4d934b3f5294f18cf0e1df618109ccb36b/layout/base/tests/test_bug603550.html#91-99
But I think that the Chrome's behavior makes more sense.
What do you think smaug? (And Edgar?)
Reporter | ||
Comment 1•4 years ago
|
||
Let's check what happens if we change our behavior:
https://treeherder.mozilla.org/jobs?repo=try&resultStatus=testfailed%2Cbusted%2Cexception%2Csuccess%2Cusercancel%2Crunning%2Cpending%2Crunnable&revision=37fd8dadc77f95d4435fe1bc13926d8e742ad18c
Comment 2•4 years ago
|
||
I think Chrome's behavior makes sense.
I also tested Safari, Safari behaves the same as Chrome.
Comment 3•4 years ago
|
||
How do pointerevents work in other browsers? Thinking about implicit capture.
Reporter | ||
Comment 4•4 years ago
|
||
testcase for mouse events:
https://jsfiddle.net/d_toybox/5j1wpytu/17/
testcase for pointer events:
https://jsfiddle.net/d_toybox/5j1wpytu/19/
Same for both mouse events and pointer events. Both Blink and WebKit captures mouse/pointer events in target document, but if mousedown/pointerdown is canceled, they don't capture the events.
Updated•3 years ago
|
Comment 5•2 years ago
|
||
We have a feature in Canva to support dragging things from an iframe to outside, and it works by cancelling the initial mousedown
event within the iframe via preventDefault
, then setting the iframe’s pointer-events: none
, which allows the parent window to begin listening to mousemove
events to facilitate dragging.
This bug means that the feature doesn't work on Firefox. Any chance we can get this fixed? Is there any concern on masayuki's proposed change in comment 1?
Reporter | ||
Comment 6•2 years ago
|
||
Unfortunately, I don't have much time to work on this at least for a couple of weeks...
Any updates on this? Wondering what the timeline is in getting this fixed so that we don't need a workaround specifically in Firefox.
Reporter | ||
Comment 8•2 years ago
|
||
Nothing special. I'm not working on around events due to tons of editor work.
Reporter | ||
Comment 9•2 years ago
|
||
I don't remember the test results, I had patches:
- https://hg.mozilla.org/try/rev/526f12981bdaae7ba2f5893d7a5f4faef684667a
- https://hg.mozilla.org/try/rev/2e05dcf01db48fcaa8a8e32fa2c469a5274b0039
but the latter does not contain new test, so need to write it.
Description
•