[webkit-changes] [WebKit/WebKit] 38a5d4: Import UnifiedWebPreferences.yaml generated by Saf...
Elliott Williams
noreply at github.com
Tue Dec 6 16:06:40 PST 2022
Branch: refs/heads/eng/feature-status-field
Home: https://github.com/WebKit/WebKit
Commit: 38a5d4f303ca12633110d64f9a7215177c3b80d3
https://github.com/WebKit/WebKit/commit/38a5d4f303ca12633110d64f9a7215177c3b80d3
Author: Elliott Williams <emw at apple.com>
Date: 2022-12-06 (Tue, 06 Dec 2022)
Changed paths:
A Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
Log Message:
-----------
Import UnifiedWebPreferences.yaml generated by Safari/WebKit contributors
https://bugs.webkit.org/show_bug.cgi?id=247926
rdar://92112770
Reviewed by NOBODY (OOPS!).
* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml: Added.
Co-authored-by: Brent Fulgham <bfulgham at apple.com>
Commit: 6e02107983d2592f04e3841046886e6a6a85622b
https://github.com/WebKit/WebKit/commit/6e02107983d2592f04e3841046886e6a6a85622b
Author: Elliott Williams <emw at apple.com>
Date: 2022-12-06 (Tue, 06 Dec 2022)
Changed paths:
M Source/WTF/Scripts/GeneratePreferences.rb
M Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
R Source/WTF/Scripts/Preferences/WebPreferences.yaml
R Source/WTF/Scripts/Preferences/WebPreferencesDebug.yaml
R Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml
R Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml
M Source/WTF/WTF.xcodeproj/project.pbxproj
M Source/WTF/wtf/CMakeLists.txt
M Source/WebCore/CMakeLists.txt
M Source/WebCore/DerivedSources-input.xcfilelist
M Source/WebCore/DerivedSources.make
M Source/WebCore/Scripts/GenerateSettings.rb
M Source/WebCore/WebCore.xcodeproj/project.pbxproj
M Source/WebCore/WebCoreMacros.cmake
R Source/WebCore/page/Settings.yaml
M Source/WebKit/CMakeLists.txt
M Source/WebKit/DerivedSources-input.xcfilelist
M Source/WebKit/DerivedSources.make
M Source/WebKit/Scripts/PreferencesTemplates/WebPageUpdatePreferences.cpp.erb
M Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb
M Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb
M Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesGetterSetters.cpp.erb
M Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb
M Source/WebKit/UIProcess/API/C/WKPreferences.cpp
M Source/WebKit/UIProcess/Cocoa/WebPreferencesCocoa.mm
M Source/WebKit/UIProcess/WebPreferences.cpp
M Source/WebKit/UIProcess/WebPreferences.h
M Source/WebKitLegacy/WebKitLegacy.xcodeproj/project.pbxproj
M Source/WebKitLegacy/mac/Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.mm.erb
M Source/WebKitLegacy/mac/Scripts/PreferencesTemplates/WebPreferencesInternalFeatures.mm.erb
M Source/WebKitLegacy/mac/Scripts/PreferencesTemplates/WebViewPreferencesChangedGenerated.mm.erb
M Source/WebKitLegacy/mac/Scripts/generate-preferences.sh
M Source/WebKitLegacy/mac/WebView/WebPreferencesDefaultValues.h
M Tools/DumpRenderTree/DerivedSources-input.xcfilelist
M Tools/DumpRenderTree/DerivedSources.make
M Tools/TestWebKitAPI/Tests/WebKit/GetUserMedia.mm
M Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm
M Tools/TestWebKitAPI/Tests/WebKitCocoa/SiteIsolation.mm
M Tools/TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm
M Tools/TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm
M Tools/WebKitTestRunner/CMakeLists.txt
M Tools/WebKitTestRunner/DerivedSources-input.xcfilelist
M Tools/WebKitTestRunner/DerivedSources.make
Log Message:
-----------
Generate web preferences using feature status taxonomy
https://bugs.webkit.org/show_bug.cgi?id=247926
rdar://92112770
Reviewed by NOBODY (OOPS!).
Merge WebPreferences*.yaml and Settings.yaml into
UnifiedWebPreferences.yaml. Insteading of using different preference
files to distinguish between experimental features, internal features,
debug preferences, and WebCore::Settings flags, each preference has a
`status` field that determines where it ends up. The status field was
introduced as WebKit::API::FeatureStatus in
https://commits.webkit.org/257166@main.
Feature status determines whether a preference is ephemeral, or backed
by persistent storage. It currently determines which of the preexisting
experimental / internal debug / page settings declarations a preference
appears in.
Future work will expose a new interface for clients to see *all* exposed
features, grouping them by status, and will replace the preexisting
ExperimentalFeatures/InternalDebugFeatures listings with views onto the
main list.
* Source/WTF/Scripts/GeneratePreferences.rb:
- Remove the base/debug/experimental/internal distinctions, and just
parse an arbitrary list of preference files.
- Parse feature statuses, and add methods for preference templates to
query them.
- Add support for automatically static_casting enum preferences to
their unrefined type. This supports the unified feature migration
because many enum-backed page settings are now exposed to the WebKit
layers. It's still not possible for a UI-visible feature to be
anything other than a boolean toggle, which limits the features that
can be marked as "internal", "developer", "testable", "preview", and
"stable".
- Small quality of life changes, such as the ability to output _all_
the parse errors in a single run of the generator script.
* Source/WTF/Scripts/Preferences/WebPreferences.yaml: Removed.
* Source/WTF/Scripts/Preferences/WebPreferencesDebug.yaml: Removed.
* Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml: Removed.
* Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml: Removed.
* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml: Sync with
preferences that have changed on main, and fix inconsistencies and
edge cases revealed during development. The main categories of fixes
are:
- Any preference which can be exposed in UI (including "internal"
features) needs a human-readable name.
- Any preference exposed beyond WebCore needs defaults values for
WebKit and WebKitLegacy.
- Some page settings were listed twice. The declaration from
Settings.yaml needs to take precedence.
- Preferences with "custom" bindings that were merely static_casts now
use the automatic static_cast support provided by the generator
script.
- Non-boolean preferences can't be exposed as an "experimental" or
"internal debug" feature yet. For now, these are reclassified as
"embedder" preferences.
* Source/WTF/WTF.xcodeproj/project.pbxproj: Update file references.
* Source/WTF/wtf/CMakeLists.txt: Update file references.
* Source/WebCore/CMakeLists.txt: Update GenerateSettings.rb invocation.
Inline the settings macro since this is the only place we use it.
* Source/WebCore/DerivedSources-input.xcfilelist: Update file
references.
* Source/WebCore/DerivedSources.make: Update file references and
GenerateSettings.rb invocation.
* Source/WebCore/Scripts/GenerateSettings.rb: Update to consume the
unified preferences file. WebCore::Settings doesn't use the feature
status field.
* Source/WebCore/WebCoreMacros.cmake: Remove settings macro, no longer
used.
* Source/WebCore/WebCore.xcodeproj/project.pbxproj: Update file
references.
* Source/WebCore/page/Settings.yaml: Removed.
* Source/WebKit/CMakeLists.txt: Update GenerateSettings.rb invocation.
* Source/WebKit/DerivedSources-input.xcfilelist: Update file references.
* Source/WebKit/DerivedSources.make: Update file references and
GenerateSettings.rb invocation.
* Source/WebKit/Scripts/PreferencesTemplates/WebPageUpdatePreferences.cpp.erb:
Automatic static_casting.
* Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb:
Replace "Internal Debug" and "Experimental" classifications with
status-based categories.
* Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb:
Use statuses to determine what constitutes an "experimental feature".
* Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesGetterSetters.cpp.erb:
Enumerate the entire list of exposed preferences. Instead of calling
special updateBoolValueForFeatureKey functions for experimental or
internal-debug features, pass an "ephemeral?" flag into the main
updateValueForKey which determines whether the update should be
persisted into user defaults.
* Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb:
Use statuses to determine what constitutes an "internal debug" feature.
* Source/WebKit/UIProcess/API/C/WKPreferences.cpp: Pass an "ephemeral"
flag to set*ValueforKey. Always treat values set through these calls
as ephemeral to reduce user defaults traffic during layout testing.
(WKPreferencesSetBoolValueForKeyForTesting):
(WKPreferencesSetDoubleValueForKeyForTesting):
(WKPreferencesSetUInt32ValueForKeyForTesting):
(WKPreferencesSetStringValueForKeyForTesting):
* Source/WebKit/UIProcess/Cocoa/WebPreferencesCocoa.mm:
(WebKit::WebPreferences::platformInitializeStore): Adopt new
macro names.
(WebKit::setDebugUInt32ValueIfInUserDefaults): Deleted because no
persisted preferences use uint32_t values.
* Source/WebKit/UIProcess/WebPreferences.cpp: Instead of calling
special updateBoolValueForFeatureKey functions for experimental or
internal-debug features, update the main
set/updateValueForKey methods to take an "ephemeral?" flag which
determines whether the update should be persisted into user defaults.
(WebKit::WebPreferences::setBoolValueForKey):
(WebKit::WebPreferences::setDoubleValueForKey):
(WebKit::WebPreferences::setUInt32ValueForKey):
(WebKit::WebPreferences::setStringValueForKey):
(WebKit::WebPreferences::updateStringValueForKey):
(WebKit::WebPreferences::updateBoolValueForKey):
(WebKit::WebPreferences::updateUInt32ValueForKey):
(WebKit::WebPreferences::updateDoubleValueForKey):
(WebKit::WebPreferences::updateFloatValueForKey):
(WebKit::WebPreferences::updateBoolValueForInternalDebugFeatureKey): Deleted.
(WebKit::WebPreferences::updateBoolValueForExperimentalFeatureKey): Deleted.
* Source/WebKit/UIProcess/WebPreferences.h: Ditto above changes.
* Source/WebKitLegacy/WebKitLegacy.xcodeproj/project.pbxproj: Update
file references.
* Source/WebKitLegacy/mac/Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.mm.erb:
Use statuses.
* Source/WebKitLegacy/mac/Scripts/PreferencesTemplates/WebPreferencesInternalFeatures.mm.erb:
Use statuses.
* Source/WebKitLegacy/mac/Scripts/PreferencesTemplates/WebViewPreferencesChangedGenerated.mm.erb:
Support automatic static_casting.
* Source/WebKitLegacy/mac/Scripts/generate-preferences.sh: Update
GeneratePreferences.rb invocation.
* Source/WebKitLegacy/mac/WebView/WebPreferencesDefaultValues.h: Add
include statement needed for static_casting.
In TestWebKitAPI, many API tests set features by searching
+[WKPreferences _experimentalFeatures] and +[WKPreferences
_internalDebugFeatures] for a matching key. This is frustratingly
brittle, and because many features are being removed from the
"experimental" UI, these search sites must be updated.
* Tools/TestWebKitAPI/Tests/WebKit/GetUserMedia.mm:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/SiteIsolation.mm:
(TestWebKitAPI::TEST):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm:
* Tools/TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm:
(TestWebKitAPI::TEST):
* Tools/DumpRenderTree/DerivedSources-input.xcfilelist: Update file
references.
* Tools/DumpRenderTree/DerivedSources.make: Update
GeneratePreferences.rb invocation.
* Tools/WebKitTestRunner/DerivedSources-input.xcfilelist: Ditto.
* Tools/WebKitTestRunner/DerivedSources.make: Ditto.
Compare: https://github.com/WebKit/WebKit/compare/38a5d4f303ca%5E...6e02107983d2
More information about the webkit-changes
mailing list