Changeset 234915 in webkit


Ignore:
Timestamp:
Aug 16, 2018 1:15:54 AM (6 years ago)
Author:
Carlos Garcia Campos
Message:

[GTK] MiniBrowser: web view doesn't get the focus when new window is created
https://bugs.webkit.org/show_bug.cgi?id=188546

Reviewed by Michael Catanzaro.

Tools:

When a new window is created, the first widget of the windo is getting the focus, the toolbar in this case. We
always want the WebView to grab the focus. In case of new empty tab, we want to the URL bar to be focused
instead. This was causing failures in WebDriver tests that create a popup window with an input element that is
filled with send keys command. The input element is marked as focused in the DOM, but the actual focused widget
is the toolbar, so key events are sent to the toolbar instead of the web view.

  • MiniBrowser/gtk/BrowserWindow.c:

(webViewCreate):
(newTabCallback):
(openPrivateWindow):
(browser_window_get_or_create_web_view_for_automation):

WebDriverTests:

Remove expectations of the tests that pass now.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r234914 r234915  
     12018-08-16  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] MiniBrowser: web view doesn't get the focus when new window is created
     4        https://bugs.webkit.org/show_bug.cgi?id=188546
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        When a new window is created, the first widget of the windo is getting the focus, the toolbar in this case. We
     9        always want the WebView to grab the focus. In case of new empty tab, we want to the URL bar to be focused
     10        instead. This was causing failures in WebDriver tests that create a popup window with an input element that is
     11        filled with send keys command. The input element is marked as focused in the DOM, but the actual focused widget
     12        is the toolbar, so key events are sent to the toolbar instead of the web view.
     13
     14        * MiniBrowser/gtk/BrowserWindow.c:
     15        (webViewCreate):
     16        (newTabCallback):
     17        (openPrivateWindow):
     18        (browser_window_get_or_create_web_view_for_automation):
     19
    1202018-08-16  Carlos Garcia Campos  <cgarcia@igalia.com>
    221
  • trunk/Tools/MiniBrowser/gtk/BrowserWindow.c

    r234844 r234915  
    339339    GtkWidget *newWindow = browser_window_new(GTK_WINDOW(window), window->webContext);
    340340    browser_window_append_view(BROWSER_WINDOW(newWindow), newWebView);
     341    gtk_widget_grab_focus(GTK_WIDGET(newWebView));
    341342    g_signal_connect(newWebView, "ready-to-show", G_CALLBACK(webViewReadyToShow), newWindow);
    342343    g_signal_connect(newWebView, "run-as-modal", G_CALLBACK(webViewRunAsModal), newWindow);
     
    529530        "is-controlled-by-automation", webkit_web_view_is_controlled_by_automation(webView),
    530531        NULL)));
     532    gtk_widget_grab_focus(window->uriEntry);
    531533    gtk_notebook_set_current_page(GTK_NOTEBOOK(window->notebook), -1);
    532534}
     
    549551    GtkWidget *newWindow = browser_window_new(GTK_WINDOW(window), window->webContext);
    550552    browser_window_append_view(BROWSER_WINDOW(newWindow), newWebView);
     553    gtk_widget_grab_focus(GTK_WIDGET(newWebView));
    551554    gtk_widget_show(GTK_WIDGET(newWindow));
    552555}
     
    12341237        NULL));
    12351238    browser_window_append_view(window, newWebView);
     1239    gtk_widget_grab_focus(GTK_WIDGET(newWebView));
    12361240    return newWebView;
    12371241}
  • trunk/WebDriverTests/ChangeLog

    r234841 r234915  
     12018-08-16  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] MiniBrowser: web view doesn't get the focus when new window is created
     4        https://bugs.webkit.org/show_bug.cgi?id=188546
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        Remove expectations of the tests that pass now.
     9
     10        * TestExpectations.json:
     11
    1122018-08-14  Carlos Garcia Campos  <cgarcia@igalia.com>
    213
  • trunk/WebDriverTests/TestExpectations.json

    r234841 r234915  
    479479        }
    480480    },
    481     "imported/w3c/webdriver/tests/back/back.py": {
    482         "subtests": {
    483             "test_dismissed_beforeunload": {
    484                 "expected": {"all": {"status": ["TIMEOUT"], "bug": "webkit.org/b/188546"}}
    485             }
    486         }
    487     },
    488481    "imported/w3c/webdriver/tests/close_window/close.py": {
    489482        "subtests": {
    490483            "test_close_last_browsing_context": {
    491484                "expected": {"gtk": {"status": ["FAIL", "PASS"], "bug": "webkit.org/b/188118"}}
    492             },
    493             "test_close_browsing_context_with_dismissed_beforeunload_prompt": {
    494                 "expected": {"all": {"status": ["TIMEOUT"], "bug": "webkit.org/b/188546"}}
    495485            }
    496486        }
     
    608598        }
    609599    },
    610     "imported/w3c/webdriver/tests/forward/forward.py": {
    611         "subtests": {
    612             "test_dismissed_beforeunload": {
    613                 "expected": {"all": {"status": ["TIMEOUT"], "bug": "webkit.org/b/188546"}}
    614             }
    615         }
    616     },
    617600    "imported/w3c/webdriver/tests/element_send_keys/events.py": {
    618601        "subtests": {
Note: See TracChangeset for help on using the changeset viewer.