Bug 100393 - Generate Settings from a .in file
Summary: Generate Settings from a .in file
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tony Chang
URL:
Keywords:
Depends on: 100392 100405 100564
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-25 10:17 PDT by Tony Chang
Modified: 2012-11-15 13:41 PST (History)
10 users (show)

See Also:


Attachments
Patch (79.88 KB, patch)
2012-11-09 17:12 PST, Tony Chang
no flags Details | Formatted Diff | Diff
generated SettingsMacros.h (40.10 KB, text/plain)
2012-11-09 17:14 PST, Tony Chang
no flags Details
Patch (82.17 KB, patch)
2012-11-12 10:27 PST, Tony Chang
no flags Details | Formatted Diff | Diff
Patch (93.08 KB, patch)
2012-11-12 12:26 PST, Tony Chang
no flags Details | Formatted Diff | Diff
Patch (95.63 KB, patch)
2012-11-12 13:03 PST, Tony Chang
no flags Details | Formatted Diff | Diff
Patch for landing (102.85 KB, patch)
2012-11-13 15:15 PST, Tony Chang
no flags Details | Formatted Diff | Diff
Patch (103.42 KB, patch)
2012-11-13 16:19 PST, Tony Chang
no flags Details | Formatted Diff | Diff
Patch (99.88 KB, patch)
2012-11-14 10:17 PST, Tony Chang
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tony Chang 2012-10-25 10:17:42 PDT
We can also use this to generate InternalSettings.  The goal is to make it so adding a new setting is just adding a single line to an in file.  Tests will then be able to use internals.settings to override the pref and we can make sure the generated code properly resets the setting at the end of the test.

This would obsolete testRunner.overridePreference.
Comment 1 Tony Chang 2012-10-25 10:26:14 PDT
This is motivated by the discussion on webkit-dev:
http://lists.webkit.org/pipermail/webkit-dev/2012-September/022323.html

Oh, we could also try to automate or simplify adding exports.
Comment 2 Alexey Proskuryakov 2012-10-25 15:01:07 PDT
> This would obsolete testRunner.overridePreference.

