Bug 126354 - [GTK][WK2] Back items are shown in reverse order in MiniBrowser
Summary: [GTK][WK2] Back items are shown in reverse order in MiniBrowser
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: ChangSeok Oh
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-31 20:51 PST by ChangSeok Oh
Modified: 2014-01-01 05:31 PST (History)
4 users (show)

See Also:


Attachments
Patch (3.02 KB, patch)
2013-12-31 21:11 PST, ChangSeok Oh
no flags Details | Formatted Diff | Diff
Patch (2.97 KB, patch)
2013-12-31 22:20 PST, ChangSeok Oh
no flags Details | Formatted Diff | Diff
Patch (3.01 KB, patch)
2013-12-31 22:29 PST, ChangSeok Oh
no flags Details | Formatted Diff | Diff
Patch (2.19 KB, patch)
2014-01-01 04:36 PST, ChangSeok Oh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ChangSeok Oh 2013-12-31 20:51:26 PST
SSIA.
Comment 1 ChangSeok Oh 2013-12-31 21:11:35 PST
Created attachment 220174 [details]
Patch
Comment 2 WebKit Commit Bot 2013-12-31 21:13:45 PST
Attachment 220174 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Tools/ChangeLog', u'Tools/MiniBrowser/gtk/BrowserWindow.c', '--commit-queue']" exit_code: 1
ERROR: Tools/MiniBrowser/gtk/BrowserWindow.c:235:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
ERROR: Tools/MiniBrowser/gtk/BrowserWindow.c:240:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Total errors found: 2 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 ChangSeok Oh 2013-12-31 21:15:19 PST
(In reply to comment #2)
> Attachment 220174 [details] did not pass style-queue:
> 
> Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Tools/ChangeLog', u'Tools/MiniBrowser/gtk/BrowserWindow.c', '--commit-queue']" exit_code: 1
> ERROR: Tools/MiniBrowser/gtk/BrowserWindow.c:235:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
> ERROR: Tools/MiniBrowser/gtk/BrowserWindow.c:240:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
> Total errors found: 2 in 2 files
> 
> 
> If any of these errors are false positives, please file a bug against check-webkit-style.

A false positives, I didn't change the indentations.
Comment 4 Martin Robinson 2013-12-31 22:05:53 PST
Comment on attachment 220174 [details]
Patch

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

> Tools/MiniBrowser/gtk/BrowserWindow.c:199
> +static GtkWidget *browserWindowCreateBackForwardMenu(BrowserWindow *window, GList *list, gboolean back)

I think that reverseMenuItemOrder might be a better name for this variable.

> Tools/MiniBrowser/gtk/BrowserWindow.c:235
> -                                  browserWindowCreateBackForwardMenu(window, list));
> +                                  browserWindowCreateBackForwardMenu(window, list, true));

The indentation was wrong here before, please fix it when you change this line.

> Tools/MiniBrowser/gtk/BrowserWindow.c:240
> -                                  browserWindowCreateBackForwardMenu(window, list));
> +                                  browserWindowCreateBackForwardMenu(window, list, false));

Ditto.
Comment 5 ChangSeok Oh 2013-12-31 22:20:44 PST
Created attachment 220176 [details]
Patch
Comment 6 ChangSeok Oh 2013-12-31 22:29:38 PST
Created attachment 220177 [details]
Patch
Comment 7 ChangSeok Oh 2013-12-31 22:30:43 PST
Comment on attachment 220174 [details]
Patch

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

>> Tools/MiniBrowser/gtk/BrowserWindow.c:199
>> +static GtkWidget *browserWindowCreateBackForwardMenu(BrowserWindow *window, GList *list, gboolean back)
> 
> I think that reverseMenuItemOrder might be a better name for this variable.

Done.

>> Tools/MiniBrowser/gtk/BrowserWindow.c:235
>> +                                  browserWindowCreateBackForwardMenu(window, list, true));
> 
> The indentation was wrong here before, please fix it when you change this line.

O.K no problem.

>> Tools/MiniBrowser/gtk/BrowserWindow.c:240
>> +                                  browserWindowCreateBackForwardMenu(window, list, false));
> 
> Ditto.

Done.
Comment 8 Carlos Garcia Campos 2014-01-01 04:13:20 PST
Comment on attachment 220177 [details]
Patch

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

> Tools/MiniBrowser/gtk/BrowserWindow.c:199
> +static GtkWidget *browserWindowCreateBackForwardMenu(BrowserWindow *window, GList *list, gboolean reverseMenuItemOrder)

Use bool here instead of gboolean, you are indeed passing true/false not TRUE/FALSE.

> Tools/MiniBrowser/gtk/BrowserWindow.c:235
>      GList *list = webkit_back_forward_list_get_back_list_with_limit(backForwadlist, 10);
>      gtk_menu_tool_button_set_menu(GTK_MENU_TOOL_BUTTON(window->backItem),
> -                                  browserWindowCreateBackForwardMenu(window, list));
> +        browserWindowCreateBackForwardMenu(window, list, true));

I think it would be easier to revert the back list, so that you don't need any change in browserWindowCreateBackForwardMenu nor the boolean parameter.

GList *list = g_list_reverse(webkit_back_forward_list_get_back_list_with_limit(backForwadlist, 10));
Comment 9 ChangSeok Oh 2014-01-01 04:35:46 PST
Comment on attachment 220177 [details]
Patch

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

>> Tools/MiniBrowser/gtk/BrowserWindow.c:235
>> +        browserWindowCreateBackForwardMenu(window, list, true));
> 
> I think it would be easier to revert the back list, so that you don't need any change in browserWindowCreateBackForwardMenu nor the boolean parameter.
> 
> GList *list = g_list_reverse(webkit_back_forward_list_get_back_list_with_limit(backForwadlist, 10));

Agree. It looks more elegant. Thanks
Comment 10 ChangSeok Oh 2014-01-01 04:36:06 PST
Created attachment 220184 [details]
Patch
Comment 11 WebKit Commit Bot 2014-01-01 05:31:30 PST
Comment on attachment 220184 [details]
Patch

Clearing flags on attachment: 220184

Committed r161187: <http://trac.webkit.org/changeset/161187>
Comment 12 WebKit Commit Bot 2014-01-01 05:31:32 PST
All reviewed patches have been landed.  Closing bug.