Use WebPreference definitions from shared configuration files in WebCore (Part 1)
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 10 Oct 2020 19:49:55 +0000 (19:49 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 10 Oct 2020 19:49:55 +0000 (19:49 +0000)
commit255cb752dd281c20cc69574220148314f2819254
tree935550f19ef68ddb26431ab8fd3757adfb53144f
parent79833ec8b6cf1962b9da3aa9a3419f47ba50c0f7
Use WebPreference definitions from shared configuration files in WebCore (Part 1)
https://bugs.webkit.org/show_bug.cgi?id=217551

Reviewed by Darin Adler.

Source/WebCore:

This begins using the WebPreferences*.yaml files for the generation of
WebCore's Settings and InternalSettings classes. In this first part, we
only are moving settings that already exist in the WebPreferences*.yaml
files. A subsequent change will migrate the remaining additional settings
over.

* Configurations/WebCore.xcconfig:
Add variable (already used by WebKit) to access the WTF build scripts
directory for access to the WebPreferences*.yaml files in DerivedSources.make

* DerivedSources-input.xcfilelist:
Update with new input files, the WebPreferences*.yaml files.

* WebCoreMacros.cmake:
* DerivedSources.make:
Update GenerateSettings.rb call with new parameters.

* Scripts/GenerateSettings.rb:
Adds support for generating Settings based on preferences in the
WebPreferences*.yaml files while maintaining support for the additional
settings from Settings.yaml. Adds support for a new key, 'webcoreImplementation'
to continue supporting custom implementations in SettingsBase.

* Scripts/SettingsTemplates/InternalSettingsGenerated.cpp.erb:
* Scripts/SettingsTemplates/InternalSettingsGenerated.h.erb:
* Scripts/SettingsTemplates/InternalSettingsGenerated.idl.erb:
* Scripts/SettingsTemplates/Settings.cpp.erb:
* Scripts/SettingsTemplates/Settings.h.erb:
Update to account for new names (@allSettingsSet) and differentiation
between custom and non-custom implementations.

* editing/EditorCommand.cpp:
* page/Frame.cpp:
Update for new name. DOMPasteAllowed -> domPasteAllowed, which matches convention.

* page/Settings.yaml:
Moved settings that were bound by WebPreferences to WebPreferences. Sorted remaining
ones left.

* page/SettingsDefaultValues.h:
Remove defaults that were the same on all platforms. These are now hardcoded in
WebPreferences.

* style/StyleFontSizeFunctions.cpp:
(WebCore::Style::fontSizeForKeyword):
Add explicit type, now that minimumLogicalFontSize is a double, not an int in WebCore
(it was already a double at the WebKit/WebKitLegacy level).

Source/WebKit:

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::sendViewportAttributesChanged):
Add explicit type to support layoutFallbackWidth now being an unsigned int
in Settings (it was already an unsigned int at the WebKit level).

Source/WTF:

This begins using the WebPreferences*.yaml files for the generation of
WebCore's Settings and InternalSettings classes. In this first part, we
only are moving settings that already exist in the WebPreferences*.yaml
files. A subsequent change will migrate the remaining additional settings
over.

To do this we must add default values for 'WebCore', which are unfortunately
still needed for things like the empty client based SVGImage and sanitizing
web content functionality. We only need default WebCore values for preferences
that are bound to WebCore::Settings. It would be good to eliminate the need
for these eventually, but that is not a goal of this change.

This also adds some new keys from WebCore's Settings.yaml:
- 'webcoreOnChange: *' called by WebCore::Settings when the setting changes.
- 'inspectorOverride: true' used to allow the inspector to override the setting.
- 'webcoreImplementation: custom' used to indicate that WebCore::SettingsBase
  implements the setting.
- 'webcoreGetter: *' used to provide an alternate name for the getter in WebCore::Settings.
- 'webcoreExcludeFromInternalSettings: true' used to exclude from WebCore's InternalSettings
  bindings.

* Scripts/GeneratePreferences.rb:
Adds check that if the preference is bound to WebCore, it includes defaults for all
three front generators, 'WebKit', WebKitLegacy', and 'WebCore'.

* Scripts/Preferences/WebPreferences.yaml:
* Scripts/Preferences/WebPreferencesDebug.yaml:
* Scripts/Preferences/WebPreferencesExperimental.yaml:
* Scripts/Preferences/WebPreferencesInternal.yaml:
Migrates defaults and additional keys from Settings.yaml.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268313 268f45cc-cd09-0410-ab3c-d52691b4dbfc
26 files changed:
Source/WTF/ChangeLog
Source/WTF/Scripts/GeneratePreferences.rb
Source/WTF/Scripts/Preferences/WebPreferences.yaml
Source/WTF/Scripts/Preferences/WebPreferencesDebug.yaml
Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml
Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml
Source/WebCore/ChangeLog
Source/WebCore/Configurations/WebCore.xcconfig
Source/WebCore/DerivedSources-input.xcfilelist
Source/WebCore/DerivedSources.make
Source/WebCore/Scripts/GenerateSettings.rb
Source/WebCore/Scripts/SettingsTemplates/InternalSettingsGenerated.cpp.erb
Source/WebCore/Scripts/SettingsTemplates/InternalSettingsGenerated.h.erb
Source/WebCore/Scripts/SettingsTemplates/InternalSettingsGenerated.idl.erb
Source/WebCore/Scripts/SettingsTemplates/Settings.cpp.erb
Source/WebCore/Scripts/SettingsTemplates/Settings.h.erb
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/WebCoreMacros.cmake
Source/WebCore/editing/EditorCommand.cpp
Source/WebCore/page/Frame.cpp
Source/WebCore/page/Settings.yaml
Source/WebCore/page/SettingsDefaultValues.h
Source/WebCore/style/StyleFontSizeFunctions.cpp
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp
Source/WebKit/WebProcess/WebPage/WebPage.cpp