Browse Source

WebDriver: Do not activate tabs created by the New Window endpoint

The spec states that creating new windows "must be done without invoking
the focusing steps for the created browsing context". It also states we
should do so by "running the window open steps", but nowhere in those
steps is there an option to invoke or skip any focusing steps. So we do
so with a custom WebContent IPC parameter.
Timothy Flynn 2 years ago
parent
commit
a77daf77bd
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Userland/Services/WebContent/WebDriverConnection.cpp

+ 1 - 1
Userland/Services/WebContent/WebDriverConnection.cpp

@@ -567,7 +567,7 @@ Messages::WebDriverClient::NewWindowResponse WebDriverConnection::new_window(Jso
     //    created browsing context should be in a new OS window. In all other cases the details of how the browsing
     //    created browsing context should be in a new OS window. In all other cases the details of how the browsing
     //    context is presented to the user are implementation defined.
     //    context is presented to the user are implementation defined.
     // FIXME: Reuse code of window.open() instead of calling choose_a_browsing_context
     // FIXME: Reuse code of window.open() instead of calling choose_a_browsing_context
-    auto [browsing_context, window_type] = m_page_client.page().top_level_browsing_context().choose_a_browsing_context("_blank"sv, true);
+    auto [browsing_context, window_type] = m_page_client.page().top_level_browsing_context().choose_a_browsing_context("_blank"sv, true, Web::HTML::ActivateTab::No);
 
 
     // 6. Let handle be the associated window handle of the newly created window.
     // 6. Let handle be the associated window handle of the newly created window.
     auto handle = browsing_context->window_handle();
     auto handle = browsing_context->window_handle();