Bug 172770 - [GTK] MiniBrowser's browser_window_get_or_create_web_view_for_automation never creates new windows
Summary: [GTK] MiniBrowser's browser_window_get_or_create_web_view_for_automation neve...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Adrian Perez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-31 12:26 PDT by Adrian Perez
Modified: 2017-05-31 13:10 PDT (History)
5 users (show)

See Also:


Attachments
Patch (1.67 KB, patch)
2017-05-31 12:29 PDT, Adrian Perez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian Perez 2017-05-31 12:26:59 PDT
Building with Clang 4.0.0 the compiler found this issue:

  ../../Tools/MiniBrowser/gtk/BrowserWindow.c:1175:108: warning: if statement has empty body [-Wempty-body]
      if (gtk_notebook_get_n_pages(GTK_NOTEBOOK(window->notebook)) == 1 && !webkit_web_view_get_uri(webView));
                                                                                                             ^
  ../../Tools/MiniBrowser/gtk/BrowserWindow.c:1175:108: note: put the semicolon on a separate line to silence this warning

The code around this line is, roughly:

    BrowserWindow *window = (BrowserWindow *)windowList->data;
    WebKitWebView *webView = browser_tab_get_web_view(window->activeTab);
    if (gtk_notebook_get_n_pages(GTK_NOTEBOOK(window->notebook)) == 1 && !webkit_web_view_get_uri(webView));
        return webView;

    // Create and return a new web view
    ...

Due to the semicolon in the line containing the conditional, “return webView” in the
following line is always executed, and therefore a new web view is never created.
Comment 1 Adrian Perez 2017-05-31 12:29:51 PDT
Created attachment 311618 [details]
Patch
Comment 2 WebKit Commit Bot 2017-05-31 13:10:55 PDT
Comment on attachment 311618 [details]
Patch

Clearing flags on attachment: 311618

Committed r217620: <http://trac.webkit.org/changeset/217620>
Comment 3 WebKit Commit Bot 2017-05-31 13:10:56 PDT
All reviewed patches have been landed.  Closing bug.