RESOLVED FIXED 73773
[WK2][GTK] WebSettings support in MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=73773
Summary [WK2][GTK] WebSettings support in MiniBrowser
Philippe Normand
Reported 2011-12-04 09:06:54 PST
Would be nice to be able to pass settings via the command line like in the wk1 launcher.
Attachments
WebSettings support in MiniBrowser (8.27 KB, patch)
2011-12-04 09:09 PST, Philippe Normand
webkit.review.bot: commit-queue-
WebSettings support in MiniBrowser (8.65 KB, patch)
2012-01-02 09:12 PST, Philippe Normand
mrobinson: review+
Philippe Normand
Comment 1 2011-12-04 09:09:13 PST
Created attachment 117791 [details] WebSettings support in MiniBrowser
Martin Robinson
Comment 2 2011-12-04 09:40:59 PST
WebKit Review Bot
Comment 3 2011-12-04 09:45:26 PST
Comment on attachment 117791 [details] WebSettings support in MiniBrowser Attachment 117791 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/10689591 New failing tests: svg/custom/linking-uri-01-b.svg
Philippe Normand
Comment 4 2011-12-04 09:46:18 PST
(In reply to comment #2) > Related bug: https://bugs.webkit.org/show_bug.cgi?id=71568 Argh! Seems like they're "complementary" though. I like the command line stuff but also understand a UI is nice to have.
Carlos Garcia Campos
Comment 5 2011-12-16 01:41:31 PST
Comment on attachment 117791 [details] WebSettings support in MiniBrowser View in context: https://bugs.webkit.org/attachment.cgi?id=117791&action=review I know this has been copied from GtkLauncher, so maybe can land this, and then fix the possible issus in GtkLauncher and MiniBrowser at the same time. > Tools/MiniBrowser/gtk/main.c:87 > + if (value && g_ascii_strcasecmp(value, "true") && strcmp(value, "1")) I don't undertand this line g_ascii_strcasecmp(value, "true") && strcmp(value, "1"), I don't know what the intention is, but the value can't be "true" and "1". > Tools/MiniBrowser/gtk/main.c:144 > + return 0; We can use NULL in C. > Tools/MiniBrowser/gtk/main.c:152 > + if (!param || !(param->flags & G_PARAM_WRITABLE)) I'm not sure we need this, all properties in webkit settings are READWRITE. But if we leave the check we should skip also construct only properties, since you can't do g_object_set on them. > Tools/MiniBrowser/gtk/main.c:157 > + if (gParamType == G_TYPE_BOOLEAN || gParamType == G_TYPE_STRING || gParamType == G_TYPE_INT > + || gParamType == G_TYPE_FLOAT) { I would use a help function here, and continue if the type is not valid, if (!paramTypeIsSupported(gParamType)) continue; > Tools/MiniBrowser/gtk/main.c:177 > +static gboolean addSettingsGroupToContext(GOptionContext *context, WebKitSettings* webkitSettings) WebKitSettings* webkitSettings -> WebKitSettings *webkitSettings > Tools/MiniBrowser/gtk/main.c:208 > + webkitSettings = 0; We can use NULL in C.
Carlos Garcia Campos
Comment 6 2011-12-16 01:42:17 PST
(In reply to comment #5) > (From update of attachment 117791 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=117791&action=review > > I know this has been copied from GtkLauncher, so maybe can land this, and then fix the possible issus in GtkLauncher and MiniBrowser at the same time. or even better, fix GtkLauncher first and then land the right patch for MiniBrowser
Carlos Garcia Campos
Comment 7 2011-12-16 01:43:39 PST
(In reply to comment #4) > (In reply to comment #2) > > Related bug: https://bugs.webkit.org/show_bug.cgi?id=71568 > > Argh! Seems like they're "complementary" though. I like the command line stuff but also understand a UI is nice to have. Yes, they are indeed complementary, I had in mind to write this patch when the UI one lands :-)
Philippe Normand
Comment 8 2011-12-16 08:04:58 PST
Comment on attachment 117791 [details] WebSettings support in MiniBrowser View in context: https://bugs.webkit.org/attachment.cgi?id=117791&action=review >> Tools/MiniBrowser/gtk/main.c:87 >> + if (value && g_ascii_strcasecmp(value, "true") && strcmp(value, "1")) > > I don't undertand this line g_ascii_strcasecmp(value, "true") && strcmp(value, "1"), I don't know what the intention is, but the value can't be "true" and "1". IIUC, this tests if value != true and value != 1
Carlos Garcia Campos
Comment 9 2011-12-22 04:12:32 PST
(In reply to comment #8) > (From update of attachment 117791 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=117791&action=review > > >> Tools/MiniBrowser/gtk/main.c:87 > >> + if (value && g_ascii_strcasecmp(value, "true") && strcmp(value, "1")) > > > > I don't undertand this line g_ascii_strcasecmp(value, "true") && strcmp(value, "1"), I don't know what the intention is, but the value can't be "true" and "1". > > IIUC, this tests if value != true and value != 1 right!, I always forget !strcmp(a,b) mean a == b :-P that's why I always use == 0, but it's not allowed by webkit coding style, so nevermind, sorry for the noise.
Philippe Normand
Comment 10 2012-01-02 04:27:13 PST
I'll update this one when the UI patch lands.
Philippe Normand
Comment 11 2012-01-02 09:12:17 PST
Created attachment 120887 [details] WebSettings support in MiniBrowser
Martin Robinson
Comment 12 2012-01-02 10:16:48 PST
Comment on attachment 120887 [details] WebSettings support in MiniBrowser View in context: https://bugs.webkit.org/attachment.cgi?id=120887&action=review Looks good, but please consider the following cleanup before landing... > Tools/MiniBrowser/gtk/main.c:30 > #include <webkit2/webkit2.h> I know it was wrong before, but do you mind making sure that this is in alphabetical order now? > Tools/MiniBrowser/gtk/main.c:45 > +static void loadURI(const gchar *uri, WebKitSettings *webkitSettings) Please rename this to something like createBrowserWindow. > Tools/MiniBrowser/gtk/main.c:88 > + gboolean propertyValue = TRUE; > + if (value && g_ascii_strcasecmp(value, "true") && strcmp(value, "1")) > + propertyValue = FALSE; This can just be: gboolean propertyValue = !(value && g_ascii_strcasecmp(value, "true") && strcmp(value, "1"));
Philippe Normand
Comment 13 2012-01-03 00:11:05 PST
Note You need to log in before you can comment on or make changes to this bug.