window.open() windows created from a mousedown handler immediately lose focus
Categories
(Core :: DOM: UI Events & Focus Handling, defect)
Tracking
()
People
(Reporter: miketaylr, Assigned: emilio)
References
(Regression, )
Details
(Keywords: regression)
Attachments
(2 files)
I'm not sure where this should live, so please move to the right place!
STR:
- visit https://miketaylr.com/bzla/vega.html
- click on "mousedown" to open a new window/tab
- allow the popup, and click again
Expected:
The new tab is focused (it says via mousedown
)
Actual:
The new tab opens, then focus jumps back to the original tab
Note: mouseup
and click
result in expected behavior.
I discovered this while investigating a library which uses mousedown
to open new windows, https://github.com/vega/vega-embed/blob/ed326f48996dbb3c3fb8f0a4517f0523afa123be/src/embed.ts#L390-L402
Updated•5 years ago
|
Comment 1•5 years ago
|
||
I can reproduce the issue on Nightly77.0a1 Winmdows10.
Regression Window:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=ebb28cae3bc2c3249af72d85893a6e0913e4c5fc&tochange=d12917561f27e4c4b4808707b55e88973dc4a385
Assignee | ||
Comment 2•5 years ago
|
||
Hrrmmm... Will take a look, over to the queue.
Thanks for finding the regression range Alice, you rock.
Assignee | ||
Comment 3•5 years ago
|
||
So this is basically because of this chunk of code.
I suspect this is to change the focused window on click, but it doesn't really make sense if you're in different tabs or what not... But maybe even then we don't want to do it and we want to rely on the OS? Hmpf.
Assignee | ||
Comment 4•5 years ago
|
||
This seems to come from bug 618907, which seems to be a hack-around code that went away in bug 1595435.
Assignee | ||
Comment 5•5 years ago
|
||
Assignee | ||
Comment 6•5 years ago
|
||
This seems to come from bug 618907, which seems to be a hack-around code
that went away in bug 1595435.
If we open a window on mousedown such as it gains focus before this code
runs, we just steal the focus from it, which is undesired.
Also remove the test for bug 799299. It doesn't work anyways if the
browser is remote (this test only runs on non-e10s mode), and this
unifies the behavior with e10s and with content (see attached test-case,
which doesn't change behavior with and without my patch).
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Updated•4 years ago
|
Comment 8•4 years ago
|
||
Backed out for mochitest failures on test_focus.xhtml
Backout link: https://hg.mozilla.org/integration/autoland/rev/9b05570242cbddc9743b5236c2e5872d8c71876d
Log link: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=301006293&repo=autoland&lineNumber=109346
Assignee | ||
Updated•4 years ago
|
Comment 10•4 years ago
|
||
bugherder |
Comment 11•4 years ago
|
||
We have this bug since 69 and no priority set so I guess the fix can ship with 78.
Description
•