How would it obsolete that? We can't go directly to settings if we want to test how preferences work.
Comment 3 Tony Chang 2012-10-25 15:03:38 PDT
(In reply to comment #2)
> > This would obsolete testRunner.overridePreference.
> 
> How would it obsolete that? We can't go directly to settings if we want to test how preferences work.

That's true, we should keep testRunner.overridePreference so we can test WebKit API methods.  However, we should be able to remove some API methods that were added to overridePreference just for DRT testing.
Comment 4 Tony Chang 2012-11-09 17:12:23 PST
Created attachment 173410 [details]
Patch
Comment 5 Tony Chang 2012-11-09 17:12:50 PST
Comment on attachment 173410 [details]
Patch

I expect some ews failures.
Comment 6 Tony Chang 2012-11-09 17:14:04 PST
Created attachment 173411 [details]
generated SettingsMacros.h

Here's what the generated file looks like.
Comment 7 Early Warning System Bot 2012-11-09 17:21:45 PST
Comment on attachment 173410 [details]
Patch

Attachment 173410 [details] did not pass qt-wk2-ews (qt):
Output: http://queues.webkit.org/results/14790292
Comment 8 EFL EWS Bot 2012-11-09 17:28:06 PST
Comment on attachment 173410 [details]
Patch

Attachment 173410 [details] did not pass efl-ews (efl):
Output: http://queues.webkit.org/results/14778610
Comment 9 Build Bot 2012-11-09 17:52:17 PST
Comment on attachment 173410 [details]
Patch

Attachment 173410 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/14785382
Comment 10 kov's GTK+ EWS bot 2012-11-09 17:55:18 PST
Comment on attachment 173410 [details]
Patch

Attachment 173410 [details] did not pass gtk-ews (gtk):
Output: http://queues.webkit.org/results/14779632
Comment 11 Build Bot 2012-11-09 19:17:47 PST
Comment on attachment 173410 [details]
Patch

Attachment 173410 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/14781492
Comment 12 Tony Chang 2012-11-12 10:27:08 PST
Created attachment 173668 [details]
Patch
Comment 13 Build Bot 2012-11-12 10:44:59 PST
Comment on attachment 173668 [details]
Patch

Attachment 173668 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/14813428
Comment 14 EFL EWS Bot 2012-11-12 12:01:40 PST
Comment on attachment 173668 [details]
Patch

Attachment 173668 [details] did not pass efl-ews (efl):
Output: http://queues.webkit.org/results/14818248
Comment 15 Tony Chang 2012-11-12 12:26:47 PST
Created attachment 173686 [details]
Patch
Comment 16 EFL EWS Bot 2012-11-12 12:41:13 PST
Comment on attachment 173686 [details]
Patch

Attachment 173686 [details] did not pass efl-ews (efl):
Output: http://queues.webkit.org/results/14811526
Comment 17 Tony Chang 2012-11-12 13:03:54 PST
Created attachment 173701 [details]
Patch
Comment 18 Tony Chang 2012-11-13 09:54:45 PST
Comment on attachment 173701 [details]
Patch

I'm not sure what's up with the Mac EWS bot, but I think this is ready for review now.
Comment 19 Adam Barth 2012-11-13 10:01:08 PST
Comment on attachment 173701 [details]
Patch

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

> Source/WebCore/page/make_settings.pl:3
> +# Copyright (C) 2011 Adam Barth <abarth@webkit.org>

I wrote this file!  I'm amazing.

> Source/WebCore/page/make_settings.pl:208
> +    substr($setterFunctionName, 3, 1) = uc(substr($setterFunctionName, 3, 1));
> +    if (substr($settingName, 0, 3) eq "css" || substr($settingName, 0, 3) eq "xss" || substr($settingName, 0, 3) eq "ftp") {
> +        substr($setterFunctionName, 3, 3) = uc(substr($setterFunctionName, 3, 3));
> +    }

Yeah, this is probably better than writing a general camel-case converter.
Comment 20 Adam Barth 2012-11-13 10:01:35 PST
Comment on attachment 173701 [details]
Patch

InternalsSettings is next?
Comment 21 Tony Chang 2012-11-13 10:27:35 PST
(In reply to comment #20)
> (From update of attachment 173701 [details])
> InternalsSettings is next?

Soon.  There are still lots of simple getters/setters in Settings.h that I'm going to fix up first (e.g., isScriptEnabled/setScriptEnabled, inApplicationChromeMode/setApplicationChromeMode, isCSSCustomFilterEnabled/setCSSCustomFilterEnabled, scrollAnimatorEnabled/setEnableScrollAnimator).
Comment 22 Build Bot 2012-11-13 13:19:31 PST
Comment on attachment 173701 [details]
Patch

Attachment 173701 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/14826292
Comment 23 Tony Chang 2012-11-13 15:15:35 PST
Created attachment 174004 [details]
Patch for landing
Comment 24 Build Bot 2012-11-13 15:51:22 PST
Comment on attachment 174004 [details]
Patch for landing

Attachment 174004 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/14832087
Comment 25 Tony Chang 2012-11-13 16:19:11 PST
Created attachment 174021 [details]
Patch
Comment 26 Tony Chang 2012-11-14 10:17:23 PST
Created attachment 174191 [details]
Patch
Comment 27 Build Bot 2012-11-14 21:59:36 PST
Comment on attachment 174191 [details]
Patch

Attachment 174191 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/14847254

New failing tests:
inspector-protocol/nmi-webaudio.html
Comment 28 WebKit Review Bot 2012-11-15 13:41:42 PST
Comment on attachment 174191 [details]
Patch

Clearing flags on attachment: 174191

Committed r134828: <http://trac.webkit.org/changeset/134828>
Comment 29 WebKit Review Bot 2012-11-15 13:41:49 PST
All reviewed patches have been landed.  Closing bug.