Bug 169415

Summary: MiniBrowser: a tab closed from javascript always closes the window
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Severity: Normal CC: bugs-noreply, lforschler
Priority: P2 Keywords: Gtk
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
Description Flags
Patch mcatanzaro: review+, mcatanzaro: commit-queue-

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>