A new tab opened with "WebDriver:NewWindow" doesn't get focus when switched to
Categories
(Remote Protocol :: Marionette, defect, P1)
Tracking
(firefox109 fixed)
| Tracking | Status | |
|---|---|---|
| firefox109 | --- | fixed |
People
(Reporter: whimboo, Assigned: whimboo)
References
Details
(Whiteboard: [webdriver:m5], [wptsync upstream], [webdriver:relnote] )
Attachments
(2 files, 1 obsolete file)
With bug 1533058 we are able to create a new tab with about:blank now. But as discovered in bug 1522790 the focus isn't correctly set to for the content browser when using this.window.BrowserOpenTab(). This is most likely the case because it operates on a chrome scope level compared to window.open() that runs in content.
As such we should make sure to explicitly focus the content browser in Switch To Window if one is present.
| Assignee | ||
Comment 1•3 years ago
|
||
Here a try build for Linux only with James' patch from bug 1522790:
https://treeherder.mozilla.org/jobs?repo=try&revision=8e0478fe68b727f0f50bdd7f8450feb88010fd9e
| Assignee | ||
Comment 2•3 years ago
|
||
Updated•3 years ago
|
| Assignee | ||
Comment 3•3 years ago
|
||
| Assignee | ||
Comment 4•3 years ago
|
||
The fix here has actually to be located in WebDriver:SwitchToWindow given that with WebDriver:NewWindow we will get a new window but by default it's not the selected one by the driver. Only switching to that new window can actually perform a focus.
Updated•3 years ago
|
Comment 5•3 years ago
|
||
The severity field is not set for this bug.
:whimboo, could you have a look please?
For more information, please visit auto_nag documentation.
| Assignee | ||
Comment 6•3 years ago
|
||
The underlying problem here is actually a race condition which is related to the call to focus() for an element. The affected tests do not actually wait for the focus to be on the element and as such if the window isn't focused yet will fail. Reason is that focus() doesn't await the focus of the window. Mochitests specifically have a promiseFocus helper to make it easier for tests.
Nevertheless I assume that when a new tab gets opened in the foreground the content should get the focus similar to window.open(). We can put a workaround for now and hope that with bug 1795841 this will be fixed when we will use gBrowser.addTab() directly.
I'll attach a wdspec test for New Window for both type tab and window.
| Assignee | ||
Comment 7•3 years ago
|
||
Depends on D161028
| Assignee | ||
Updated•3 years ago
|
Comment 10•3 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/032cab48a165
https://hg.mozilla.org/mozilla-central/rev/2781784fdc50
Updated•3 years ago
|
Updated•3 years ago
|
Description
•