NEW283392
[GTK] MiniBrowser does not focus the tabs when asked via WebDriver
https://bugs.webkit.org/show_bug.cgi?id=283392
Summary [GTK] MiniBrowser does not focus the tabs when asked via WebDriver
Carlos Alberto Lopez Perez
Reported 2024-11-19 18:37:50 PST
This is related to bug 281747 Digging into that issue I have discovered that WebKitGTK MiniBrowser does not focus a new opened tab when requested. I attach a test program that basically does this: 1. Start MiniBrowser via WebDriver 2. Navigate to wpewebkit.org 3. Open a new tab 4. Switch that tab to be the active window handler 5. Navigate on that new tab to webkitgtk.org Expected behavior: the new opened tab is visible and you can see webkitgtk.org Current behavior: the new opened tab is keept on the background and it loads webkitgtk.org but is never focused This test program can be also used with the wpewebkit minibrowser and there the behavior is the one expected (likely because there are no support for tab) and with chrome and it behaves as expected In order to run this test program you first have to start the corresponding driver (WebKitWebDriver, WPEWebDriver or chromedriver) on port 4444 And then run the test program. The program also prints debug information about the current status of the active page. In the case of WebKitGTK MiniBrowser the visibility for the new tab is "hidden" meanwhile that for the other browsers is "visible"
Attachments
Test program to reproduce the problem (5.01 KB, text/plain)
2024-11-19 18:38 PST, Carlos Alberto Lopez Perez
no flags
Carlos Alberto Lopez Perez
Comment 1 2024-11-19 18:38:55 PST
Created attachment 473282 [details] Test program to reproduce the problem Test program to reproduce the problem
Carlos Alberto Lopez Perez
Comment 2 2024-11-19 19:13:26 PST
Note that the new tab should not be made the active tab when created (point 3. above), but when it is requested to make it the active window handler (point 4. above) On point 3. it should be created on the background like it currently happens.
Carlos Garcia Campos
Comment 3 2024-11-19 22:34:16 PST
Good catch! So, we end up calling gtk_widget_grab_focus() on the view associated with the window handle. I guess that's not enough to make the tab active. I'll check but maybe we need to add API for this.
Michael Catanzaro
Comment 4 2024-11-20 06:46:46 PST
I guess something similar to `WebKitWebView::ready-to-show`, but with a different name, might work?
Carlos Alberto Lopez Perez
Comment 5 2024-12-11 14:02:05 PST
Meanwhile this is not fixed I workarounded the issue on the WPT-side by reverting back to open the tests in new windows for WebKitGTK-based browsers. Ref: https://github.com/web-platform-tests/wpt/pull/49529
Note You need to log in before you can comment on or make changes to this bug.