Bug 169415 - MiniBrowser: a tab closed from javascript always closes the window
Summary: MiniBrowser: a tab closed from javascript always closes the window
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
Keywords: Gtk
Depends on:
Reported: 2017-03-09 08:41 PST by Carlos Garcia Campos
Modified: 2017-03-13 02:16 PDT (History)
2 users (show)

See Also:

Patch (2.61 KB, patch)
2017-03-09 08:46 PST, Carlos Garcia Campos
mcatanzaro: review+
mcatanzaro: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2017-03-09 08:41:55 PST
When I implemented tabs support in MiniBroser I forgot about web view close. We connect to the signal (only for the active tab) and close the window. That worked when we didn't have tabs, but now we should close the tab o the window if it's the last tab.
Comment 1 Carlos Garcia Campos 2017-03-09 08:46:14 PST
Created attachment 303922 [details]
Comment 2 Michael Catanzaro 2017-03-10 07:35:06 PST
Comment on attachment 303922 [details]

View in context: https://bugs.webkit.org/attachment.cgi?id=303922&action=review

> Tools/MiniBrowser/gtk/BrowserWindow.c:268
> +    for (int i = 0; i < tabsCount; ++i) {

It fails with GCC 4.9:

../../Tools/MiniBrowser/gtk/BrowserWindow.c: In function 'webViewClose':
../../Tools/MiniBrowser/gtk/BrowserWindow.c:268:5: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
../../Tools/MiniBrowser/gtk/BrowserWindow.c:268:5: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code

Maybe we should specify --std=c11 for compiling MiniBrowser, since that's clearly what we are all using.
Comment 3 Carlos Garcia Campos 2017-03-13 02:16:05 PDT
Committed r213789: <http://trac.webkit.org/changeset/213789>