Inconsistent popup-blocker behavior with document.addEventListener document.body.addEventListener onclick auxclick
Categories
(Core :: DOM: Events, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox68 | --- | fixed |
People
(Reporter: u598317, Assigned: Kwan)
References
(Regressed 1 open bug)
Details
(Keywords: dev-doc-complete)
Attachments
(6 files, 11 obsolete files)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
Updated•7 years ago
|
Comment 4•7 years ago
|
||
Updated•7 years ago
|
Comment 5•7 years ago
|
||
Comment 6•7 years ago
|
||
Comment 7•7 years ago
|
||
Comment 8•7 years ago
|
||
Reporter | ||
Comment 10•7 years ago
|
||
Comment 11•7 years ago
|
||
Reporter | ||
Comment 12•7 years ago
|
||
Comment 13•7 years ago
|
||
Comment 14•7 years ago
|
||
Reporter | ||
Comment 15•7 years ago
|
||
Comment 16•7 years ago
|
||
Comment 17•7 years ago
|
||
Updated•7 years ago
|
Comment 18•7 years ago
|
||
Comment 19•7 years ago
|
||
Comment 20•7 years ago
|
||
Comment 21•7 years ago
|
||
Updated•7 years ago
|
Reporter | ||
Comment 22•7 years ago
|
||
Updated•7 years ago
|
Assignee | ||
Comment 23•7 years ago
|
||
Assignee | ||
Comment 24•7 years ago
|
||
Assignee | ||
Comment 25•7 years ago
|
||
Assignee | ||
Comment 26•7 years ago
|
||
Assignee | ||
Comment 27•7 years ago
|
||
Assignee | ||
Comment 28•7 years ago
|
||
Assignee | ||
Comment 29•7 years ago
|
||
Updated•7 years ago
|
Comment 30•7 years ago
|
||
Comment 31•7 years ago
|
||
Comment 32•7 years ago
|
||
Comment 33•7 years ago
|
||
Comment 34•7 years ago
|
||
Assignee | ||
Comment 35•7 years ago
|
||
Assignee | ||
Comment 36•7 years ago
|
||
Assignee | ||
Comment 37•7 years ago
|
||
Assignee | ||
Comment 38•7 years ago
|
||
Assignee | ||
Comment 39•7 years ago
|
||
Assignee | ||
Comment 40•7 years ago
|
||
Assignee | ||
Updated•7 years ago
|
Comment 41•6 years ago
|
||
Comment hidden (off-topic) |
Comment hidden (off-topic) |
Comment 44•6 years ago
|
||
Updated•6 years ago
|
Updated•6 years ago
|
Assignee | ||
Comment 45•6 years ago
|
||
Enable synthesising explicit auxclicks, and check that synthesised and
non-synthesised auxclicks get isHandlingUserInput false and true respectively.
Assignee | ||
Comment 46•6 years ago
|
||
Assignee | ||
Comment 47•6 years ago
|
||
So it is still preventDefault()able once non-primary clicks aren't web visible.
Assignee | ||
Comment 48•6 years ago
|
||
Editable elements will no longer get click events for non-primary mouse buttons
since they are being unshipped from the web in favour of auxclick events.
Listen for auxclick as well so middle-click paste still works.
Don't stop propagation after middle-click paste, instead ignore clicks on
contenteditable elements in ClickHandlerChild.
Update test_middle_click_paste.html for the new behaviour.
Also remove the mNoContentDispatch overrides in HTMLInputElement and
HTMLTextAreaElement that were needed for middle-pasting.
Assignee | ||
Comment 49•6 years ago
|
||
It's against spec, and the auxclick event is now available and easier to use
(fired on all elements rather than just window/document and text fields)
Can't stop dispatching them entirely since frontend code is too reliant on it.
Don't fire dblclick for auxclick.
Mark wpt uievents/click/auxclick_event.html as passing
Update test_clipboard_events.html
Assignee | ||
Comment 50•6 years ago
|
||
So this seems to be causing more web compat problems now, e.g. instagram seems to implement its own middleclick handling for links (god knows why) which doesn't work in Fx atm because of this, and sheppy reported problems with zenhub
This currently has more behaviour changes than before though, since I also (think I) fixed middlemouse paste handling so it can be cancelled and doesn't need to stopPropagation
.
Probably needs more tests.
Seems reasonably green:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=1d10c2ecb8a50ef1a84cbc13e206d60e370ff74d
Comment 51•6 years ago
|
||
ok, this is now being fixed in other bug too...
I'll look at the patches tomorrow.
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 52•6 years ago
|
||
If needed for web-compat.
Also stop dispatching auxclicks if non-primary click has been preventDefaulted,
so that legacy new-tab prevention can work with the pref flip.
Assignee | ||
Comment 53•6 years ago
|
||
Thanks a lot smaug and masayuki!
Sheriffs, green try here:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=5f967c0c8be6cff65079f7b16a0188958db6aa68
I have an older one with macosx and Android as well here:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=36f06b268a3cc11cd0a9f624b7ff646506c9952b
which had a small bustage on linux debug M(cl) that was subsequently fixed.
Comment 54•6 years ago
|
||
Pushed by apavel@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/32d8c9a17e50
Add auxclick to mouse synthesis test code. r=smaug
https://hg.mozilla.org/integration/autoland/rev/8ff0d835d90b
Set EventPopupControlState of auxclick as 'openControlled'. r=smaug
https://hg.mozilla.org/integration/autoland/rev/4e152cfac89d
Use auxclick event to trigger new tab on middle click. r=smaug
https://hg.mozilla.org/integration/autoland/rev/273553e141f1
Make editor listen for auxclick mouse events. r=smaug,masayuki
https://hg.mozilla.org/integration/autoland/rev/0e9fa06f3fd8
Stop dispatching click events for non-primary mouse clicks on the web. r=smaug
https://hg.mozilla.org/integration/autoland/rev/23ff9cd1a1a4
Add override pref to restore legacy non-primary click dispatch on specific domains. r=smaug
Comment 55•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/32d8c9a17e50
https://hg.mozilla.org/mozilla-central/rev/8ff0d835d90b
https://hg.mozilla.org/mozilla-central/rev/4e152cfac89d
https://hg.mozilla.org/mozilla-central/rev/273553e141f1
https://hg.mozilla.org/mozilla-central/rev/0e9fa06f3fd8
https://hg.mozilla.org/mozilla-central/rev/23ff9cd1a1a4
Assignee | ||
Comment 56•6 years ago
|
||
Some rough notes for what needs documenting:
Firefox no longer dispatches to web content "click" events for buttons other than the left mouse button, following spec. Previously it would dispatch them just on the window global and the document object, and in <input> and <textarea> elements, but not on any other elements in the DOM tree. (So if you middle clicked on an <a> inside a <body>, neither the <a>, nor the <body>, nor the <html> would see the event, but the new tab could be blocked with a listener on the document or window).
Accordingly, new tab from middle click is now opened on the "auxclick" event (which is dispatched to the entire DOM tree), so developers need to use an "auxclick" instead of "click" event listener if they want to prevent new tabs. Developers are now also able to open new tabs/windows from "auxclick" event handlers (previously popup blocker blocked them).
The same is true for the middle-mouse paste feature (enabled by default on Linux, preffed-off on Windows and maxOS but I believe works when preffed-on). Middle mouse paste was the reason the editable <input> and <textarea> elements had the "click" carve-out, but it too now happens on the "auxclick" event. (middle mouse pasting also used to "eat"/stopPropagation of the "click" when pasting, so it couldn't be detected in bubbling, only capturing. "auxclick" pasting does bubble)
Per-spec, "dblclick" events are no longer dispatched for buttons other than the left button (it used to be dispatched to the same limited points of window/document/<input>/<textarea> for middle/right buttons).
Another behaviour change: middle-clicking a link in a designMode=on doc/contenteditable would open the link if middlemouse paste was off, otherwise it would paste text inside the link. Now it never opens the link (use right-click + context menu to do so).
I believe those are all the differences.
Comment 57•6 years ago
|
||
Any changes to "paste as quotation", even in FF, Ctrl+middle-mouse-click, with pref middlemouse.paste
set to true?
Assignee | ||
Comment 58•6 years ago
|
||
(In reply to Jorg K (GMT+2) from comment #57)
Any changes to "paste as quotation", even in FF, Ctrl+middle-mouse-click, with pref
middlemouse.paste
set to true?
Ah, thank you for asking again, I forgot about checking that. That has had the same changes as regular middle-mouse paste, also moving to "auxclick", and the event bubbles.
Comment 59•6 years ago
•
|
||
OK, but does it still work in FF? It's used to exercise some of the "paste as quotation" editor functions in FF.
Assignee | ||
Comment 60•6 years ago
|
||
Yes, I was testing in Firefox (assuming the expected result is "paste with '> ' prepended" in <textarea>, and "as <blockquote> element" in contentEditable).
Comment 61•6 years ago
|
||
Yep, that's it.
Updated•5 years ago
|
Comment 65•5 years ago
|
||
Documentation changes:
- Submitted BCD PR 4354; each of these events has a note now explaining the changes in Firefox 68.
- Noted on Firefox 68 for developers
Updated•5 years ago
|
Description
•