Summary: | [Settings] Add initial support for generating preferences related code | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Sam Weinig <sam> | ||||||||||||||
Component: | New Bugs | Assignee: | Sam Weinig <sam> | ||||||||||||||
Status: | RESOLVED FIXED | ||||||||||||||||
Severity: | Normal | CC: | commit-queue, dino, joepeck, thorton, webkit-bug-importer | ||||||||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||||||||
Version: | WebKit Nightly Build | ||||||||||||||||
Hardware: | Unspecified | ||||||||||||||||
OS: | Unspecified | ||||||||||||||||
Bug Depends on: | |||||||||||||||||
Bug Blocks: | 178637 | ||||||||||||||||
Attachments: |
|
Description
Sam Weinig
2017-10-23 02:55:02 PDT
Created attachment 324549 [details]
Patch
Created attachment 324550 [details]
Patch
Created attachment 324557 [details]
Patch
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" Created attachment 324597 [details]
Patch
Created attachment 324599 [details]
Patch
Created attachment 324600 [details]
Patch
Comment on attachment 324600 [details] Patch Clearing flags on attachment: 324600 Committed r223903: <https://trac.webkit.org/changeset/223903> All reviewed patches have been landed. Closing bug. |