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
(Blocks 2 open bugs)
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•2 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•2 years ago
|
||
Updated•2 years ago
|
Assignee | ||
Comment 3•2 years ago
|
||
Assignee | ||
Comment 4•2 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•2 years ago
|
Comment 5•2 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•2 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•2 years ago
|
||
Depends on D161028
Assignee | ||
Updated•2 years ago
|
Pushed by hskupin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/032cab48a165 [marionette] "WebDriver:SwitchToWindow" has to focus content browser if present. r=webdriver-reviewers,jgraham,jdescottes https://hg.mozilla.org/integration/autoland/rev/2781784fdc50 [wdspec] Add tests for "New Window" command to ensure that focus is set to content. r=webdriver-reviewers,jdescottes
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/37192 for changes under testing/web-platform/tests
Comment 10•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/032cab48a165
https://hg.mozilla.org/mozilla-central/rev/2781784fdc50
Upstream PR merged by moz-wptsync-bot
Updated•2 years ago
|
Updated•2 years ago
|
Description
•