servoshell: Do not focus and raise new auxiliary WebDriver-created WebViews (#37284)

For Desktop port of `request_open_auxiliary_webview`, stay on the
original WebView if the request originates WebDriver.

This is to make sure `webdriver_server::handle_new_window` does not
focus the new window, according to spec. See
c7eba2dbba/tests/wpt/tests/webdriver/tests/classic/new_window/new_window.py (L31-L37)

**To clarify**: this won't change the behaviour when user interacts, but
only affects WebDriver [New
Window](https://w3c.github.io/webdriver/#new-window).

Testing: `./mach test-wpt -r --log-raw "D:/servo log/all.txt"
./tests/wpt/tests/webdriver/tests/classic --product servodriver` based
on 96b0973037

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
This commit is contained in:
Euclid Ye 2025-06-09 19:07:09 +08:00 committed by GitHub
parent 0fa3de3937
commit a3c792e5aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 76 additions and 158 deletions

View file

@ -79,6 +79,8 @@ fn find_node_by_unique_id(
match documents.find_document(pipeline) {
Some(doc) => find_node_by_unique_id_in_document(&doc, node_id),
None => {
// FIXME: This is unreacheable!! Because we already early return in Constellation
// To be Fixed soon
if ScriptThread::has_node_id(pipeline, &node_id) {
Err(ErrorStatus::StaleElementReference)
} else {