[Settings] Replace current Settings generation with template file based approach
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Oct 2017 03:13:33 +0000 (03:13 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Oct 2017 03:13:33 +0000 (03:13 +0000)
https://bugs.webkit.org/show_bug.cgi?id=178634

Patch by Sam Weinig <sam@webkit.org> on 2017-10-22
Reviewed by Joseph Pecoraro.

This replaces the recently added python based Settings generation with a generator
built in ruby, so we can take advantage of ERB for templating. The result has much
of the logic in the templates and as a result feels much easier to follow and cleaner.

Since I was moving things to ruby, I took the opertunity to switch the Settings definition
file from our .in format to yaml, which is quite a bit easier to read.

* CMakeLists.txt:
* DerivedSources.make:
* Scripts/GenerateSettings: Removed.
* Scripts/GenerateSettings.py: Removed.
* Scripts/GenerateSettings.rb: Added.
* Scripts/GenerateSettings/GenerateInternalSettingsHeaderFile.py: Removed.
* Scripts/GenerateSettings/GenerateInternalSettingsIDLFile.py: Removed.
* Scripts/GenerateSettings/GenerateInternalSettingsImplementationFile.py: Removed.
* Scripts/GenerateSettings/GenerateSettings.py: Removed.
* Scripts/GenerateSettings/GenerateSettingsHeaderFile.py: Removed.
* Scripts/GenerateSettings/GenerateSettingsImplementationFile.py: Removed.
* Scripts/GenerateSettings/Settings.py: Removed.
* Scripts/GenerateSettings/__init__.py: Removed.
* Scripts/SettingsTemplates: Added.
* Scripts/SettingsTemplates/InternalSettingsGenerated.cpp.erb: Added.
* Scripts/SettingsTemplates/InternalSettingsGenerated.h.erb: Added.
* Scripts/SettingsTemplates/InternalSettingsGenerated.idl.erb: Added.
* Scripts/SettingsTemplates/Settings.cpp.erb: Added.
* Scripts/SettingsTemplates/Settings.h.erb: Added.
* WebCore.xcodeproj/project.pbxproj:
* WebCoreMacros.cmake:
* page/Settings.in: Removed.
* page/Settings.yaml: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223828 268f45cc-cd09-0410-ab3c-d52691b4dbfc

22 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.make
Source/WebCore/Scripts/GenerateSettings.py [deleted file]
Source/WebCore/Scripts/GenerateSettings.rb [new file with mode: 0755]
Source/WebCore/Scripts/GenerateSettings/GenerateInternalSettingsHeaderFile.py [deleted file]
Source/WebCore/Scripts/GenerateSettings/GenerateInternalSettingsIDLFile.py [deleted file]
Source/WebCore/Scripts/GenerateSettings/GenerateInternalSettingsImplementationFile.py [deleted file]
Source/WebCore/Scripts/GenerateSettings/GenerateSettings.py [deleted file]
Source/WebCore/Scripts/GenerateSettings/GenerateSettingsHeaderFile.py [deleted file]
Source/WebCore/Scripts/GenerateSettings/GenerateSettingsImplementationFile.py [deleted file]
Source/WebCore/Scripts/GenerateSettings/Settings.py [deleted file]
Source/WebCore/Scripts/GenerateSettings/__init__.py [deleted file]
Source/WebCore/Scripts/SettingsTemplates/InternalSettingsGenerated.cpp.erb [new file with mode: 0644]
Source/WebCore/Scripts/SettingsTemplates/InternalSettingsGenerated.h.erb [new file with mode: 0644]
Source/WebCore/Scripts/SettingsTemplates/InternalSettingsGenerated.idl.erb [new file with mode: 0644]
Source/WebCore/Scripts/SettingsTemplates/Settings.cpp.erb [new file with mode: 0644]
Source/WebCore/Scripts/SettingsTemplates/Settings.h.erb [new file with mode: 0644]
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/WebCoreMacros.cmake
Source/WebCore/page/Settings.in [deleted file]
Source/WebCore/page/Settings.yaml [new file with mode: 0644]

index 825f6b7..ac521f6 100644 (file)
@@ -4025,7 +4025,7 @@ GENERATE_EVENT_FACTORY(${WEBCORE_DIR}/dom/EventTargetFactory.in EventTargetInter
 list(APPEND WebCore_DERIVED_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/EventTargetInterfaces.h)
 
 
-GENERATE_SETTINGS_MACROS(${WEBCORE_DIR}/page/Settings.in Settings.h)
+GENERATE_SETTINGS_MACROS(${WEBCORE_DIR}/page/Settings.yaml Settings.h)
 list(APPEND WebCore_DERIVED_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/Settings.h)
 list(APPEND WebCore_DERIVED_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/Settings.cpp)
 list(APPEND WebCoreTestSupport_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/InternalSettingsGenerated.cpp)
index 5d11364..41d6bb2 100644 (file)
@@ -1,3 +1,41 @@
+2017-10-22  Sam Weinig  <sam@webkit.org>
+
+        [Settings] Replace current Settings generation with template file based approach
+        https://bugs.webkit.org/show_bug.cgi?id=178634
+
+        Reviewed by Joseph Pecoraro.
+
+        This replaces the recently added python based Settings generation with a generator
+        built in ruby, so we can take advantage of ERB for templating. The result has much
+        of the logic in the templates and as a result feels much easier to follow and cleaner.
+
+        Since I was moving things to ruby, I took the opertunity to switch the Settings definition
+        file from our .in format to yaml, which is quite a bit easier to read.
+
+        * CMakeLists.txt:
+        * DerivedSources.make:
+        * Scripts/GenerateSettings: Removed.
+        * Scripts/GenerateSettings.py: Removed.
+        * Scripts/GenerateSettings.rb: Added.
+        * Scripts/GenerateSettings/GenerateInternalSettingsHeaderFile.py: Removed.
+        * Scripts/GenerateSettings/GenerateInternalSettingsIDLFile.py: Removed.
+        * Scripts/GenerateSettings/GenerateInternalSettingsImplementationFile.py: Removed.
+        * Scripts/GenerateSettings/GenerateSettings.py: Removed.
+        * Scripts/GenerateSettings/GenerateSettingsHeaderFile.py: Removed.
+        * Scripts/GenerateSettings/GenerateSettingsImplementationFile.py: Removed.
+        * Scripts/GenerateSettings/Settings.py: Removed.
+        * Scripts/GenerateSettings/__init__.py: Removed.
+        * Scripts/SettingsTemplates: Added.
+        * Scripts/SettingsTemplates/InternalSettingsGenerated.cpp.erb: Added.
+        * Scripts/SettingsTemplates/InternalSettingsGenerated.h.erb: Added.
+        * Scripts/SettingsTemplates/InternalSettingsGenerated.idl.erb: Added.
+        * Scripts/SettingsTemplates/Settings.cpp.erb: Added.
+        * Scripts/SettingsTemplates/Settings.h.erb: Added.
+        * WebCore.xcodeproj/project.pbxproj:
+        * WebCoreMacros.cmake:
+        * page/Settings.in: Removed.
+        * page/Settings.yaml: Added.
+
 2017-10-22  Joseph Pecoraro  <pecoraro@apple.com>
 
         REGRESSION(r219675): Web Inspector: CommandLineAPI getEventListeners does not work
index f15e923..655b5c8 100644 (file)
@@ -1372,18 +1372,15 @@ JSMathMLElementWrapperFactory%cpp JSMathMLElementWrapperFactory%h MathMLElementF
 # Internal Settings
 
 GENERATE_SETTINGS_SCRIPTS = \
-    $(WebCore)/Scripts/GenerateSettings/GenerateInternalSettingsHeaderFile.py \
-    $(WebCore)/Scripts/GenerateSettings/GenerateInternalSettingsIDLFile.py \
-    $(WebCore)/Scripts/GenerateSettings/GenerateInternalSettingsImplementationFile.py \
-    $(WebCore)/Scripts/GenerateSettings/GenerateSettings.py \
-    $(WebCore)/Scripts/GenerateSettings/GenerateSettingsHeaderFile.py \
-    $(WebCore)/Scripts/GenerateSettings/GenerateSettingsImplementationFile.py \
-    $(WebCore)/Scripts/GenerateSettings/Settings.py \
-    $(WebCore)/Scripts/GenerateSettings/__init__.py
+    $(WebCore)/Scripts/SettingsTemplates/InternalSettingsGenerated.cpp.erb \
+    $(WebCore)/Scripts/SettingsTemplates/InternalSettingsGenerated.idl.erb \
+    $(WebCore)/Scripts/SettingsTemplates/InternalSettingsGenerated.h.erb \
+    $(WebCore)/Scripts/SettingsTemplates/Settings.cpp.erb \
+    $(WebCore)/Scripts/SettingsTemplates/Settings.h.erb
 
 all : InternalSettingsGenerated.idl InternalSettingsGenerated.cpp InternalSettingsGenerated.h Settings.cpp Settings.h
-InternalSettingsGenerated%idl InternalSettingsGenerated%cpp InternalSettingsGenerated%h Settings%cpp Settings%h : $(WebCore)/Scripts/GenerateSettings.py $(GENERATE_SETTINGS_SCRIPTS) page/Settings.in
-       $(PYTHON) $< --input $(WebCore)/page/Settings.in
+InternalSettingsGenerated%idl InternalSettingsGenerated%cpp InternalSettingsGenerated%h Settings%cpp Settings%h : $(WebCore)/Scripts/GenerateSettings.rb $(GENERATE_SETTINGS_SCRIPTS) page/Settings.yaml
+       $(RUBY) $< --input $(WebCore)/page/Settings.yaml
 
 # --------
 
diff --git a/Source/WebCore/Scripts/GenerateSettings.py b/Source/WebCore/Scripts/GenerateSettings.py
deleted file mode 100755 (executable)
index e2bac81..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (c) 2017 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
-# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-# THE POSSIBILITY OF SUCH DAMAGE.
-
-import os.path
-import sys
-from optparse import OptionParser
-
-from GenerateSettings import *
-
-
-def main():
-    parser = OptionParser(usage="usage: %prog --input file")
-    parser.add_option('--input', dest='input', help='file to generate settings from', metavar='file')
-    parser.add_option('--outputDir', dest='outputDir', help='directory to generate file in', metavar='dir')
-
-    (options, arguments) = parser.parse_args()
-
-    if not options.input:
-        print "Error: must provide an input file"
-        parser.print_usage()
-        exit(-1)
-
-    outputDirectory = options.outputDir if options.outputDir else os.getcwd()
-
-    if not os.path.exists(outputDirectory):
-        os.makedirs(outputDirectory)
-
-    settings = parseInput(options.input)
-
-    generateSettingsHeaderFile(outputDirectory, settings)
-    generateSettingsImplementationFile(outputDirectory, settings)
-    generateInternalSettingsIDLFile(outputDirectory, settings)
-    generateInternalSettingsHeaderFile(outputDirectory, settings)
-    generateInternalSettingsImplementationFile(outputDirectory, settings)
-
-
-if __name__ == '__main__':
-    main()
diff --git a/Source/WebCore/Scripts/GenerateSettings.rb b/Source/WebCore/Scripts/GenerateSettings.rb
new file mode 100755 (executable)
index 0000000..cf5f1af
--- /dev/null
@@ -0,0 +1,196 @@
+#!/usr/bin/env ruby
+#
+# Copyright (c) 2017 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGE.
+
+require "fileutils"
+require 'erb'
+require 'optparse'
+require 'yaml'
+
+options = { 
+  :input => nil,
+  :outputDirectory => nil
+}
+optparse = OptionParser.new do |opts|
+    opts.banner = "Usage: #{File.basename($0)} --input file"
+
+    opts.separator ""
+
+    opts.on("--input input", "file to generate settings from") { |input| options[:input] = input }
+    opts.on("--outputDir output", "directory to generate file in") { |output| options[:outputDirectory] = output }
+end
+
+optparse.parse!
+
+if !options[:input]
+  puts optparse
+  exit -1
+end
+
+if !options[:outputDirectory]
+  options[:outputDirectory] = Dir.getwd
+end
+
+FileUtils.mkdir_p(options[:outputDirectory])
+
+parsedSettings = begin
+  YAML.load_file(options[:input])
+rescue ArgumentError => e
+  puts "Could not parse input file: #{e.message}"
+  exit(-1)
+end
+
+class Setting
+  attr_accessor :name
+  attr_accessor :type
+  attr_accessor :initial
+  attr_accessor :conditional
+  attr_accessor :onChange
+  attr_accessor :getter
+  
+  def initialize(name, opts)
+    @name = name
+    @type = opts["type"] || "bool"
+    @initial = opts["initial"]
+    @conditional = opts["conditional"]
+    @onChange = opts["onChange"]
+    @getter = opts["getter"]
+  end
+
+  def valueType?
+    @type != "String" && @type != "URL"
+  end
+
+  def idlType
+    # FIXME: Add support for more types including enumerate types.
+    if @type == "int"
+      "long"
+    elsif @type == "unsigned"
+      "unsigned long"
+    elsif @type == "double"
+      "double"
+    elsif @type == "float"
+      "float"
+    elsif @type == "String"
+      "DOMString"
+    elsif @type == "bool"
+      "boolean"
+    else
+      nil
+    end
+  end
+
+  def parameterType
+    if valueType?
+      @type
+    else
+      "const #{@type}&"
+    end
+  end
+
+  def hasComplexSetter?
+    @onChange != nil
+  end
+
+  def setterFunctionName
+    if @name.start_with?("css", "xss", "ftp", "dom", "dns")
+      "set" + @name[0..2].upcase + @name[3..@name.length]
+    else
+      "set" + @name[0].upcase + @name[1..@name.length]
+    end
+  end
+
+  def getterFunctionName
+    @getter || @name
+  end
+end
+
+class Conditional
+  attr_accessor :condition
+  attr_accessor :settings
+  attr_accessor :boolSettings
+  attr_accessor :nonBoolSettings
+  attr_accessor :settingsWithComplexSetters
+
+  def initialize(condition, settings)
+    @condition = condition
+    @settings = settings
+    
+    @boolSettings = @settings.select { |setting| setting.type == "bool" }
+    @nonBoolSettings = @settings.reject { |setting| setting.type == "bool" }
+    @settingsWithComplexSetters = @settings.select { |setting| setting.hasComplexSetter? }
+  end
+end
+
+class Settings
+  attr_accessor :settings
+  attr_accessor :unconditionalSetting
+  attr_accessor :unconditionalBoolSetting
+  attr_accessor :unconditionalNonBoolSetting
+  attr_accessor :unconditionalSettingWithComplexSetters
+  attr_accessor :conditionals
+  
+  def initialize(hash)
+    @settings = []
+    hash.each do |name, options|
+      @settings << Setting.new(name, options)
+    end
+    @settings.sort! { |x, y| x.name <=> y.name }
+    
+    @unconditionalSetting = @settings.reject { |setting| setting.conditional }
+    @unconditionalBoolSetting = @unconditionalSetting.select { |setting| setting.type == "bool" }
+    @unconditionalNonBoolSetting = @unconditionalSetting.reject { |setting| setting.type == "bool" }
+    @unconditionalSettingWithComplexSetters = @unconditionalSetting.select { |setting| setting.hasComplexSetter? }
+
+    @conditionals = []
+    conditionalsMap = {}
+    @settings.select { |setting| setting.conditional }.each do |setting|
+      if !conditionalsMap[setting.conditional]
+        conditionalsMap[setting.conditional] = []
+      end
+
+      conditionalsMap[setting.conditional] << setting
+    end
+    conditionalsMap.each do |key, value|
+      @conditionals << Conditional.new(key, value)
+    end
+    @conditionals.sort! { |x, y| x.condition <=> y.condition }
+  end
+
+  def renderToFile(template, file)
+    template = File.join(File.dirname(__FILE__), template)
+
+    output = ERB.new(File.read(template), 0, "-").result(binding)
+    File.open(file, "w+") do |f|
+      f.write(output)
+    end
+  end
+end
+
+settings = Settings.new(parsedSettings)
+settings.renderToFile("SettingsTemplates/Settings.h.erb", File.join(options[:outputDirectory], "Settings.h"))
+settings.renderToFile("SettingsTemplates/Settings.cpp.erb", File.join(options[:outputDirectory], "Settings.cpp"))
+settings.renderToFile("SettingsTemplates/InternalSettingsGenerated.idl.erb", File.join(options[:outputDirectory], "InternalSettingsGenerated.idl"))
+settings.renderToFile("SettingsTemplates/InternalSettingsGenerated.h.erb", File.join(options[:outputDirectory], "InternalSettingsGenerated.h"))
+settings.renderToFile("SettingsTemplates/InternalSettingsGenerated.cpp.erb", File.join(options[:outputDirectory], "InternalSettingsGenerated.cpp"))
diff --git a/Source/WebCore/Scripts/GenerateSettings/GenerateInternalSettingsHeaderFile.py b/Source/WebCore/Scripts/GenerateSettings/GenerateInternalSettingsHeaderFile.py
deleted file mode 100755 (executable)
index 6219bea..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (c) 2017 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
-# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-# THE POSSIBILITY OF SUCH DAMAGE.
-
-import os.path
-
-from Settings import license, makeConditionalString
-
-
-def generateInternalSettingsHeaderFile(outputDirectory, settings):
-    outputPath = os.path.join(outputDirectory, "InternalSettingsGenerated.h")
-    outputFile = open(outputPath, 'w')
-    outputFile.write(license())
-
-    outputFile.write("#pragma once\n\n")
-
-    outputFile.write("#include \"Supplementable.h\"\n")
-    outputFile.write("#include <wtf/RefCounted.h>\n")
-    outputFile.write("#include <wtf/text/WTFString.h>\n\n")
-
-    outputFile.write("namespace WebCore {\n\n")
-
-    outputFile.write("class Page;\n\n")
-
-    outputFile.write("class InternalSettingsGenerated : public RefCounted<InternalSettingsGenerated> {\n")
-    outputFile.write("public:\n")
-    outputFile.write("    explicit InternalSettingsGenerated(Page*);\n")
-    outputFile.write("    virtual ~InternalSettingsGenerated();\n\n")
-    outputFile.write("    void resetToConsistentState();\n\n")
-
-    for settingName in sorted(settings.iterkeys()):
-        setting = settings[settingName]
-        idlType = setting.idlType()
-        if not idlType:
-            continue
-
-        type = "const String&" if setting.type == "String" else setting.type
-        outputFile.write("    void " + setting.setterFunctionName() + "(" + type + " " + setting.name + ");\n")
-
-    outputFile.write("\n")
-    outputFile.write("private:\n")
-    outputFile.write("    Page* m_page;\n\n")
-
-    for settingName in sorted(settings.iterkeys()):
-        setting = settings[settingName]
-        idlType = setting.idlType()
-        if not idlType:
-            continue
-
-        if setting.conditional:
-            outputFile.write("#if " + makeConditionalString(setting.conditional) + "\n")
-
-        outputFile.write("    " + setting.type + " m_" + setting.name + ";\n")
-
-        if setting.conditional:
-            outputFile.write("#endif\n")
-
-    outputFile.write("};\n\n")
-    outputFile.write("} // namespace WebCore\n")
-
-    outputFile.close()
diff --git a/Source/WebCore/Scripts/GenerateSettings/GenerateInternalSettingsIDLFile.py b/Source/WebCore/Scripts/GenerateSettings/GenerateInternalSettingsIDLFile.py
deleted file mode 100755 (executable)
index 1b8358e..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (c) 2017 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
-# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-# THE POSSIBILITY OF SUCH DAMAGE.
-
-import os.path
-
-from Settings import license
-
-
-def generateInternalSettingsIDLFile(outputDirectory, settings):
-    outputPath = os.path.join(outputDirectory, "InternalSettingsGenerated.idl")
-    outputFile = open(outputPath, 'w')
-    outputFile.write(license())
-
-    outputFile.write("[\n")
-    outputFile.write("    NoInterfaceObject,\n")
-    outputFile.write("    ExportMacro=WEBCORE_TESTSUPPORT_EXPORT,\n")
-    outputFile.write("] interface InternalSettingsGenerated {\n")
-
-    for settingName in sorted(settings.iterkeys()):
-        setting = settings[settingName]
-        idlType = setting.idlType()
-        if not idlType:
-            continue
-        outputFile.write("    void " + setting.setterFunctionName() + "(" + idlType + " " + setting.name + ");\n")
-
-    outputFile.write("};\n")
-    outputFile.close()
diff --git a/Source/WebCore/Scripts/GenerateSettings/GenerateInternalSettingsImplementationFile.py b/Source/WebCore/Scripts/GenerateSettings/GenerateInternalSettingsImplementationFile.py
deleted file mode 100755 (executable)
index d45bbcd..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (c) 2017 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
-# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-# THE POSSIBILITY OF SUCH DAMAGE.
-
-import os.path
-
-from Settings import license, makeConditionalString, makeConditionalString
-
-
-def generateInternalSettingsImplementationFile(outputDirectory, settings):
-    outputPath = os.path.join(outputDirectory, "InternalSettingsGenerated.cpp")
-    outputFile = open(outputPath, 'w')
-    outputFile.write(license())
-
-    outputFile.write("#include \"config.h\"\n")
-    outputFile.write("#include \"InternalSettingsGenerated.h\"\n\n")
-
-    outputFile.write("#include \"Page.h\"\n")
-    outputFile.write("#include \"Settings.h\"\n\n")
-
-    outputFile.write("namespace WebCore {\n\n")
-
-    outputFile.write("InternalSettingsGenerated::InternalSettingsGenerated(Page* page)\n")
-    outputFile.write("    : m_page(page)\n")
-
-    for settingName in sorted(settings.iterkeys()):
-        setting = settings[settingName]
-        idlType = setting.idlType()
-        if not idlType:
-            continue
-
-        if setting.conditional:
-            outputFile.write("#if " + makeConditionalString(setting.conditional) + "\n")
-
-        outputFile.write("    , m_" + setting.name + "(page->settings()." + setting.getterFunctionName() + "())\n")
-
-        if setting.conditional:
-            outputFile.write("#endif\n")
-
-    outputFile.write("{\n")
-    outputFile.write("}\n\n")
-
-    outputFile.write("InternalSettingsGenerated::~InternalSettingsGenerated()\n")
-    outputFile.write("{\n")
-    outputFile.write("}\n\n")
-
-    outputFile.write("void InternalSettingsGenerated::resetToConsistentState()\n")
-    outputFile.write("{\n")
-
-    for settingName in sorted(settings.iterkeys()):
-        setting = settings[settingName]
-        idlType = setting.idlType()
-        if not idlType:
-            continue
-
-        if setting.conditional:
-            outputFile.write("#if " + makeConditionalString(setting.conditional) + "\n")
-
-        outputFile.write("    m_page->settings()." + setting.setterFunctionName() + "(m_" + setting.name + ");\n")
-
-        if setting.conditional:
-            outputFile.write("#endif\n")
-
-    outputFile.write("}\n\n")
-
-    for settingName in sorted(settings.iterkeys()):
-        setting = settings[settingName]
-        idlType = setting.idlType()
-        if not idlType:
-            continue
-
-        type = "const String&" if setting.type == "String" else setting.type
-
-        outputFile.write("void InternalSettingsGenerated::" + setting.setterFunctionName() + "(" + type + " " + setting.name + ")\n")
-        outputFile.write("{\n")
-
-        if setting.conditional:
-            outputFile.write("#if " + makeConditionalString(setting.conditional) + "\n")
-
-        outputFile.write("    m_page->settings()." + setting.setterFunctionName() + "(" + setting.name + ");\n")
-
-        if setting.conditional:
-            outputFile.write("#else\n")
-            outputFile.write("    UNUSED_PARAM(" + setting.name + ");\n")
-            outputFile.write("#endif\n")
-
-        outputFile.write("}\n\n")
-
-    outputFile.write("} // namespace WebCore\n")
-
-    outputFile.close()
diff --git a/Source/WebCore/Scripts/GenerateSettings/GenerateSettings.py b/Source/WebCore/Scripts/GenerateSettings/GenerateSettings.py
deleted file mode 100644 (file)
index 158c0bf..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-from Settings import *
-from GenerateInternalSettingsHeaderFile import *
-from GenerateInternalSettingsIDLFile import *
-from GenerateInternalSettingsImplementationFile import *
-from GenerateSettingsHeaderFile import *
-from GenerateSettingsImplementationFile import *
diff --git a/Source/WebCore/Scripts/GenerateSettings/GenerateSettingsHeaderFile.py b/Source/WebCore/Scripts/GenerateSettings/GenerateSettingsHeaderFile.py
deleted file mode 100755 (executable)
index 2165daf..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (c) 2017 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
-# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-# THE POSSIBILITY OF SUCH DAMAGE.
-
-import os.path
-
-from Settings import license, makeConditionalString, makePreferredConditional
-
-
-def generateSettingsHeaderFile(outputDirectory, settings):
-    settingsByConditional = {}
-    unconditionalSettings = {}
-
-    for settingName in sorted(settings.iterkeys()):
-        setting = settings[settingName]
-        if setting.conditional:
-            if setting.conditional not in settingsByConditional:
-                settingsByConditional[setting.conditional] = {}
-            settingsByConditional[setting.conditional][setting.name] = True
-        else:
-            unconditionalSettings[setting.name] = True
-
-    sortedUnconditionalSettingsNames = sorted(unconditionalSettings.iterkeys())
-    sortedConditionals = sorted(settingsByConditional.iterkeys())
-
-    outputPath = os.path.join(outputDirectory, "Settings.h")
-    outputFile = open(outputPath, 'w')
-    outputFile.write(license())
-
-    outputFile.write("#pragma once\n\n")
-
-    outputFile.write("#include \"SettingsBase.h\"\n")
-    outputFile.write("#include <wtf/RefCounted.h>\n\n")
-
-    outputFile.write("namespace WebCore {\n\n")
-
-    outputFile.write("class Page;\n\n")
-
-    outputFile.write("class Settings : public SettingsBase, public RefCounted<Settings> {\n")
-    outputFile.write("    WTF_MAKE_NONCOPYABLE(Settings); WTF_MAKE_FAST_ALLOCATED;\n")
-    outputFile.write("public:\n")
-    outputFile.write("    static Ref<Settings> create(Page*);\n")
-    outputFile.write("    ~Settings();\n\n")
-
-    printGettersAndSetters(outputFile, sortedUnconditionalSettingsNames, sortedConditionals, settingsByConditional, settings)
-
-    outputFile.write("private:\n")
-    outputFile.write("    explicit Settings(Page*);\n\n")
-
-    printMemberVariables(outputFile, sortedUnconditionalSettingsNames, sortedConditionals, settingsByConditional, settings)
-
-    outputFile.write("};\n\n")
-
-    outputFile.write("}\n")
-
-    outputFile.close()
-
-
-def printGetterAndSetter(outputFile, setting):
-    setterFunctionName = setting.setterFunctionName()
-    getterFunctionName = setting.getterFunctionName()
-
-    webcoreExport = "WEBCORE_EXPORT " if setting.hasComplexSetter() else ""
-
-    if setting.typeIsValueType():
-        outputFile.write("    " + setting.type + " " + getterFunctionName + "() const { return m_" + setting.name + "; }\n")
-        outputFile.write("    " + webcoreExport + "void " + setterFunctionName + "(" + setting.type + " " + setting.name + ")")
-    else:
-        outputFile.write("    const " + setting.type + "& " + getterFunctionName + "() const { return m_" + setting.name + "; }\n")
-        outputFile.write("    " + webcoreExport + "void " + setterFunctionName + "(const " + setting.type + "& " + setting.name + ")")
-
-    if setting.hasComplexSetter():
-        outputFile.write(";\n")
-    else:
-        outputFile.write(" { m_" + setting.name + " = " + setting.name + "; }\n")
-
-
-def printGettersAndSetters(outputFile, sortedUnconditionalSettingsNames, sortedConditionals, settingsByConditional, settings):
-    for unconditionalSettingName in sortedUnconditionalSettingsNames:
-        printGetterAndSetter(outputFile, settings[unconditionalSettingName])
-
-    outputFile.write("\n")
-
-    for conditional in sortedConditionals:
-        outputFile.write("#if " + makeConditionalString(conditional) + "\n")
-
-        for settingName in sorted(settingsByConditional[conditional].iterkeys()):
-            printGetterAndSetter(outputFile, settings[settingName])
-
-        outputFile.write("#endif\n\n")
-
-
-def printMemberVariables(outputFile, sortedUnconditionalSettingsNames, sortedConditionals, settingsByConditional, settings):
-    for unconditionalSettingName in sortedUnconditionalSettingsNames:
-        setting = settings[unconditionalSettingName]
-        if setting.type == "bool":
-            continue
-        outputFile.write("    " + setting.type + " m_" + setting.name + ";\n")
-
-    for conditional in sortedConditionals:
-        hasMemberVariable = False
-        for settingName in sorted(settingsByConditional[conditional].iterkeys()):
-            setting = settings[settingName]
-            if setting.type != "bool":
-                hasMemberVariable = True
-                break
-
-        if hasMemberVariable:
-            outputFile.write("#if " + makeConditionalString(conditional) + "\n")
-
-            for settingName in sorted(settingsByConditional[conditional].iterkeys()):
-                setting = settings[settingName]
-                if setting.type != "bool":
-                    outputFile.write("    " + setting.type + " m_" + setting.name + ";\n")
-
-            outputFile.write("#endif\n")
-
-    for unconditionalSettingName in sortedUnconditionalSettingsNames:
-        setting = settings[unconditionalSettingName]
-        if setting.type != "bool":
-            continue
-        outputFile.write("    " + setting.type + " m_" + setting.name + " : 1;\n")
-
-    for conditional in sortedConditionals:
-        hasMemberVariable = False
-        for settingName in sorted(settingsByConditional[conditional].iterkeys()):
-            setting = settings[settingName]
-            if setting.type == "bool":
-                hasMemberVariable = True
-                break
-
-        if hasMemberVariable:
-            outputFile.write("#if " + makeConditionalString(conditional) + "\n")
-
-            for settingName in sorted(settingsByConditional[conditional].iterkeys()):
-                setting = settings[settingName]
-                if setting.type == "bool":
-                    outputFile.write("    " + setting.type + " m_" + setting.name + " : 1;\n")
-
-            outputFile.write("#endif\n")
diff --git a/Source/WebCore/Scripts/GenerateSettings/GenerateSettingsImplementationFile.py b/Source/WebCore/Scripts/GenerateSettings/GenerateSettingsImplementationFile.py
deleted file mode 100755 (executable)
index d6e6093..0000000
+++ /dev/null
@@ -1,188 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (c) 2017 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
-# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-# THE POSSIBILITY OF SUCH DAMAGE.
-
-import os.path
-
-from Settings import license, makeConditionalString, makePreferredConditional
-
-
-def generateSettingsImplementationFile(outputDirectory, settings):
-    settingsByConditional = {}
-    unconditionalSettings = {}
-
-    for settingName in sorted(settings.iterkeys()):
-        setting = settings[settingName]
-        if setting.conditional:
-            if setting.conditional not in settingsByConditional:
-                settingsByConditional[setting.conditional] = {}
-            settingsByConditional[setting.conditional][setting.name] = True
-        else:
-            unconditionalSettings[setting.name] = True
-
-    sortedUnconditionalSettingsNames = sorted(unconditionalSettings.iterkeys())
-    sortedConditionals = sorted(settingsByConditional.iterkeys())
-
-    outputPath = os.path.join(outputDirectory, "Settings.cpp")
-    outputFile = open(outputPath, 'w')
-    outputFile.write(license())
-
-    outputFile.write("#include \"config.h\"\n")
-    outputFile.write("#include \"Settings.h\"\n\n")
-
-    outputFile.write("#include \"Page.h\"\n")
-    outputFile.write("#include \"SettingsDefaultValues.h\"\n\n")
-
-    outputFile.write("namespace WebCore {\n\n")
-
-    outputFile.write("Ref<Settings> Settings::create(Page* page)\n")
-    outputFile.write("{\n")
-    outputFile.write("    return adoptRef(*new Settings(page));\n")
-    outputFile.write("}\n\n")
-
-    outputFile.write("Settings::Settings(Page* page)\n")
-    outputFile.write("    : SettingsBase(page)\n")
-
-    printInitializerList(outputFile, sortedUnconditionalSettingsNames, sortedConditionals, settingsByConditional, settings)
-
-    outputFile.write("{\n")
-    outputFile.write("}\n\n")
-
-    outputFile.write("Settings::~Settings()\n")
-    outputFile.write("{\n")
-    outputFile.write("}\n\n")
-
-    printSetterBodies(outputFile, sortedUnconditionalSettingsNames, sortedConditionals, settingsByConditional, settings)
-
-    outputFile.write("}\n")
-
-    outputFile.close()
-
-
-def hasNonBoolInitializer(setting):
-    if setting.type == "bool":
-        return False
-    if not setting.initial:
-        return False
-    return True
-
-
-def printNonBoolInitializer(outputFile, setting):
-    if not hasNonBoolInitializer(setting):
-        return
-    outputFile.write("    , m_" + setting.name + "(" + setting.initial + ")\n")
-
-
-def hasBoolInitializer(setting):
-    if setting.type != "bool":
-        return False
-    if not setting.initial:
-        return False
-    return True
-
-
-def printBoolInitializer(outputFile, setting):
-    if not hasBoolInitializer(setting):
-        return
-    outputFile.write("    , m_" + setting.name + "(" + setting.initial + ")\n")
-
-
-def printInitializerList(outputFile, sortedUnconditionalSettingsNames, sortedConditionals, settingsByConditional, settings):
-    for unconditionalSettingName in sortedUnconditionalSettingsNames:
-        printNonBoolInitializer(outputFile, settings[unconditionalSettingName])
-
-    for conditional in sortedConditionals:
-        hasInitializer = False
-        for settingName in sorted(settingsByConditional[conditional].iterkeys()):
-            if hasNonBoolInitializer(settings[settingName]):
-                hasInitializer = True
-                break
-
-        if hasInitializer:
-            outputFile.write("#if " + makeConditionalString(conditional) + "\n")
-
-            for settingName in sorted(settingsByConditional[conditional].iterkeys()):
-                printNonBoolInitializer(outputFile, settings[settingName])
-
-            outputFile.write("#endif\n")
-
-    for unconditionalSettingName in sortedUnconditionalSettingsNames:
-        printBoolInitializer(outputFile, settings[unconditionalSettingName])
-
-    for conditional in sortedConditionals:
-        hasInitializer = False
-        for settingName in sorted(settingsByConditional[conditional].iterkeys()):
-            if hasBoolInitializer(settings[settingName]):
-                hasInitializer = True
-                break
-
-        if hasInitializer:
-            outputFile.write("#if " + makeConditionalString(conditional) + "\n")
-
-            for settingName in sorted(settingsByConditional[conditional].iterkeys()):
-                printBoolInitializer(outputFile, settings[settingName])
-
-            outputFile.write("#endif\n")
-
-
-def printSetterBody(outputFile, setting):
-    if not setting.hasComplexSetter():
-        return
-
-    setterFunctionName = setting.setterFunctionName()
-    changeFunctionName = setting.setterChangeFunctionName()
-
-    if setting.typeIsValueType():
-        outputFile.write("void Settings::" + setterFunctionName + "(" + setting.type + " " + setting.name + ")\n")
-    else:
-        outputFile.write("void Settings::" + setterFunctionName + "(const " + setting.type + "& " + setting.name + ")\n")
-
-    outputFile.write("{\n")
-    outputFile.write("    if (m_" + setting.name + " == " + setting.name + ")\n")
-    outputFile.write("        return;\n")
-    outputFile.write("    m_" + setting.name + " = " + setting.name + ";\n")
-    outputFile.write("    " + changeFunctionName + "();\n")
-    outputFile.write("}\n\n")
-
-
-def printSetterBodies(outputFile, sortedUnconditionalSettingsNames, sortedConditionals, settingsByConditional, settings):
-    for unconditionalSettingName in sortedUnconditionalSettingsNames:
-        setting = settings[unconditionalSettingName]
-        printSetterBody(outputFile, setting)
-
-    for conditional in sortedConditionals:
-        hasSetterBody = False
-        for settingName in sorted(settingsByConditional[conditional].iterkeys()):
-            setting = settings[settingName]
-            if setting.hasComplexSetter():
-                hasSetterBody = True
-                break
-
-        if hasSetterBody:
-            outputFile.write("#if " + makeConditionalString(conditional) + "\n\n")
-
-            for settingName in sorted(settingsByConditional[conditional].iterkeys()):
-                printSetterBody(outputFile, settings[settingName])
-
-            outputFile.write("#endif\n\n")
diff --git a/Source/WebCore/Scripts/GenerateSettings/Settings.py b/Source/WebCore/Scripts/GenerateSettings/Settings.py
deleted file mode 100755 (executable)
index a3c28e1..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (c) 2017 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
-# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-# THE POSSIBILITY OF SUCH DAMAGE.
-
-import os.path
-import re
-
-
-def license():
-    return """/*
- * THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT EDIT.
- *
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-"""
-
-
-class Setting:
-    def __init__(self, name):
-        self.name = name
-        self.type = 'bool'
-        self.initial = None
-        self.conditional = None
-        self.onChange = None
-        self.getter = None
-
-    def __str__(self):
-        result = self.name + ' TYPE:' + self.type
-        if (self.initial):
-            result += ' INIT:' + self.initial
-        if (self.conditional):
-            result += ' COND:' + self.conditional
-        if (self.onChange):
-            result += ' CHANGE:' + self.onChange
-        if (self.getter):
-            result += ' GETTER:' + self.getter
-        return result
-
-    def typeIsValueType(self):
-        if self.type == 'String':
-            return False
-        if self.type == 'URL':
-            return False
-        return True
-
-    def setterFunctionName(self):
-        for prefix in ['css', 'xss', 'ftp', 'dom', 'dns']:
-            if self.name.startswith(prefix):
-                return 'set' + uppercaseFirstN(self.name, len(prefix))
-        return 'set' + uppercaseFirstN(self.name, 1)
-
-    def getterFunctionName(self):
-        return self.getter or self.name
-
-    def setterChangeFunctionName(self):
-        return self.onChange
-
-    def hasComplexSetter(self):
-        return self.onChange != None
-
-    def idlType(self):
-        # FIXME: Add support for more types including enumerate types.
-        if self.type == 'int':
-            return 'long'
-        if self.type == 'unsigned':
-            return 'unsigned long'
-        if self.type == 'double':
-            return 'double'
-        if self.type == 'float':
-            return 'float'
-        if self.type == 'String':
-            return 'DOMString'
-        if self.type == 'bool':
-            return 'boolean'
-        return None
-
-
-def uppercaseFirstN(string, n):
-    return string[:n].upper() + string[n:]
-
-
-def makePreferredConditional(conditional):
-    return conditional.split('|')[0]
-
-
-def makeConditionalString(conditional):
-    conditionals = conditional.split('|')
-    return 'ENABLE(' + ') || ENABLE('.join(conditionals) + ')'
-
-
-def parseInput(input):
-    settings = {}
-
-    with open(input, 'r') as file:
-        for line in file:
-            if not line.startswith('#') and not line.isspace():
-
-                (name, optionsString) = line.rstrip().split(' ', 1)
-
-                options = re.split(r' *, *', optionsString)
-
-                setting = Setting(name)
-                for option in options:
-                    (name, value) = re.split(r' *= *', option)
-                    if (name == 'type'):
-                        setting.type = value
-                    if (name == 'initial'):
-                        setting.initial = value
-                    if (name == 'conditional'):
-                        setting.conditional = value
-                    if (name == 'onChange'):
-                        setting.onChange = value
-                    if (name == 'getter'):
-                        setting.getter = value
-
-                # FIXME: ASSERT something about setting.initial
-
-                settings[setting.name] = setting
-
-    return settings
diff --git a/Source/WebCore/Scripts/GenerateSettings/__init__.py b/Source/WebCore/Scripts/GenerateSettings/__init__.py
deleted file mode 100644 (file)
index 54a1111..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-# Required for Python to search this directory for module files
-
-from GenerateSettings import *
diff --git a/Source/WebCore/Scripts/SettingsTemplates/InternalSettingsGenerated.cpp.erb b/Source/WebCore/Scripts/SettingsTemplates/InternalSettingsGenerated.cpp.erb
new file mode 100644 (file)
index 0000000..3561b48
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+ * THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT EDIT.
+ *
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "InternalSettingsGenerated.h"
+
+#include "Page.h"
+#include "Settings.h"
+
+namespace WebCore {
+
+InternalSettingsGenerated::InternalSettingsGenerated(Page* page)
+    : m_page(page)
+<%- for @setting in @settings do -%>
+<%- if @setting.idlType -%>
+<%- if @setting.conditional -%>
+#if ENABLE(<%= @setting.conditional %>)
+<%- end -%>
+    , m_<%= @setting.name %>(page->settings().<%= @setting.getterFunctionName %>())
+<%- if @setting.conditional -%>
+#endif
+<%- end -%>
+<%- end -%>
+<%- end -%>
+{
+}
+
+InternalSettingsGenerated::~InternalSettingsGenerated()
+{
+}
+
+void InternalSettingsGenerated::resetToConsistentState()
+{
+<%- for @setting in @settings do -%>
+<%- if @setting.idlType -%>
+<%- if @setting.conditional -%>
+#if ENABLE(<%= @setting.conditional %>)
+<%- end -%>
+    m_page->settings().<%= @setting.setterFunctionName %>(m_<%= @setting.name %>);
+<%- if @setting.conditional -%>
+#endif
+<%- end -%>
+<%- end -%>
+<%- end -%>
+}
+
+<%- for @setting in @settings do -%>
+<%- if @setting.idlType -%>
+void InternalSettingsGenerated::<%= @setting.setterFunctionName %>(<%= @setting.parameterType %> <%= @setting.name %>)
+{
+<%- if @setting.conditional -%>
+#if ENABLE(<%= @setting.conditional %>)
+    m_page->settings().<%= @setting.setterFunctionName %>(<%= @setting.name %>);
+#else
+    UNUSED_PARAM(<%= @setting.name %>);
+#endif
+<%- else -%>
+    m_page->settings().<%= @setting.setterFunctionName %>(<%= @setting.name %>);
+<%- end -%>
+}
+
+<%- end -%>
+<%- end -%>
+} // namespace WebCore
diff --git a/Source/WebCore/Scripts/SettingsTemplates/InternalSettingsGenerated.h.erb b/Source/WebCore/Scripts/SettingsTemplates/InternalSettingsGenerated.h.erb
new file mode 100644 (file)
index 0000000..322e080
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT EDIT.
+ *
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include <wtf/RefCounted.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class Page;
+
+class InternalSettingsGenerated : public RefCounted<InternalSettingsGenerated> {
+public:
+    explicit InternalSettingsGenerated(Page*);
+    virtual ~InternalSettingsGenerated();
+
+    void resetToConsistentState();
+
+<%- for @setting in @settings do -%>
+<%- if @setting.idlType -%>
+    void <%= @setting.setterFunctionName %>(<%= @setting.parameterType %> <%= @setting.name %>);
+<%- end -%>
+<%- end -%>
+
+private:
+    Page* m_page;
+
+<%- for @setting in @settings do -%>
+<%- if @setting.idlType -%>
+<%- if @setting.conditional -%>
+#if ENABLE(<%= @setting.conditional %>)
+<%- end -%>
+    <%= @setting.type %> m_<%= @setting.name %>;
+<%- if @setting.conditional -%>
+#endif
+<%- end -%>
+<%- end -%>
+<%- end -%>
+};
+
+} // namespace WebCore
diff --git a/Source/WebCore/Scripts/SettingsTemplates/InternalSettingsGenerated.idl.erb b/Source/WebCore/Scripts/SettingsTemplates/InternalSettingsGenerated.idl.erb
new file mode 100644 (file)
index 0000000..978337b
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT EDIT.
+ *
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    NoInterfaceObject,
+    ExportMacro=WEBCORE_TESTSUPPORT_EXPORT,
+] interface InternalSettingsGenerated {
+<%- for @setting in @settings do -%>
+<%- if @setting.idlType -%>
+    void <%= @setting.setterFunctionName %>(<%= @setting.idlType %> <%= @setting.name %>);
+<%- end -%>
+<%- end -%>
+};
diff --git a/Source/WebCore/Scripts/SettingsTemplates/Settings.cpp.erb b/Source/WebCore/Scripts/SettingsTemplates/Settings.cpp.erb
new file mode 100644 (file)
index 0000000..1ff7e93
--- /dev/null
@@ -0,0 +1,100 @@
+/*
+ * THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT EDIT.
+ *
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "Settings.h"
+
+#include "Page.h"
+#include "SettingsDefaultValues.h"
+
+namespace WebCore {
+
+Ref<Settings> Settings::create(Page* page)
+{
+    return adoptRef(*new Settings(page));
+}
+
+Settings::Settings(Page* page)
+    : SettingsBase(page)
+<%- for @setting in @unconditionalNonBoolSetting do -%>
+    , m_<%= @setting.name %>(<%= @setting.initial %>)
+<%- end -%>
+<%- for @conditional in @conditionals do -%>
+<%- if @conditional.nonBoolSettings.length != 0 -%>
+#if ENABLE(<%= @conditional.condition %>)
+<%- for @setting in @conditional.nonBoolSettings -%>
+    , m_<%= @setting.name %>(<%= @setting.initial %>)
+<%- end -%>
+#endif
+<%- end -%>
+<%- end -%>
+<%- for @setting in @unconditionalBoolSetting do -%>
+    , m_<%= @setting.name %>(<%= @setting.initial %>)
+<%- end -%>
+<%- for @conditional in @conditionals do -%>
+<%- if @conditional.boolSettings.length != 0 -%>
+#if ENABLE(<%= @conditional.condition %>)
+<%- for @setting in @conditional.boolSettings -%>
+    , m_<%= @setting.name %>(<%= @setting.initial %>)
+<%- end -%>
+#endif
+<%- end -%>
+<%- end -%>
+{
+}
+
+Settings::~Settings()
+{
+}
+
+<%- for @setting in @unconditionalSettingWithComplexSetters do -%>
+void Settings::<%= @setting.setterFunctionName %>(<%= @setting.parameterType %> <%= @setting.name %>)
+{
+    if (m_<%= @setting.name %> == <%= @setting.name %>)
+        return;
+    m_<%= @setting.name %> = <%= @setting.name %>;
+    <%= @setting.onChange %>();
+}
+
+<%- end -%>
+<%- for @conditional in @conditionals do -%>
+<%- if @conditional.settingsWithComplexSetters.length != 0 -%>
+#if ENABLE(<%= @conditional.condition %>)
+<%- for @setting in @conditional.settingsWithComplexSetters -%>
+void Settings::<%= @setting.setterFunctionName %>(<%= @setting.parameterType %> <%= @setting.name %>)
+{
+    if (m_<%= @setting.name %> == <%= @setting.name %>)
+        return;
+    m_<%= @setting.name %> = <%= @setting.name %>;
+    <%= @setting.onChange %>();
+}
+<%- end -%>
+#endif
+
+<%- end -%>
+<%- end -%>
+}
diff --git a/Source/WebCore/Scripts/SettingsTemplates/Settings.h.erb b/Source/WebCore/Scripts/SettingsTemplates/Settings.h.erb
new file mode 100644 (file)
index 0000000..c98c845
--- /dev/null
@@ -0,0 +1,98 @@
+/*
+ * THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT EDIT.
+ *
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "SettingsBase.h"
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class Page;
+
+class Settings : public SettingsBase, public RefCounted<Settings> {
+    WTF_MAKE_NONCOPYABLE(Settings); WTF_MAKE_FAST_ALLOCATED;
+public:
+    static Ref<Settings> create(Page*);
+    ~Settings();
+
+<%- for @setting in @unconditionalSetting do -%>
+    <%= @setting.parameterType %> <%= @setting.getterFunctionName %>() const { return m_<%= @setting.name %>; } 
+    <%- if @setting.hasComplexSetter? -%>
+    WEBCORE_EXPORT void <%= @setting.setterFunctionName %>(<%= @setting.parameterType %>);
+    <%- else -%>
+    void <%= @setting.setterFunctionName %>(<%= @setting.parameterType %> <%= @setting.name %>) { m_<%= @setting.name %> = <%= @setting.name %>; }
+    <%- end -%>
+<%- end -%>
+
+<%- for @conditional in @conditionals do -%>
+#if ENABLE(<%= @conditional.condition %>)
+<%- for @setting in @conditional.settings do -%>
+    <%= @setting.parameterType %> <%= @setting.getterFunctionName %>() const { return m_<%= @setting.name %>; } 
+    <%- if @setting.hasComplexSetter? -%>
+    WEBCORE_EXPORT void <%= @setting.setterFunctionName %>(<%= @setting.parameterType %>);
+    <%- else -%>
+    void <%= @setting.setterFunctionName %>(<%= @setting.parameterType %> <%= @setting.name %>) { m_<%= @setting.name %> = <%= @setting.name %>; }
+    <%- end -%>
+<%- end -%>
+#endif
+
+<%- end -%>
+
+private:
+    explicit Settings(Page*);
+
+<%- for @setting in @unconditionalNonBoolSetting do -%>
+    <%= @setting.type %> m_<%= @setting.name %>;
+<%- end -%>
+
+<%- for @conditional in @conditionals do -%>
+<%- if @conditional.nonBoolSettings.length != 0 -%>
+#if ENABLE(<%= @conditional.condition %>)
+<%- for @setting in @conditional.nonBoolSettings -%>
+    <%= @setting.type %> m_<%= @setting.name %>;
+<%- end -%>
+#endif
+<%- end -%>
+<%- end -%>
+
+<%- for @setting in @unconditionalBoolSetting do -%>
+    <%= @setting.type %> m_<%= @setting.name %> : 1;
+<%- end -%>
+
+<%- for @conditional in @conditionals do -%>
+<%- if @conditional.boolSettings.length != 0 -%>
+#if ENABLE(<%= @conditional.condition %>)
+<%- for @setting in @conditional.boolSettings -%>
+    <%= @setting.type %> m_<%= @setting.name %> : 1;
+<%- end -%>
+#endif
+<%- end -%>
+<%- end -%>
+};
+
+}
index 5b342ae..6f81212 100644 (file)
                7C39C36E1DDBA3E000FEFB29 /* SVGPathSegListValues.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPathSegListValues.cpp; sourceTree = "<group>"; };
                7C39C36F1DDBA3E000FEFB29 /* SVGPathSegListValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathSegListValues.h; sourceTree = "<group>"; };
                7C39C3701DDBA44000FEFB29 /* SVGPathSegList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPathSegList.cpp; sourceTree = "<group>"; };
-               7C3A8C5E1F7D72B400F46E84 /* GenerateSettings */ = {isa = PBXFileReference; lastKnownFileType = folder; name = GenerateSettings; path = Scripts/GenerateSettings; sourceTree = "<group>"; };
-               7C3A8C601F7D72B500F46E84 /* GenerateSettings.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; name = GenerateSettings.py; path = Scripts/GenerateSettings.py; sourceTree = "<group>"; };
                7C3A91E51C963B8800D1A7E3 /* ClipboardAccessPolicy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClipboardAccessPolicy.h; sourceTree = "<group>"; };
                7C3B796F1908757B00B47A2D /* UserMessageHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserMessageHandler.cpp; sourceTree = "<group>"; };
                7C3B79701908757B00B47A2D /* UserMessageHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserMessageHandler.h; sourceTree = "<group>"; };
                7CD344121F3108E2000DCD49 /* JSMutationCallback.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSMutationCallback.cpp; sourceTree = "<group>"; };
                7CD494CA1A86EB1D000A87EC /* RenderAttachment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderAttachment.cpp; sourceTree = "<group>"; };
                7CD494CB1A86EB1D000A87EC /* RenderAttachment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderAttachment.h; sourceTree = "<group>"; };
+               7CDE73961F9BD59500390312 /* Settings.yaml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Settings.yaml; sourceTree = "<group>"; };
                7CDE8EBC1F193BC500168FE7 /* CSSStyleDeclaration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSStyleDeclaration.cpp; sourceTree = "<group>"; };
                7CE191471F2A98AF00272F78 /* FetchRequestInit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FetchRequestInit.h; sourceTree = "<group>"; };
                7CE191491F2A98B000272F78 /* FetchRequestInit.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = FetchRequestInit.idl; sourceTree = "<group>"; };
                BC53DA471143134D000D817E /* DOMWrapperWorld.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMWrapperWorld.cpp; sourceTree = "<group>"; };
                BC5823F40C0A98DF0053F1B5 /* JSHTMLElementCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLElementCustom.cpp; sourceTree = "<group>"; };
                BC5825F20C0B89380053F1B5 /* JSCSSStyleDeclarationCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCSSStyleDeclarationCustom.cpp; sourceTree = "<group>"; };
-               BC59DEF8169DEDC30016AC34 /* Settings.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = Settings.in; sourceTree = "<group>"; };
                BC5A12DD0DC0414800C9AFAD /* CSSReflectValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSReflectValue.cpp; sourceTree = "<group>"; };
                BC5A12DE0DC0414800C9AFAD /* CSSReflectValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSReflectValue.h; sourceTree = "<group>"; };
                BC5A86810C33676000EEA649 /* DOMSelection.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DOMSelection.cpp; sourceTree = "<group>"; };
                        isa = PBXGroup;
                        children = (
                                F48389791E1DD23A0076B7EA /* EditingHistory */,
-                               7C3A8C5E1F7D72B400F46E84 /* GenerateSettings */,
                                3717D7E517ECC3A6003C276D /* extract-localizable-strings.pl */,
-                               7C3A8C601F7D72B500F46E84 /* GenerateSettings.py */,
                                37D456FB1A9A50B6003330A1 /* LocalizableStrings.pm */,
                        );
                        name = Scripts;
                                BCD0E0F90E972C3500265DEA /* SecurityOriginHash.h */,
                                974D2DA2146A535D00D51F8B /* SecurityPolicy.cpp */,
                                974D2DA3146A535D00D51F8B /* SecurityPolicy.h */,
-                               BC59DEF8169DEDC30016AC34 /* Settings.in */,
+                               7CDE73961F9BD59500390312 /* Settings.yaml */,
                                7CC6609B1F93057900D500E9 /* SettingsBase.cpp */,
                                7CC660991F93057800D500E9 /* SettingsBase.h */,
                                7C6EFEEA1F946A2E00FFAD41 /* SettingsDefaultValues.h */,
index 9f4d541..88a10bb 100644 (file)
@@ -203,7 +203,7 @@ endmacro()
 
 
 macro(GENERATE_SETTINGS_MACROS _infile _outfile)
-    set(NAMES_GENERATOR ${WEBCORE_DIR}/Scripts/GenerateSettings.py)
+    set(NAMES_GENERATOR ${WEBCORE_DIR}/Scripts/GenerateSettings.rb)
 
     # Do not list the output in more than one independent target that may
     # build in parallel or the two instances of the rule may conflict.
@@ -216,14 +216,11 @@ macro(GENERATE_SETTINGS_MACROS _infile _outfile)
     )
 
     set(GENERATE_SETTINGS_SCRIPTS
-        ${WEBCORE_DIR}/Scripts/GenerateSettings/GenerateInternalSettingsHeaderFile.py
-        ${WEBCORE_DIR}/Scripts/GenerateSettings/GenerateInternalSettingsIDLFile.py
-        ${WEBCORE_DIR}/Scripts/GenerateSettings/GenerateInternalSettingsImplementationFile.py
-        ${WEBCORE_DIR}/Scripts/GenerateSettings/GenerateSettingsHeaderFile.py
-        ${WEBCORE_DIR}/Scripts/GenerateSettings/GenerateSettingsImplementationFile.py
-        ${WEBCORE_DIR}/Scripts/GenerateSettings/GenerateSettings.py
-        ${WEBCORE_DIR}/Scripts/GenerateSettings/Settings.py
-        ${WEBCORE_DIR}/Scripts/GenerateSettings/__init__.py
+        ${WEBCORE_DIR}/Scripts/SettingsTemplates/InternalSettingsGenerated.cpp.erb
+        ${WEBCORE_DIR}/Scripts/SettingsTemplates/InternalSettingsGenerated.idl.erb
+        ${WEBCORE_DIR}/Scripts/SettingsTemplates/InternalSettingsGenerated.h.erb
+        ${WEBCORE_DIR}/Scripts/SettingsTemplates/Settings.cpp.erb
+        ${WEBCORE_DIR}/Scripts/SettingsTemplates/Settings.h.erb
     )
 
     set(_args BYPRODUCTS ${_extra_output})
@@ -231,7 +228,7 @@ macro(GENERATE_SETTINGS_MACROS _infile _outfile)
         OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/${_outfile}
         MAIN_DEPENDENCY ${_infile}
         DEPENDS ${NAMES_GENERATOR} ${GENERATE_SETTINGS_SCRIPTS} ${SCRIPTS_BINDINGS}
-        COMMAND ${PYTHON_EXECUTABLE} ${NAMES_GENERATOR} --input ${_infile} --outputDir ${DERIVED_SOURCES_WEBCORE_DIR}
+        COMMAND ${RUBY_EXECUTABLE} ${NAMES_GENERATOR} --input ${_infile} --outputDir ${DERIVED_SOURCES_WEBCORE_DIR}
         VERBATIM ${_args})
 endmacro()
 
diff --git a/Source/WebCore/page/Settings.in b/Source/WebCore/page/Settings.in
deleted file mode 100644 (file)
index 7d4020d..0000000
+++ /dev/null
@@ -1,363 +0,0 @@
-# FIXME: Add support for global settings.
-# FIXME: Add support for custom getters/setters.
-
-defaultTextEncodingName type=String
-ftpDirectoryTemplatePath type=String
-localStorageDatabasePath type=String
-editableLinkBehavior type=EditableLinkBehavior, initial=EditableLinkDefaultBehavior
-textDirectionSubmenuInclusionBehavior type=TextDirectionSubmenuInclusionBehavior, initial=TextDirectionSubmenuAutomaticallyIncluded
-pdfImageCachingPolicy type=PDFImageCachingPolicy, initial = PDFImageCachingDefault
-passwordEchoDurationInSeconds type=double, initial=1
-
-# Sets the magnification value for validation message timer.  If the
-# magnification value is N, a validation message disappears automatically after
-# <message length> * N / 1000 seconds.  If N is equal to or less than 0, a
-# validation message doesn't disappears automaticaly.
-validationMessageTimerMagnification type=int, initial=50
-
-# Number of pixels below which 2D canvas is rendered in software
-# even if hardware acceleration is enabled.
-# Hardware acceleration is useful for large canvases where it can avoid the
-# pixel bandwidth between the CPU and GPU. But GPU acceleration comes at
-# a price - extra back-buffer and texture copy. Small canvases are also
-# widely used for stylized fonts. Anti-aliasing text in hardware at that
-# scale is generally slower. So below a certain size it is better to
-# draw canvas in software.
-minimumAccelerated2dCanvasSize type=int, initial=257*256
-
-maximumAccelerated2dCanvasSize type=unsigned, initial=5120*2880
-
-layoutFallbackWidth type=int, initial=980
-deviceWidth type=int, initial=0
-deviceHeight type=int, initial=0
-
-# Allow clients concerned with memory consumption to set a quota on session storage
-# since the memory used won't be released until the Page is destroyed.
-sessionStorageQuota type=unsigned, initial=StorageMap::noQuota
-
-minimumFontSize type=int, initial=0, onChange=setNeedsRecalcStyleInAllFrames
-minimumLogicalFontSize type=int, initial=0, onChange=setNeedsRecalcStyleInAllFrames
-defaultFontSize type=int, initial=16, onChange=setNeedsRecalcStyleInAllFrames
-defaultFixedFontSize type=int, initial=0, onChange=setNeedsRecalcStyleInAllFrames
-
-editingBehaviorType type=EditingBehaviorType, initial=editingBehaviorTypeForPlatform()
-maximumHTMLParserDOMTreeDepth type=unsigned, initial=defaultMaximumHTMLParserDOMTreeDepth
-
-# This setting only affects site icon image loading if loadsImagesAutomatically setting is false and this setting is true.
-# All other permutations still heed loadsImagesAutomatically setting.
-loadsSiteIconsIgnoringImageLoadingSetting initial=false
-
-caretBrowsingEnabled initial=false
-preventKeyboardDOMEventDispatch initial=false
-localStorageEnabled initial=false
-allowUniversalAccessFromFileURLs initial=true
-allowFileAccessFromFileURLs initial=true
-needsStorageAccessFromFileURLsQuirk initial=true
-javaScriptCanOpenWindowsAutomatically initial=false
-javaScriptCanAccessClipboard initial=false
-shouldPrintBackgrounds initial=false
-usesDashboardBackwardCompatibilityMode initial=false, conditional=DASHBOARD_SUPPORT
-clipboardAccessPolicy type=ClipboardAccessPolicy, initial=ClipboardAccessPolicy::RequiresUserGesture
-
-textAreasAreResizable initial=false, onChange=setNeedsRecalcStyleInAllFrames
-authorAndUserStylesEnabled initial=true, onChange=setNeedsRecalcStyleInAllFrames
-userStyleSheetLocation type=URL, onChange=userStyleSheetLocationChanged
-acceleratedCompositingEnabled initial=true, onChange=setNeedsRecalcStyleInAllFrames
-acceleratedCompositedAnimationsEnabled initial=true, onChange=setNeedsRecalcStyleInAllFrames
-showDebugBorders initial=false, onChange=setNeedsRecalcStyleInAllFrames
-showRepaintCounter initial=false, onChange=setNeedsRecalcStyleInAllFrames
-visibleDebugOverlayRegions type=DebugOverlayRegions, initial=0
-showTiledScrollingIndicator initial=false
-resourceUsageOverlayVisible initial=false, onChange=resourceUsageOverlayVisibleChanged, condition=RESOURCE_USAGE
-
-# This is a quirk we are pro-actively applying to old applications. It changes keyboard event dispatching,
-# making keyIdentifier available on keypress events, making charCode available on keydown/keyup events,
-# and getting keypress dispatched in more cases.
-needsKeyboardEventDisambiguationQuirks initial=false
-
-treatsAnyTextCSSLinkAsStylesheet initial=false
-shrinksStandaloneImagesToFit initial=true
-pageCacheSupportsPlugins initial=false
-showsURLsInToolTips initial=false
-showsToolTipOverTruncatedText initial=false
-forceFTPDirectoryListings initial=false
-developerExtrasEnabled initial=false
-scriptMarkupEnabled initial=true
-needsSiteSpecificQuirks initial=false
-domTimersThrottlingEnabled initial=true
-webArchiveDebugModeEnabled initial=false, conditional=WEB_ARCHIVE
-localFileContentSniffingEnabled initial=false
-offlineWebApplicationCacheEnabled initial=false
-enforceCSSMIMETypeInNoQuirksMode initial=true
-usesEncodingDetector initial=false
-allowScriptsToCloseWindows initial=false
-canvasUsesAcceleratedDrawing initial=false
-acceleratedDrawingEnabled initial=false
-displayListDrawingEnabled initial=false
-acceleratedFiltersEnabled initial=false
-useLegacyTextAlignPositionedElementBehavior initial=false
-javaScriptRuntimeFlags type=JSC::RuntimeFlags
-
-# FIXME: This should really be disabled by default as it makes platforms that don't support the feature download files
-# they can't use by. Leaving enabled for now to not change existing behavior.
-downloadableBinaryFontsEnabled initial=true
-
-xssAuditorEnabled initial=false
-acceleratedCompositingForFixedPositionEnabled initial=defaultAcceleratedCompositingForFixedPositionEnabled
-acceleratedCompositingForOverflowScrollEnabled initial=false
-rubberBandingForSubScrollableRegionsEnabled initial=true, conditional=RUBBER_BANDING
-
-experimentalNotificationsEnabled initial=false
-webGLEnabled initial=false
-webGLErrorsToConsoleEnabled initial=true
-forceSoftwareWebGLRendering initial=false
-forceWebGLUsesLowPower initial=false
-accelerated2dCanvasEnabled initial=false
-loadDeferringEnabled initial=true
-webAudioEnabled initial=false
-paginateDuringLayoutEnabled initial=false
-fullScreenEnabled initial=false, conditional=FULLSCREEN_API
-asynchronousSpellCheckingEnabled initial=false
-
-# This feature requires an implementation of ValidationMessageClient.
-interactiveFormValidationEnabled initial=false
-
-usePreHTML5ParserQuirks initial=false
-hyperlinkAuditingEnabled initial=false
-crossOriginCheckInGetMatchedCSSRulesDisabled initial=false
-forceCompositingMode initial=false
-shouldInjectUserScriptsInInitialEmptyDocument initial=false
-fixedElementsLayoutRelativeToFrame initial=false
-allowDisplayOfInsecureContent initial=false
-allowRunningOfInsecureContent initial=false
-requiresUserGestureToLoadVideo initial=defaultRequiresUserGestureToLoadVideo
-videoPlaybackRequiresUserGesture initial=defaultVideoPlaybackRequiresUserGesture
-audioPlaybackRequiresUserGesture initial=defaultAudioPlaybackRequiresUserGesture
-mainContentUserGestureOverrideEnabled initial=false
-mediaUserGestureInheritsFromDocument initial=false
-allowsInlineMediaPlayback initial=defaultAllowsInlineMediaPlayback
-allowsInlineMediaPlaybackAfterFullscreen initial=true
-inlineMediaPlaybackRequiresPlaysInlineAttribute initial=defaultInlineMediaPlaybackRequiresPlaysInlineAttribute
-allowsPictureInPictureMediaPlayback initial=defaultAllowsPictureInPictureMediaPlayback
-mediaControlsScaleWithPageZoom initial=defaultMediaControlsScaleWithPageZoom
-invisibleAutoplayNotPermitted initial=false
-passwordEchoEnabled initial=false
-suppressesIncrementalRendering initial=false
-incrementalRenderingSuppressionTimeoutInSeconds type=double, initial=defaultIncrementalRenderingSuppressionTimeoutInSeconds
-backspaceKeyNavigationEnabled initial=true
-shouldDisplaySubtitles initial=false, conditional=VIDEO_TRACK
-shouldDisplayCaptions initial=false, conditional=VIDEO_TRACK
-shouldDisplayTextDescriptions initial=false, conditional=VIDEO_TRACK
-scrollingCoordinatorEnabled initial=false
-scrollingTreeIncludesFrames initial=defaultScrollingTreeIncludesFrames
-scrollAnimatorEnabled initial=true, conditional=SMOOTH_SCROLLING
-forceUpdateScrollbarsOnMainThreadForPerformanceTesting initial=false
-notificationsEnabled initial=true
-
-# Some apps needs isLoadingInAPISense to account for active subresource loaders.
-needsIsLoadingInAPISenseQuirk initial=false
-
-shouldRespectImageOrientation initial=defaultShouldRespectImageOrientation
-imageSubsamplingEnabled initial=defaultImageSubsamplingEnabled
-wantsBalancedSetDefersLoadingBehavior initial=false
-requestAnimationFrameEnabled initial=true
-
-cookieEnabled initial=true
-mediaEnabled initial=true
-DOMPasteAllowed initial=false
-
-# When enabled, window.blur() does not change focus, and
-# window.focus() only changes focus when invoked from the context that
-# created the window.
-windowFocusRestricted initial=true
-
-diagnosticLoggingEnabled initial=false
-delegatesPageScaling initial=false
-plugInSnapshottingEnabled initial=false
-snapshotAllPlugIns initial=false
-autostartOriginPlugInSnapshottingEnabled initial=true
-primaryPlugInSnapshotDetectionEnabled initial=true
-maximumPlugInSnapshotAttempts type=unsigned, initial=20
-frameFlattening type=FrameFlattening, initial=FrameFlattening::Disabled
-asyncFrameScrollingEnabled initial=false
-
-webSecurityEnabled initial=true
-spatialNavigationEnabled initial=false
-
-autoscrollForDragAndDropEnabled initial=false
-
-unifiedTextCheckerEnabled initial=defaultUnifiedTextCheckerEnabled
-
-logsPageMessagesToSystemConsoleEnabled initial=false
-
-backForwardCacheExpirationInterval type=double, initial=1800
-
-# Some apps could have a default video poster if it is not set.
-defaultVideoPosterURL type=String
-
-smartInsertDeleteEnabled initial=defaultSmartInsertDeleteEnabled
-selectTrailingWhitespaceEnabled initial=defaultSelectTrailingWhitespaceEnabled
-
-useLegacyBackgroundSizeShorthandBehavior initial=false
-fixedBackgroundsPaintRelativeToDocument initial=defaultFixedBackgroundsPaintRelativeToDocument
-
-textAutosizingEnabled initial=defaultTextAutosizingEnabled(), onChange=setNeedsRecalcStyleInAllFrames, conditional=TEXT_AUTOSIZING
-textAutosizingWindowSizeOverride type=IntSize, onChange=setNeedsRecalcStyleInAllFrames, conditional=TEXT_AUTOSIZING
-minimumZoomFontSize type=float, initial=defaultMinimumZoomFontSize(), conditional=TEXT_AUTOSIZING
-
-subpixelAntialiasedLayerTextEnabled initial=false, onChange=setNeedsRecalcStyleInAllFrames
-simpleLineLayoutEnabled initial=true, onChange=setNeedsRecalcStyleInAllFrames
-simpleLineLayoutDebugBordersEnabled initial=false, onChange=setNeedsRecalcStyleInAllFrames
-
-subpixelCSSOMElementMetricsEnabled initial=false
-
-useGiantTiles initial=false
-
-mediaSourceEnabled initial=true, conditional=MEDIA_SOURCE
-
-# FIXME: Rename to allowMultiElementImplicitFormSubmission once we upstream the iOS changes to WebView.mm.
-allowMultiElementImplicitSubmission initial=false
-
-allowsAirPlayForMediaPlayback initial=true, conditional=WIRELESS_PLAYBACK_TARGET
-
-shouldConvertPositionStyleOnCopy initial=false
-
-maxParseDuration type=double, initial=-1
-standalone initial=false
-telephoneNumberParsingEnabled initial=false
-mediaDataLoadsAutomatically initial=defaultMediaDataLoadsAutomatically
-alwaysUseAcceleratedOverflowScroll initial=false
-imageControlsEnabled initial=false, conditional=SERVICE_CONTROLS
-
-enableInheritURIQueryComponent initial=false
-
-aggressiveTileRetentionEnabled initial=false
-temporaryTileCohortRetentionEnabled initial=true
-
-useImageDocumentForSubframePDF initial=false
-dataDetectorTypes type=DataDetectorTypes, initial=DataDetectorTypeNone, conditional=DATA_DETECTION
-
-# Allow SourceBuffers to store up to 304MB each, enough for approximately five minutes
-# of 1080p video and stereo audio.
-maximumSourceBufferSize type=int, initial=318767104, conditional=MEDIA_SOURCE
-
-serviceControlsEnabled initial=false, conditional=SERVICE_CONTROLS
-
-appleMailPaginationQuirkEnabled initial=false
-
-deferredCSSParserEnabled initial=false
-
-repaintOutsideLayoutEnabled initial=false
-
-httpEquivEnabled initial=true
-
-# Some ports (e.g. iOS) might choose to display attachments inline, regardless of whether the response includes the
-# HTTP header "Content-Disposition: attachment". This setting enables a sandbox around these attachments. The sandbox
-# enforces all frame sandbox flags (see enum SandboxFlag in SecurityContext.h), and also disables <meta http-equiv>
-# processing and subframe loading.
-contentDispositionAttachmentSandboxEnabled initial=false
-
-userInterfaceDirectionPolicy type=UserInterfaceDirectionPolicy, initial=UserInterfaceDirectionPolicy::Content
-systemLayoutDirection type=TextDirection, initial=LTR
-
-allowContentSecurityPolicySourceStarToMatchAnyProtocol initial=false
-
-selectionPaintingWithoutSelectionGapsEnabled initial=false
-
-shouldConvertInvalidURLsToBlank initial=true
-
-springTimingFunctionEnabled initial=false
-
-treatIPAddressAsDomain initial=false
-
-mediaPreloadingEnabled initial=false
-
-# Runtime-enabled features
-visualViewportEnabled initial=false, onChange=setNeedsRecalcStyleInAllFrames
-
-inputEventsEnabled initial=true
-
-quickTimePluginReplacementEnabled initial=defaultQuickTimePluginReplacementEnabled
-youTubeFlashPluginReplacementEnabled initial=defaultYouTubeFlashPluginReplacementEnabled
-
-forcedColorsAreInvertedAccessibilityValue type=ForcedAccessibilityValue, initial=defaultForcedColorsAreInvertedAccessibilityValue
-forcedDisplayIsMonochromeAccessibilityValue type=ForcedAccessibilityValue, initial=defaultForcedDisplayIsMonochromeAccessibilityValue
-forcedPrefersReducedMotionAccessibilityValue type=ForcedAccessibilityValue, initial=defaultForcedPrefersReducedMotionAccessibilityValue
-
-largeImageAsyncDecodingEnabled initial=true
-animatedImageAsyncDecodingEnabled initial=true
-webkitImageReadyEventEnabled initial=false
-
-shouldSuppressTextInputFromEditingDuringProvisionalNavigation initial=false
-
-langAttributeAwareFormControlUIEnabled initial=false
-
-subresourceIntegrityEnabled initial=true
-
-linkPreconnectEnabled initial=false
-
-beaconAPIEnabled initial=false
-
-geolocationFloorLevelEnabled initial=true
-
-constantPropertiesEnabled initial=false
-
-viewportFitEnabled initial=false
-
-allowMediaContentTypesRequiringHardwareSupportAsFallback initial=false
-
-storageAccessAPIEnabled initial=false
-
-timeWithoutMouseMovementBeforeHidingControls type=Seconds, initial=3_s 
-
-fontFallbackPrefersPictographs initial=false, onChange=setNeedsRecalcStyleInAllFrames
-
-fontLoadTimingOverride type=FontLoadTimingOverride, initial=FontLoadTimingOverride::None
-shouldIgnoreFontLoadCompletions initial=false
-
-paymentRequestEnabled initial=false, conditional=PAYMENT_REQUEST
-applePayEnabled initial=false, conditional=APPLE_PAY
-applePayCapabilityDisclosureAllowed initial=true, conditional=APPLE_PAY
-
-javaEnabled initial=false, getter=isJavaEnabled
-javaEnabledForLocalFiles initial=true, getter=isJavaEnabledForLocalFiles
-
-# Unlike the imagesEnabled setting, this only suppresses the network load of
-# the image URL. A cached image will still be rendered if requested.
-loadsImagesAutomatically initial=false, onChange=imagesEnabledChanged
-imagesEnabled initial=true, getter=areImagesEnabled, onChange=imagesEnabledChanged
-scriptEnabled initial=false, getter=isScriptEnabled, onChange=scriptEnabledChanged
-pluginsEnabled initial=false, getter=arePluginsEnabled, onChange=pluginsEnabledChanged
-
-usesPageCache initial=false, onChange=usesPageCacheChanged
-
-dnsPrefetchingEnabled initial=false, onChange=dnsPrefetchingEnabledChanged
-
-backgroundShouldExtendBeyondPage initial=false, onChange=backgroundShouldExtendBeyondPageChanged
-
-scrollingPerformanceLoggingEnabled initial=false, onChange=scrollingPerformanceLoggingEnabledChanged
-
-hiddenPageDOMTimerThrottlingEnabled initial=false, onChange=hiddenPageDOMTimerThrottlingStateChanged
-hiddenPageDOMTimerThrottlingAutoIncreases initial=false, onChange=hiddenPageDOMTimerThrottlingStateChanged
-hiddenPageCSSAnimationSuspensionEnabled initial=false, onChange=hiddenPageCSSAnimationSuspensionEnabledChanged
-
-storageBlockingPolicy type=SecurityOrigin::StorageBlockingPolicy, initial=SecurityOrigin::AllowAllStorage, onChange=storageBlockingPolicyChanged
-
-# Only set by Layout Tests.
-mediaTypeOverride type=String, initial="screen", onChange=mediaTypeOverrideChanged
-
-
-fontRenderingMode type=FontRenderingMode, initial=FontRenderingMode::Normal
-
-preferMIMETypeForImages initial=false
-
-forcePendingWebGLPolicy initial=false, getter=isForcePendingWebGLPolicy
-
-mediaKeysStorageDirectory type=String, conditional=LEGACY_ENCRYPTED_MEDIA
-mediaDeviceIdentifierStorageDirectory type=String, conditional=MEDIA_STREAM
-
-# FIXME: This quirk is needed because of Radar 4674537 and 5211271. We need to phase it out once Adobe
-# can fix the bug from their end.
-needsAdobeFrameReloadingQuirk initial=false, getter=needsAcrobatFrameReloadingQuirk
-
-touchEventEmulationEnabled initial=false, getter=isTouchEventEmulationEnabled, conditional=TOUCH_EVENTS
diff --git a/Source/WebCore/page/Settings.yaml b/Source/WebCore/page/Settings.yaml
new file mode 100644 (file)
index 0000000..55cbb68
--- /dev/null
@@ -0,0 +1,693 @@
+# FIXME: Add support for global settings.
+# FIXME: Add support for custom getters/setters.
+
+defaultTextEncodingName:
+  type: String
+ftpDirectoryTemplatePath:
+  type: String
+localStorageDatabasePath:
+  type: String
+editableLinkBehavior:
+  type: EditableLinkBehavior
+  initial: EditableLinkDefaultBehavior
+textDirectionSubmenuInclusionBehavior:
+  type: TextDirectionSubmenuInclusionBehavior
+  initial: TextDirectionSubmenuAutomaticallyIncluded
+pdfImageCachingPolicy:
+  type: PDFImageCachingPolicy
+  initial: PDFImageCachingDefault
+passwordEchoDurationInSeconds:
+  type: double
+  initial: 1
+
+# Sets the magnification value for validation message timer.  If the
+# magnification value is N, a validation message disappears automatically after
+# <message length> * N / 1000 seconds.  If N is equal to or less than 0, a
+# validation message doesn't disappears automaticaly.
+validationMessageTimerMagnification:
+  type: int
+  initial: 50
+
+# Number of pixels below which 2D canvas is rendered in software
+# even if hardware acceleration is enabled.
+# Hardware acceleration is useful for large canvases where it can avoid the
+# pixel bandwidth between the CPU and GPU. But GPU acceleration comes at
+# a price - extra back-buffer and texture copy. Small canvases are also
+# widely used for stylized fonts. Anti-aliasing text in hardware at that
+# scale is generally slower. So below a certain size it is better to
+# draw canvas in software.
+minimumAccelerated2dCanvasSize:
+  type: int
+  initial: 257*256
+
+maximumAccelerated2dCanvasSize:
+  type: unsigned
+  initial: 5120*2880
+
+layoutFallbackWidth:
+  type: int
+  initial: 980
+deviceWidth:
+  type: int
+  initial: 0
+deviceHeight:
+  type: int
+  initial: 0
+
+# Allow clients concerned with memory consumption to set a quota on session storage
+# since the memory used won't be released until the Page is destroyed.
+sessionStorageQuota:
+  type: unsigned
+  initial: StorageMap::noQuota
+
+minimumFontSize:
+  type: int
+  initial: 0
+  onChange: setNeedsRecalcStyleInAllFrames
+minimumLogicalFontSize:
+  type: int
+  initial: 0
+  onChange: setNeedsRecalcStyleInAllFrames
+defaultFontSize:
+  type: int
+  initial: 16
+  onChange: setNeedsRecalcStyleInAllFrames
+defaultFixedFontSize:
+  type: int
+  initial: 0
+  onChange: setNeedsRecalcStyleInAllFrames
+
+editingBehaviorType:
+  type: EditingBehaviorType
+  initial: editingBehaviorTypeForPlatform()
+maximumHTMLParserDOMTreeDepth:
+  type: unsigned
+  initial: defaultMaximumHTMLParserDOMTreeDepth
+
+# This setting only affects site icon image loading if loadsImagesAutomatically setting is false and this setting is true.
+# All other permutations still heed loadsImagesAutomatically setting.
+loadsSiteIconsIgnoringImageLoadingSetting:
+  initial: false
+
+caretBrowsingEnabled:
+  initial: false
+preventKeyboardDOMEventDispatch:
+  initial: false
+localStorageEnabled:
+  initial: false
+allowUniversalAccessFromFileURLs:
+  initial: true
+allowFileAccessFromFileURLs:
+  initial: true
+needsStorageAccessFromFileURLsQuirk:
+  initial: true
+javaScriptCanOpenWindowsAutomatically:
+  initial: false
+javaScriptCanAccessClipboard:
+  initial: false
+shouldPrintBackgrounds:
+  initial: false
+usesDashboardBackwardCompatibilityMode:
+  initial: false
+  conditional: DASHBOARD_SUPPORT
+clipboardAccessPolicy:
+  type: ClipboardAccessPolicy
+  initial: ClipboardAccessPolicy::RequiresUserGesture
+
+textAreasAreResizable:
+  initial: false
+  onChange: setNeedsRecalcStyleInAllFrames
+authorAndUserStylesEnabled:
+  initial: true
+  onChange: setNeedsRecalcStyleInAllFrames
+userStyleSheetLocation:
+  type: URL
+  onChange: userStyleSheetLocationChanged
+acceleratedCompositingEnabled:
+  initial: true
+  onChange: setNeedsRecalcStyleInAllFrames
+acceleratedCompositedAnimationsEnabled:
+  initial: true
+  onChange: setNeedsRecalcStyleInAllFrames
+showDebugBorders:
+  initial: false
+  onChange: setNeedsRecalcStyleInAllFrames
+showRepaintCounter:
+  initial: false
+  onChange: setNeedsRecalcStyleInAllFrames
+visibleDebugOverlayRegions:
+  type: DebugOverlayRegions
+  initial: 0
+showTiledScrollingIndicator:
+  initial: false
+resourceUsageOverlayVisible:
+  initial: false
+  onChange: resourceUsageOverlayVisibleChanged
+  condition: RESOURCE_USAGE
+
+# This is a quirk we are pro-actively applying to old applications. It changes keyboard event dispatching,
+# making keyIdentifier available on keypress events, making charCode available on keydown/keyup events,
+# and getting keypress dispatched in more cases.
+needsKeyboardEventDisambiguationQuirks:
+  initial: false
+
+treatsAnyTextCSSLinkAsStylesheet:
+  initial: false
+shrinksStandaloneImagesToFit:
+  initial: true
+pageCacheSupportsPlugins:
+  initial: false
+showsURLsInToolTips:
+  initial: false
+showsToolTipOverTruncatedText:
+  initial: false
+forceFTPDirectoryListings:
+  initial: false
+developerExtrasEnabled:
+  initial: false
+scriptMarkupEnabled:
+  initial: true
+needsSiteSpecificQuirks:
+  initial: false
+domTimersThrottlingEnabled:
+  initial: true
+webArchiveDebugModeEnabled:
+  initial: false
+  conditional: WEB_ARCHIVE
+localFileContentSniffingEnabled:
+  initial: false
+offlineWebApplicationCacheEnabled:
+  initial: false
+enforceCSSMIMETypeInNoQuirksMode:
+  initial: true
+usesEncodingDetector:
+  initial: false
+allowScriptsToCloseWindows:
+  initial: false
+canvasUsesAcceleratedDrawing:
+  initial: false
+acceleratedDrawingEnabled:
+  initial: false
+displayListDrawingEnabled:
+  initial: false
+acceleratedFiltersEnabled:
+  initial: false
+useLegacyTextAlignPositionedElementBehavior:
+  initial: false
+javaScriptRuntimeFlags:
+  type: JSC::RuntimeFlags
+
+# FIXME: This should really be disabled by default as it makes platforms that don't support the feature download files
+# they can't use by. Leaving enabled for now to not change existing behavior.
+downloadableBinaryFontsEnabled:
+  initial: true
+
+xssAuditorEnabled:
+  initial: false
+acceleratedCompositingForFixedPositionEnabled:
+  initial: defaultAcceleratedCompositingForFixedPositionEnabled
+acceleratedCompositingForOverflowScrollEnabled:
+  initial: false
+rubberBandingForSubScrollableRegionsEnabled:
+  initial: true
+  conditional: RUBBER_BANDING
+
+experimentalNotificationsEnabled:
+  initial: false
+webGLEnabled:
+  initial: false
+webGLErrorsToConsoleEnabled:
+  initial: true
+forceSoftwareWebGLRendering:
+  initial: false
+forceWebGLUsesLowPower:
+  initial: false
+accelerated2dCanvasEnabled:
+  initial: false
+loadDeferringEnabled:
+  initial: true
+webAudioEnabled:
+  initial: false
+paginateDuringLayoutEnabled:
+  initial: false
+fullScreenEnabled:
+  initial: false
+  conditional: FULLSCREEN_API
+asynchronousSpellCheckingEnabled:
+  initial: false
+
+# This feature requires an implementation of ValidationMessageClient.
+interactiveFormValidationEnabled:
+  initial: false
+
+usePreHTML5ParserQuirks:
+  initial: false
+hyperlinkAuditingEnabled:
+  initial: false
+crossOriginCheckInGetMatchedCSSRulesDisabled:
+  initial: false
+forceCompositingMode:
+  initial: false
+shouldInjectUserScriptsInInitialEmptyDocument:
+  initial: false
+fixedElementsLayoutRelativeToFrame:
+  initial: false
+allowDisplayOfInsecureContent:
+  initial: false
+allowRunningOfInsecureContent:
+  initial: false
+requiresUserGestureToLoadVideo:
+  initial: defaultRequiresUserGestureToLoadVideo
+videoPlaybackRequiresUserGesture:
+  initial: defaultVideoPlaybackRequiresUserGesture
+audioPlaybackRequiresUserGesture:
+  initial: defaultAudioPlaybackRequiresUserGesture
+mainContentUserGestureOverrideEnabled:
+  initial: false
+mediaUserGestureInheritsFromDocument:
+  initial: false
+allowsInlineMediaPlayback:
+  initial: defaultAllowsInlineMediaPlayback
+allowsInlineMediaPlaybackAfterFullscreen:
+  initial: true
+inlineMediaPlaybackRequiresPlaysInlineAttribute:
+  initial: defaultInlineMediaPlaybackRequiresPlaysInlineAttribute
+allowsPictureInPictureMediaPlayback:
+  initial: defaultAllowsPictureInPictureMediaPlayback
+mediaControlsScaleWithPageZoom:
+  initial: defaultMediaControlsScaleWithPageZoom
+invisibleAutoplayNotPermitted:
+  initial: false
+passwordEchoEnabled:
+  initial: false
+suppressesIncrementalRendering:
+  initial: false
+incrementalRenderingSuppressionTimeoutInSeconds:
+  type: double
+  initial: defaultIncrementalRenderingSuppressionTimeoutInSeconds
+backspaceKeyNavigationEnabled:
+  initial: true
+shouldDisplaySubtitles:
+  initial: false
+  conditional: VIDEO_TRACK
+shouldDisplayCaptions:
+  initial: false
+  conditional: VIDEO_TRACK
+shouldDisplayTextDescriptions:
+  initial: false
+  conditional: VIDEO_TRACK
+scrollingCoordinatorEnabled:
+  initial: false
+scrollingTreeIncludesFrames:
+  initial: defaultScrollingTreeIncludesFrames
+scrollAnimatorEnabled:
+  initial: true
+  conditional: SMOOTH_SCROLLING
+forceUpdateScrollbarsOnMainThreadForPerformanceTesting:
+  initial: false
+notificationsEnabled:
+  initial: true
+
+# Some apps needs isLoadingInAPISense to account for active subresource loaders.
+needsIsLoadingInAPISenseQuirk:
+  initial: false
+
+shouldRespectImageOrientation:
+  initial: defaultShouldRespectImageOrientation
+imageSubsamplingEnabled:
+  initial: defaultImageSubsamplingEnabled
+wantsBalancedSetDefersLoadingBehavior:
+  initial: false
+requestAnimationFrameEnabled:
+  initial: true
+
+cookieEnabled:
+  initial: true
+mediaEnabled:
+  initial: true
+DOMPasteAllowed:
+  initial: false
+
+# When enabled, window.blur() does not change focus, and
+# window.focus() only changes focus when invoked from the context that
+# created the window.
+windowFocusRestricted:
+  initial: true
+
+diagnosticLoggingEnabled:
+  initial: false
+delegatesPageScaling:
+  initial: false
+plugInSnapshottingEnabled:
+  initial: false
+snapshotAllPlugIns:
+  initial: false
+autostartOriginPlugInSnapshottingEnabled:
+  initial: true
+primaryPlugInSnapshotDetectionEnabled:
+  initial: true
+maximumPlugInSnapshotAttempts:
+  type: unsigned
+  initial: 20
+frameFlattening:
+  type: FrameFlattening
+  initial: FrameFlattening::Disabled
+asyncFrameScrollingEnabled:
+  initial: false
+
+webSecurityEnabled:
+  initial: true
+spatialNavigationEnabled:
+  initial: false
+
+autoscrollForDragAndDropEnabled:
+  initial: false
+
+unifiedTextCheckerEnabled:
+  initial: defaultUnifiedTextCheckerEnabled
+
+logsPageMessagesToSystemConsoleEnabled:
+  initial: false
+
+backForwardCacheExpirationInterval:
+  type: double
+  initial: 1800
+
+# Some apps could have a default video poster if it is not set.
+defaultVideoPosterURL:
+  type: String
+
+smartInsertDeleteEnabled:
+  initial: defaultSmartInsertDeleteEnabled
+selectTrailingWhitespaceEnabled:
+  initial: defaultSelectTrailingWhitespaceEnabled
+
+useLegacyBackgroundSizeShorthandBehavior:
+  initial: false
+fixedBackgroundsPaintRelativeToDocument:
+  initial: defaultFixedBackgroundsPaintRelativeToDocument
+
+textAutosizingEnabled:
+  initial: defaultTextAutosizingEnabled()
+  onChange: setNeedsRecalcStyleInAllFrames
+  conditional: TEXT_AUTOSIZING
+textAutosizingWindowSizeOverride:
+  type: IntSize
+  onChange: setNeedsRecalcStyleInAllFrames
+  conditional: TEXT_AUTOSIZING
+minimumZoomFontSize:
+  type: float
+  initial: defaultMinimumZoomFontSize()
+  conditional: TEXT_AUTOSIZING
+
+subpixelAntialiasedLayerTextEnabled:
+  initial: false
+  onChange: setNeedsRecalcStyleInAllFrames
+simpleLineLayoutEnabled:
+  initial: true
+  onChange: setNeedsRecalcStyleInAllFrames
+simpleLineLayoutDebugBordersEnabled:
+  initial: false
+  onChange: setNeedsRecalcStyleInAllFrames
+
+subpixelCSSOMElementMetricsEnabled:
+  initial: false
+
+useGiantTiles:
+  initial: false
+
+mediaSourceEnabled:
+  initial: true
+  conditional: MEDIA_SOURCE
+
+# FIXME: Rename to allowMultiElementImplicitFormSubmission once we upstream the iOS changes to WebView.mm.
+allowMultiElementImplicitSubmission:
+  initial: false
+
+allowsAirPlayForMediaPlayback:
+  initial: true
+  conditional: WIRELESS_PLAYBACK_TARGET
+
+shouldConvertPositionStyleOnCopy:
+  initial: false
+
+maxParseDuration:
+  type: double
+  initial: -1
+standalone:
+  initial: false
+telephoneNumberParsingEnabled:
+  initial: false
+mediaDataLoadsAutomatically:
+  initial: defaultMediaDataLoadsAutomatically
+alwaysUseAcceleratedOverflowScroll:
+  initial: false
+imageControlsEnabled:
+  initial: false
+  conditional: SERVICE_CONTROLS
+
+enableInheritURIQueryComponent:
+  initial: false
+
+aggressiveTileRetentionEnabled:
+  initial: false
+temporaryTileCohortRetentionEnabled:
+  initial: true
+
+useImageDocumentForSubframePDF:
+  initial: false
+dataDetectorTypes:
+  type: DataDetectorTypes
+  initial: DataDetectorTypeNone
+  conditional: DATA_DETECTION
+
+# Allow SourceBuffers to store up to 304MB each, enough for approximately five minutes
+# of 1080p video and stereo audio.
+maximumSourceBufferSize:
+  type: int
+  initial: 318767104
+  conditional: MEDIA_SOURCE
+
+serviceControlsEnabled:
+  initial: false
+  conditional: SERVICE_CONTROLS
+
+appleMailPaginationQuirkEnabled:
+  initial: false
+
+deferredCSSParserEnabled:
+  initial: false
+
+repaintOutsideLayoutEnabled:
+  initial: false
+
+httpEquivEnabled:
+  initial: true
+
+# Some ports (e.g. iOS) might choose to display attachments inline, regardless of whether the response includes the
+# HTTP header "Content-Disposition: attachment". This setting enables a sandbox around these attachments. The sandbox
+# enforces all frame sandbox flags (see enum SandboxFlag in SecurityContext.h), and also disables <meta http-equiv>
+# processing and subframe loading.
+contentDispositionAttachmentSandboxEnabled:
+  initial: false
+
+userInterfaceDirectionPolicy:
+  type: UserInterfaceDirectionPolicy
+  initial: UserInterfaceDirectionPolicy::Content
+systemLayoutDirection:
+  type: TextDirection
+  initial: LTR
+
+allowContentSecurityPolicySourceStarToMatchAnyProtocol:
+  initial: false
+
+selectionPaintingWithoutSelectionGapsEnabled:
+  initial: false
+
+shouldConvertInvalidURLsToBlank:
+  initial: true
+
+springTimingFunctionEnabled:
+  initial: false
+
+treatIPAddressAsDomain:
+  initial: false
+
+mediaPreloadingEnabled:
+  initial: false
+
+# Runtime-enabled features
+visualViewportEnabled:
+  initial: false
+  onChange: setNeedsRecalcStyleInAllFrames
+
+inputEventsEnabled:
+  initial: true
+
+quickTimePluginReplacementEnabled:
+  initial: defaultQuickTimePluginReplacementEnabled
+youTubeFlashPluginReplacementEnabled:
+  initial: defaultYouTubeFlashPluginReplacementEnabled
+
+forcedColorsAreInvertedAccessibilityValue:
+  type: ForcedAccessibilityValue
+  initial: defaultForcedColorsAreInvertedAccessibilityValue
+forcedDisplayIsMonochromeAccessibilityValue:
+  type: ForcedAccessibilityValue
+  initial: defaultForcedDisplayIsMonochromeAccessibilityValue
+forcedPrefersReducedMotionAccessibilityValue:
+  type: ForcedAccessibilityValue
+  initial: defaultForcedPrefersReducedMotionAccessibilityValue
+
+largeImageAsyncDecodingEnabled:
+  initial: true
+animatedImageAsyncDecodingEnabled:
+  initial: true
+webkitImageReadyEventEnabled:
+  initial: false
+
+shouldSuppressTextInputFromEditingDuringProvisionalNavigation:
+  initial: false
+
+langAttributeAwareFormControlUIEnabled:
+  initial: false
+
+subresourceIntegrityEnabled:
+  initial: true
+
+linkPreconnectEnabled:
+  initial: false
+
+beaconAPIEnabled:
+  initial: false
+
+geolocationFloorLevelEnabled:
+  initial: true
+
+constantPropertiesEnabled:
+  initial: false
+
+viewportFitEnabled:
+  initial: false
+
+allowMediaContentTypesRequiringHardwareSupportAsFallback:
+  initial: false
+
+storageAccessAPIEnabled:
+  initial: false
+
+timeWithoutMouseMovementBeforeHidingControls:
+  type: Seconds
+  initial: 3_s
+
+fontFallbackPrefersPictographs:
+  initial: false
+  onChange: setNeedsRecalcStyleInAllFrames
+
+fontLoadTimingOverride:
+  type: FontLoadTimingOverride
+  initial: FontLoadTimingOverride::None
+shouldIgnoreFontLoadCompletions:
+  initial: false
+
+paymentRequestEnabled:
+  initial: false
+  conditional: PAYMENT_REQUEST
+applePayEnabled:
+  initial: false
+  conditional: APPLE_PAY
+applePayCapabilityDisclosureAllowed:
+  initial: true
+  conditional: APPLE_PAY
+
+javaEnabled:
+  initial: false
+  getter: isJavaEnabled
+javaEnabledForLocalFiles:
+  initial: true
+  getter: isJavaEnabledForLocalFiles
+
+# Unlike the imagesEnabled setting, this only suppresses the network load of
+# the image URL. A cached image will still be rendered if requested.
+loadsImagesAutomatically:
+  initial: false
+  onChange: imagesEnabledChanged
+imagesEnabled:
+  initial: true
+  getter: areImagesEnabled
+  onChange: imagesEnabledChanged
+scriptEnabled:
+  initial: false
+  getter: isScriptEnabled
+  onChange: scriptEnabledChanged
+pluginsEnabled:
+  initial: false
+  getter: arePluginsEnabled
+  onChange: pluginsEnabledChanged
+
+usesPageCache:
+  initial: false
+  onChange: usesPageCacheChanged
+
+dnsPrefetchingEnabled:
+  initial: false
+  onChange: dnsPrefetchingEnabledChanged
+
+backgroundShouldExtendBeyondPage:
+  initial: false
+  onChange: backgroundShouldExtendBeyondPageChanged
+
+scrollingPerformanceLoggingEnabled:
+  initial: false
+  onChange: scrollingPerformanceLoggingEnabledChanged
+
+hiddenPageDOMTimerThrottlingEnabled:
+  initial: false
+  onChange: hiddenPageDOMTimerThrottlingStateChanged
+hiddenPageDOMTimerThrottlingAutoIncreases:
+  initial: false
+  onChange: hiddenPageDOMTimerThrottlingStateChanged
+hiddenPageCSSAnimationSuspensionEnabled:
+  initial: false
+  onChange: hiddenPageCSSAnimationSuspensionEnabledChanged
+
+storageBlockingPolicy:
+  type: SecurityOrigin::StorageBlockingPolicy
+  initial: SecurityOrigin::AllowAllStorage
+  onChange: storageBlockingPolicyChanged
+
+# Only set by Layout Tests.
+mediaTypeOverride:
+  type: String
+  initial: '"screen"'
+  onChange: mediaTypeOverrideChanged
+
+
+fontRenderingMode:
+  type: FontRenderingMode
+  initial: FontRenderingMode::Normal
+
+preferMIMETypeForImages:
+  initial: false
+
+forcePendingWebGLPolicy:
+  initial: false
+  getter: isForcePendingWebGLPolicy
+
+mediaKeysStorageDirectory:
+  type: String
+  conditional: LEGACY_ENCRYPTED_MEDIA
+mediaDeviceIdentifierStorageDirectory:
+  type: String
+  conditional: MEDIA_STREAM
+
+# FIXME: This quirk is needed because of Radar 4674537 and 5211271. We need to phase it out once Adobe
+# can fix the bug from their end.
+needsAdobeFrameReloadingQuirk:
+  initial: false
+  getter: needsAcrobatFrameReloadingQuirk
+
+touchEventEmulationEnabled:
+  initial: false
+  getter: isTouchEventEmulationEnabled
+  conditional: TOUCH_EVENTS