[Settings] Replace SettingsMacros.h with a generated base class for Settings
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 1 Oct 2017 01:13:34 +0000 (01:13 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 1 Oct 2017 01:13:34 +0000 (01:13 +0000)
commitf1c2acd8148c91337009e81cf1006c5edc92fd76
tree910af62a2a09b4b000cc760b83b367240d52af1a
parented543df5caaa29fafb5c396da8c2262a94975359
[Settings] Replace SettingsMacros.h with a generated base class for Settings
https://bugs.webkit.org/show_bug.cgi?id=177681

Patch by Sam Weinig <sam@webkit.org> on 2017-09-30
Reviewed by Darin Adler.

- Adds a SettingsGenerated class that Settings inherits from. The new class
  has the members and getters/setters for all the generated bindings.
- Some default values for settings are literals in Settings.in, but rather
  constants or functions defined externally. These have all been moved to
  SettingsDefaultValues.h to allow for the script to include them all for
  SettingsGenerated.
- Previously, a few enums were declared in Settings.h for use by Settings.
  Now that SettingsGenerated needs access, we standarize the same way that
  exists for the IDL generator; expecting the enum to be in a header of the
  same name.

* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* WebCoreMacros.cmake:

    Add new files / generation steps.

* Scripts/GenerateSettings.py:
* Scripts/GenerateSettings/GenerateSettings.py:
* Scripts/GenerateSettings/GenerateSettingsHeaderFile.py: Added.
* Scripts/GenerateSettings/GenerateSettingsImplementationFile.py: Added.
* Scripts/GenerateSettings/GenerateSettingsMacrosHeader.py: Removed.
* Scripts/GenerateSettings/Settings.py:

    Replace script to generate SettingsMacros.h with scripts to generate a SettingsGenerated.{h,cpp}.

* accessibility/ForcedAccessibilityValue.h: Added.
* editing/EditableLinkBehavior.h: Added.
* editing/EditingBehavior.h:
* editing/EditingBehaviorType.h: Copied from editing/EditingBehaviorTypes.h.
* editing/EditingBehaviorTypes.h: Removed.
* editing/cocoa/DataDetection.h:
* editing/cocoa/DataDetectorTypes.h: Added.
* page/DebugOverlayRegions.h: Added.
* page/FrameFlattening.h: Added.
* page/PDFImageCachingPolicy.h: Added.
* page/TextDirectionSubmenuInclusionBehavior.h: Added.
* page/UserInterfaceDirectionPolicy.h: Added.
* platform/text/TextDirection.h: Added.
* platform/text/WritingMode.h:

    Split out enums from Settings.h

* css/MediaQueryEvaluator.cpp:

    Update for new name of ForcedAccessibilityValue.

* html/parser/HTMLParserOptions.cpp:

    Update for new name of defaultMaximumHTMLParserDOMTreeDepth.

* page/Settings.cpp:
* page/Settings.h:

    - Move defaults to SettingsDefaultValues.h (and SettingsDefaultValuesCocoa.mm for defaultTextAutosizingEnabled).
    - Move enums to their own files.
    - Inherit from SettingsGenerated.h

* page/Settings.in:

    - Use new 'include' option for javaScriptRuntimeFlags setting to include <runtime/RuntimeFlags.h>,
      as it doesn't fit the normal idiomatic model.
    - Replace call to defaultMinimumZoomFontSize() with direct constant access.

* page/SettingsDefaultValues.h: Added.
* page/cocoa/SettingsDefaultValuesCocoa.mm: Added.

    Move default values from Settings to this new file.

* page/cocoa/SettingsCocoa.mm:

    Move defaultTextAutosizingEnabled() out of here and into SettingsDefaultValuesCocoa.mm.

* style/StyleTreeResolver.cpp:

    - Update for new scoping of defaultMaximumRenderTreeDepth.
    - Move defaultMaximumRenderTreeDepth from Settings here. This is the only use.

* testing/InternalSettings.cpp:
(WebCore::InternalSettings::forcedColorsAreInvertedAccessibilityValue const):
(WebCore::InternalSettings::setForcedColorsAreInvertedAccessibilityValue):
(WebCore::InternalSettings::forcedDisplayIsMonochromeAccessibilityValue const):
(WebCore::InternalSettings::setForcedDisplayIsMonochromeAccessibilityValue):
(WebCore::InternalSettings::forcedPrefersReducedMotionAccessibilityValue const):
(WebCore::InternalSettings::setForcedPrefersReducedMotionAccessibilityValue):
(WebCore::settingsToInternalSettingsValue): Deleted.
(WebCore::internalSettingsToSettingsValue): Deleted.
* testing/InternalSettings.h:

    Replace duplicate definition of ForcedAccessibilityValue with a using declaration
    and simplify code now that it doesn't need to map between the two enums.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222686 268f45cc-cd09-0410-ab3c-d52691b4dbfc
35 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.make
Source/WebCore/Scripts/GenerateSettings.py
Source/WebCore/Scripts/GenerateSettings/GenerateSettings.py
Source/WebCore/Scripts/GenerateSettings/GenerateSettingsHeaderFile.py [new file with mode: 0755]
Source/WebCore/Scripts/GenerateSettings/GenerateSettingsImplementationFile.py [new file with mode: 0755]
Source/WebCore/Scripts/GenerateSettings/GenerateSettingsMacrosHeader.py [deleted file]
Source/WebCore/Scripts/GenerateSettings/Settings.py
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/WebCoreMacros.cmake
Source/WebCore/accessibility/ForcedAccessibilityValue.h [new file with mode: 0644]
Source/WebCore/css/MediaQueryEvaluator.cpp
Source/WebCore/editing/EditableLinkBehavior.h [new file with mode: 0644]
Source/WebCore/editing/EditingBehavior.h
Source/WebCore/editing/EditingBehaviorType.h [moved from Source/WebCore/editing/EditingBehaviorTypes.h with 100% similarity]
Source/WebCore/editing/cocoa/DataDetection.h
Source/WebCore/editing/cocoa/DataDetectorTypes.h [new file with mode: 0644]
Source/WebCore/html/parser/HTMLParserOptions.cpp
Source/WebCore/page/DebugOverlayRegions.h [new file with mode: 0644]
Source/WebCore/page/FrameFlattening.h [new file with mode: 0644]
Source/WebCore/page/PDFImageCachingPolicy.h [new file with mode: 0644]
Source/WebCore/page/Settings.cpp
Source/WebCore/page/Settings.h
Source/WebCore/page/Settings.in
Source/WebCore/page/SettingsDefaultValues.h [new file with mode: 0644]
Source/WebCore/page/TextDirectionSubmenuInclusionBehavior.h [new file with mode: 0644]
Source/WebCore/page/UserInterfaceDirectionPolicy.h [new file with mode: 0644]
Source/WebCore/page/cocoa/SettingsCocoa.mm
Source/WebCore/page/cocoa/SettingsDefaultValuesCocoa.mm [new file with mode: 0644]
Source/WebCore/platform/text/TextDirection.h [new file with mode: 0644]
Source/WebCore/platform/text/WritingMode.h
Source/WebCore/style/StyleTreeResolver.cpp
Source/WebCore/testing/InternalSettings.cpp
Source/WebCore/testing/InternalSettings.h