WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
178656
[Settings] Add initial support for generating preferences related code
https://bugs.webkit.org/show_bug.cgi?id=178656
Summary
[Settings] Add initial support for generating preferences related code
Sam Weinig
Reported
2017-10-23 02:55:02 PDT
[Settings] Add initial support for generating preferences related code
Attachments
Patch
(136.52 KB, patch)
2017-10-23 03:01 PDT
,
Sam Weinig
no flags
Details
Formatted Diff
Diff
Patch
(136.25 KB, patch)
2017-10-23 03:54 PDT
,
Sam Weinig
no flags
Details
Formatted Diff
Diff
Patch
(136.40 KB, patch)
2017-10-23 08:07 PDT
,
Sam Weinig
no flags
Details
Formatted Diff
Diff
Patch
(136.37 KB, patch)
2017-10-23 15:22 PDT
,
Sam Weinig
no flags
Details
Formatted Diff
Diff
Patch
(136.37 KB, patch)
2017-10-23 15:36 PDT
,
Sam Weinig
no flags
Details
Formatted Diff
Diff
Patch
(136.80 KB, patch)
2017-10-23 15:45 PDT
,
Sam Weinig
no flags
Details
Formatted Diff
Diff
Show Obsolete
(5)
View All
Add attachment
proposed patch, testcase, etc.
Sam Weinig
Comment 1
2017-10-23 03:01:43 PDT
Comment hidden (obsolete)
Created
attachment 324549
[details]
Patch
Sam Weinig
Comment 2
2017-10-23 03:54:05 PDT
Comment hidden (obsolete)
Created
attachment 324550
[details]
Patch
Sam Weinig
Comment 3
2017-10-23 08:07:30 PDT
Created
attachment 324557
[details]
Patch
Joseph Pecoraro
Comment 4
2017-10-23 10:59:39 PDT
Comment on
attachment 324557
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=324557&action=review
> Source/WebKit/Scripts/GeneratePreferences.rb:78 > + @humanReadableName = "\"#{opts["humanReadableName"]}\"" || '""' > + @humanReadableDescription = "\"#{opts["humanReadableDescription"]}\"" || '""'
I don't think `||` part does anything here, the left side always produces a string that at least has quotes so it won't be falsey. In the unlikely event that we might want to escape double quotes or other escape characters in the humanReadableDescription you could use String#inspect:
http://ruby-doc.org/core-2.1.1/String.html#method-i-inspect
@humanReadableName = (opts["humanReadableName"] || "").inspect @humanReadableDescription = (opts["humanReadableDescription"] || "").inspect That said, this might be cryptic, even for Rubyists. Perhaps just a simple: @humanReadableName = '"' + (opts["humanReadableName"] || "") + "'" @humanReadableDescription = '"' + (opts["humanReadableDescription"] || "") + '"'
> Source/WebKit/Scripts/GeneratePreferences.rb:119 > + @boolPreferncesNotDebug = @preferences.select { |p| !p.category && !p.webkitOnly && p.type == "bool" } > + @doublePreferncesNotDebug = @preferences.select { |p| !p.category && !p.webkitOnly && p.type == "double" }
Typo (all members): "Prefernces" => "Preferences"
Sam Weinig
Comment 5
2017-10-23 15:22:32 PDT
Created
attachment 324597
[details]
Patch
Sam Weinig
Comment 6
2017-10-23 15:36:09 PDT
Created
attachment 324599
[details]
Patch
Sam Weinig
Comment 7
2017-10-23 15:45:56 PDT
Created
attachment 324600
[details]
Patch
WebKit Commit Bot
Comment 8
2017-10-24 11:43:35 PDT
Comment on
attachment 324600
[details]
Patch Clearing flags on attachment: 324600 Committed
r223903
: <
https://trac.webkit.org/changeset/223903
>
WebKit Commit Bot
Comment 9
2017-10-24 11:43:36 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 10
2017-11-15 13:02:47 PST
<
rdar://problem/35568675
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug