WebKit Bugzilla
Attachment 349461 Details for
Bug 189442
: Add and expose Internal features from WebKit
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Build Test
bug-189442-20180912074556.patch (text/plain), 63.30 KB, created by
Dean Jackson
on 2018-09-11 14:45:58 PDT
(
hide
)
Description:
Build Test
Filename:
MIME Type:
Creator:
Dean Jackson
Created:
2018-09-11 14:45:58 PDT
Size:
63.30 KB
patch
obsolete
>Subversion Revision: 235912 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 49169fd3fd515bfe8fd3ccf5790fb2669052f20d..83a6fbe83119bc37ddda99d76763589aca40abdc 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,74 @@ >+2018-09-07 Dean Jackson <dino@apple.com> >+ >+ Add and expose Internal features from WebKit >+ https://bugs.webkit.org/show_bug.cgi?id=189442 >+ <rdar://problem/44243404> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Experimental features have become a mess. People are using them for >+ anything that they want to be easily toggled from a host app (e.g. >+ Safari), which means the user-facing menu has become large and >+ confusing. >+ >+ Introduce the idea of Internal features, that will be exposed in a way >+ that end-users are not expected to ever see (unless they really want >+ to). >+ >+ * CMakeLists.txt: Add new files. >+ * Sources.txt: >+ * SourcesCocoa.txt: >+ * WebKit.xcodeproj/project.pbxproj: >+ >+ * DerivedSources.make: Add new generated files. >+ * Scripts/GeneratePreferences.rb: Generate the preferences stuff for Internal Debug features. >+ * Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb: >+ * Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb: Added. >+ >+ * Shared/API/APIObject.h: New API object for InternalDebugFeature. >+ * Shared/Cocoa/APIObject.mm: >+ (API::Object::newObject): >+ >+ * Shared/WebPreferences.yaml: Change some of the existing experimental features to "internal". >+ >+ * UIProcess/API/APIInternalDebugFeature.cpp: New API type - just like APIExperimentalFeature. >+ (API::InternalDebugFeature::create): >+ (API::InternalDebugFeature::InternalDebugFeature): >+ (API::InternalDebugFeature::~InternalDebugFeature): >+ * UIProcess/API/APIInternalDebugFeature.h: >+ * UIProcess/API/C/WKAPICast.h: >+ >+ * UIProcess/API/Cocoa/WKPreferences.mm: Change the naming of the experimental feature API so that it >+ won't clash with internal debug features. We can remove the old API once Safari has adopted. >+ (+[WKPreferences _internalDebugFeatures]): >+ (-[WKPreferences _isEnabledForInternalDebugFeature:]): >+ (-[WKPreferences _setEnabled:forInternalDebugFeature:]): >+ (-[WKPreferences _isEnabledForFeature:]): >+ (-[WKPreferences _setEnabled:forFeature:]): >+ (-[WKPreferences _isEnabledForExperimentalFeature:]): >+ (-[WKPreferences _setEnabled:forExperimentalFeature:]): >+ * UIProcess/API/Cocoa/WKPreferencesPrivate.h: >+ >+ * UIProcess/API/Cocoa/_WKInternalDebugFeature.h: New object - same as _WKExperimentalFeature. >+ * UIProcess/API/Cocoa/_WKInternalDebugFeature.mm: >+ (-[_WKInternalDebugFeature dealloc]): >+ (-[_WKInternalDebugFeature description]): >+ (-[_WKInternalDebugFeature name]): >+ (-[_WKInternalDebugFeature key]): >+ (-[_WKInternalDebugFeature details]): >+ (-[_WKInternalDebugFeature defaultValue]): >+ (-[_WKInternalDebugFeature isHidden]): >+ (-[_WKInternalDebugFeature _apiObject]): >+ * UIProcess/API/Cocoa/_WKInternalDebugFeatureInternal.h: >+ >+ * UIProcess/WebPreferences.cpp: Add support for Internal Debug features. >+ (WebKit::WebPreferences::updateBoolValueForInternalDebugFeatureKey): >+ (WebKit::WebPreferences::updateBoolValueForExperimentalFeatureKey): >+ * UIProcess/WebPreferences.h: >+ >+ * UIProcess/WebProcessPool.cpp: Change a comment now that it is an internal feature. >+ (WebKit::WebProcessPool::createWebPage): >+ > 2018-09-11 Myles C. Maxfield <mmaxfield@apple.com> > > Crash under PlatformPopupMenuData::encode when interacting with a select menu that has variable fonts >diff --git a/Source/WebKit/CMakeLists.txt b/Source/WebKit/CMakeLists.txt >index 1d6b3b748a7a52828825d8c7eca1d5d53eb520cc..dea3e5b4b558571f9e543e23098ecc39e070ba37 100644 >--- a/Source/WebKit/CMakeLists.txt >+++ b/Source/WebKit/CMakeLists.txt >@@ -399,13 +399,14 @@ set(WebKit_WEB_PREFERENCES_TEMPLATES > ${WEBKIT_DIR}/Scripts/PreferencesTemplates/WebPageUpdatePreferences.cpp.erb > ${WEBKIT_DIR}/Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb > ${WEBKIT_DIR}/Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb >+ ${WEBKIT_DIR}/Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb > ${WEBKIT_DIR}/Scripts/PreferencesTemplates/WebPreferencesKeys.cpp.erb > ${WEBKIT_DIR}/Scripts/PreferencesTemplates/WebPreferencesKeys.h.erb > ${WEBKIT_DIR}/Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb > ) > > add_custom_command( >- OUTPUT ${DERIVED_SOURCES_WEBKIT_DIR}/WebPageUpdatePreferences.cpp ${DERIVED_SOURCES_WEBKIT_DIR}/WebPreferencesDefinitions.h ${DERIVED_SOURCES_WEBKIT_DIR}/WebPreferencesExperimentalFeatures.cpp ${DERIVED_SOURCES_WEBKIT_DIR}/WebPreferencesKeys.cpp ${DERIVED_SOURCES_WEBKIT_DIR}/WebPreferencesKeys.h ${DERIVED_SOURCES_WEBKIT_DIR}/WebPreferencesStoreDefaultsMap.cpp >+ OUTPUT ${DERIVED_SOURCES_WEBKIT_DIR}/WebPageUpdatePreferences.cpp ${DERIVED_SOURCES_WEBKIT_DIR}/WebPreferencesDefinitions.h ${DERIVED_SOURCES_WEBKIT_DIR}/WebPreferencesExperimentalFeatures.cpp ${DERIVED_SOURCES_WEBKIT_DIR}/WebPreferencesInternalDebugFeatures.cpp ${DERIVED_SOURCES_WEBKIT_DIR}/WebPreferencesKeys.cpp ${DERIVED_SOURCES_WEBKIT_DIR}/WebPreferencesKeys.h ${DERIVED_SOURCES_WEBKIT_DIR}/WebPreferencesStoreDefaultsMap.cpp > MAIN_DEPENDENCY ${WEBKIT_DIR}/Shared/WebPreferences.yaml > DEPENDS ${WebKit_WEB_PREFERENCES_TEMPLATES} > COMMAND ${RUBY_EXECUTABLE} ${WEBKIT_DIR}/Scripts/GeneratePreferences.rb --input ${WEBKIT_DIR}/Shared/WebPreferences.yaml --outputDir "${DERIVED_SOURCES_WEBKIT_DIR}" >@@ -419,6 +420,7 @@ list(APPEND WebKit_HEADERS > list(APPEND WebKit_SOURCES > ${DERIVED_SOURCES_WEBKIT_DIR}/WebPageUpdatePreferences.cpp > ${DERIVED_SOURCES_WEBKIT_DIR}/WebPreferencesExperimentalFeatures.cpp >+ ${DERIVED_SOURCES_WEBKIT_DIR}/WebPreferencesInternalDebugFeatures.cpp > ${DERIVED_SOURCES_WEBKIT_DIR}/WebPreferencesKeys.cpp > ${DERIVED_SOURCES_WEBKIT_DIR}/WebPreferencesStoreDefaultsMap.cpp > ) >diff --git a/Source/WebKit/DerivedSources.make b/Source/WebKit/DerivedSources.make >index bdec2831b6510a780fed6bb42611bc92f47873a0..0c020d368820b87a2d04a5e6d8281d521fc78250 100644 >--- a/Source/WebKit/DerivedSources.make >+++ b/Source/WebKit/DerivedSources.make >@@ -295,14 +295,15 @@ WEB_PREFERENCES_TEMPLATES = \ > $(WebKit2)/Scripts/PreferencesTemplates/WebPageUpdatePreferences.cpp.erb \ > $(WebKit2)/Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb \ > $(WebKit2)/Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb \ >+ $(WebKit2)/Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb \ > $(WebKit2)/Scripts/PreferencesTemplates/WebPreferencesKeys.h.erb \ > $(WebKit2)/Scripts/PreferencesTemplates/WebPreferencesKeys.cpp.erb \ > $(WebKit2)/Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb \ > > # > >-all : WebPageUpdatePreferences.cpp WebPreferencesDefinitions.h WebPreferencesExperimentalFeatures.cpp WebPreferencesKeys.h WebPreferencesKeys.cpp WebPreferencesStoreDefaultsMap.cpp >+all : WebPageUpdatePreferences.cpp WebPreferencesDefinitions.h WebPreferencesExperimentalFeatures.cpp WebPreferencesInternalDebugFeatures.cpp WebPreferencesKeys.h WebPreferencesKeys.cpp WebPreferencesStoreDefaultsMap.cpp > >-WebPageUpdatePreferences%cpp WebPreferencesDefinitions%h WebPreferencesExperimentalFeatures%cpp WebPreferencesKeys%h WebPreferencesKeys%cpp WebPreferencesStoreDefaultsMap%cpp : $(WebKit2)/Scripts/GeneratePreferences.rb $(WEB_PREFERENCES_TEMPLATES) $(WebKit2)/Shared/WebPreferences.yaml >+WebPageUpdatePreferences%cpp WebPreferencesDefinitions%h WebPreferencesExperimentalFeatures%cpp WebPreferencesInternalDebugFeatures%cpp WebPreferencesKeys%h WebPreferencesKeys%cpp WebPreferencesStoreDefaultsMap%cpp : $(WebKit2)/Scripts/GeneratePreferences.rb $(WEB_PREFERENCES_TEMPLATES) $(WebKit2)/Shared/WebPreferences.yaml > $(RUBY) $< --input $(WebKit2)/Shared/WebPreferences.yaml > >diff --git a/Source/WebKit/Scripts/GeneratePreferences.rb b/Source/WebKit/Scripts/GeneratePreferences.rb >index 131caf4addd97fd657cf4ae874c5b1e127dc89e2..5ff5bd87b6cea6d185ac3dba3429bfdf5dce108b 100755 >--- a/Source/WebKit/Scripts/GeneratePreferences.rb >+++ b/Source/WebKit/Scripts/GeneratePreferences.rb >@@ -28,7 +28,7 @@ require 'erb' > require 'optparse' > require 'yaml' > >-options = { >+options = { > :input => nil, > :outputDirectory => nil > } >@@ -128,17 +128,18 @@ end > > class Preferences > attr_accessor :preferences >- >+ > def initialize(hash) > @preferences = [] > hash.each do |name, options| > @preferences << Preference.new(name, options) > end > @preferences.sort! { |x, y| x.name <=> y.name } >- >+ > @preferencesNotDebug = @preferences.select { |p| !p.category } > @preferencesDebug = @preferences.select { |p| p.category == "debug" } > @experimentalFeatures = @preferences.select { |p| p.category == "experimental" } >+ @internalDebugFeatures = @preferences.select { |p| p.category == "internal" } > > @preferencesBoundToSetting = @preferences.select { |p| !p.webcoreBinding } > @preferencesBoundToDeprecatedGlobalSettings = @preferences.select { |p| p.webcoreBinding == "DeprecatedGlobalSettings" } >@@ -161,4 +162,5 @@ preferences.renderToFile("PreferencesTemplates/WebPageUpdatePreferences.cpp.erb" > preferences.renderToFile("PreferencesTemplates/WebPreferencesKeys.h.erb", File.join(options[:outputDirectory], "WebPreferencesKeys.h")) > preferences.renderToFile("PreferencesTemplates/WebPreferencesKeys.cpp.erb", File.join(options[:outputDirectory], "WebPreferencesKeys.cpp")) > preferences.renderToFile("PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb", File.join(options[:outputDirectory], "WebPreferencesStoreDefaultsMap.cpp")) >+preferences.renderToFile("PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb", File.join(options[:outputDirectory], "WebPreferencesInternalDebugFeatures.cpp")) > preferences.renderToFile("PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb", File.join(options[:outputDirectory], "WebPreferencesExperimentalFeatures.cpp")) >diff --git a/Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb b/Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb >index 9cb732dd4ce760fedb0b02a7cc281818548bd1e2..e6774e26be834486eb6458eb86bcc96c8fcaf358 100644 >--- a/Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb >+++ b/Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb >@@ -46,6 +46,13 @@ > <%- end -%> > \ > >+// Internal Debug Features >+ >+#define FOR_EACH_WEBKIT_INTERNAL_DEBUG_FEATURE_PREFERENCE(macro) \ >+<%- for @pref in @internalDebugFeatures do -%> >+ macro(<%= @pref.name %>, <%= @pref.nameLower %>, Bool, bool, <%= @pref.defaultValue %>, <%= @pref.humanReadableName %>, <%= @pref.humanReadableDescription %>) \ >+<%- end -%> >+ \ > > // Experimental Features > >diff --git a/Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb b/Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb >new file mode 100644 >index 0000000000000000000000000000000000000000..d8ae9512f746ec63e4ea19df088d1365bf77cd72 >--- /dev/null >+++ b/Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb >@@ -0,0 +1,124 @@ >+/* >+* THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT EDIT. >+* >+* Copyright (C) 2018 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 "WebPreferences.h" >+ >+#include "WebPreferencesKeys.h" >+ >+namespace WebKit { >+ >+<%- for @pref in @internalDebugFeatures do -%> >+void WebPreferences::set<%= @pref.name %>(const bool& value) >+{ >+ if (!m_store.setBoolValueForKey(WebPreferencesKey::<%= @pref.nameLower %>Key(), value)) >+ return; >+ updateBoolValueForInternalDebugFeatureKey(WebPreferencesKey::<%= @pref.nameLower %>Key(), value); >+} >+ >+bool WebPreferences::<%= @pref.nameLower %>() const >+{ >+ return m_store.getBoolValueForKey(WebPreferencesKey::<%= @pref.nameLower %>Key()); >+} >+ >+<%- end -%> >+const Vector<RefPtr<API::Object>>& WebPreferences::internalDebugFeatures() >+{ >+ static NeverDestroyed<Vector<RefPtr<API::Object>>> features(std::initializer_list<RefPtr<API::Object>> { >+<%- for @pref in @internalDebugFeatures do -%> >+<%- if @pref.condition -%> >+#if <%= @pref.condition %> >+<%- end -%> >+ API::InternalDebugFeature::create(<%= @pref.humanReadableName %>, "<%= @pref.name %>", <%= @pref.humanReadableDescription %>, <%= @pref.defaultValue %>, <%= @pref.hidden %>), >+<%- if @pref.condition -%> >+#endif >+<%- end -%> >+<%- end -%> >+ }); >+ >+ return features; >+} >+ >+bool WebPreferences::isEnabledForFeature(const API::InternalDebugFeature& feature) const >+{ >+ struct FeatureGetterMapping { >+ const char* name; >+ bool (WebPreferences::*function) () const; >+ }; >+ >+ static FeatureGetterMapping getters[] = { >+<%- for @pref in @internalDebugFeatures do -%> >+<%- if @pref.condition -%> >+#if <%= @pref.condition %> >+<%- end -%> >+ { "<%= @pref.name %>", &WebPreferences::<%= @pref.nameLower %> }, >+<%- if @pref.condition -%> >+#endif >+<%- end -%> >+<%- end -%> >+ }; >+ >+ const String& key = feature.key(); >+ >+ for (auto& getter : getters) { >+ if (key == getter.name) >+ return (this->*getter.function)(); >+ } >+ >+ return false; >+} >+ >+void WebPreferences::setEnabledForFeature(bool value, const API::InternalDebugFeature& feature) >+{ >+ struct FeatureSetterMapping { >+ const char* name; >+ void (WebPreferences::*function) (const bool&); >+ }; >+ >+ static FeatureSetterMapping setters[] = { >+<%- for @pref in @internalDebugFeatures do -%> >+<%- if @pref.condition -%> >+#if <%= @pref.condition %> >+<%- end -%> >+ { "<%= @pref.name %>", &WebPreferences::set<%= @pref.name %> }, >+<%- if @pref.condition -%> >+#endif >+<%- end -%> >+<%- end -%> >+ }; >+ >+ const String& key = feature.key(); >+ >+ for (auto& setter : setters) { >+ if (key == setter.name) { >+ (this->*setter.function)(value); >+ return; >+ } >+ } >+} >+ >+} >diff --git a/Source/WebKit/Shared/API/APIObject.h b/Source/WebKit/Shared/API/APIObject.h >index 1f6003ff5f4d9de4f186e7b1a3ba4ed2a12d2c70..b0ca54d8faab29d89018540fa6650b8aab195a0c 100644 >--- a/Source/WebKit/Shared/API/APIObject.h >+++ b/Source/WebKit/Shared/API/APIObject.h >@@ -110,6 +110,7 @@ public: > ContentRuleListStore, > ContextMenuListener, > CookieManager, >+ InternalDebugFeature, > Download, > ExperimentalFeature, > FormSubmissionListener, >diff --git a/Source/WebKit/Shared/Cocoa/APIObject.mm b/Source/WebKit/Shared/Cocoa/APIObject.mm >index 448ffd28aca7b8f0d911d7c3c2bd744f22f847f7..ecc352f2fdf95b4bdcccce208c7c2dfdd10ad8ba 100644 >--- a/Source/WebKit/Shared/Cocoa/APIObject.mm >+++ b/Source/WebKit/Shared/Cocoa/APIObject.mm >@@ -76,6 +76,7 @@ > #import "_WKGeolocationPositionInternal.h" > #import "_WKHitTestResultInternal.h" > #import "_WKInspectorInternal.h" >+#import "_WKInternalDebugFeatureInternal.h" > #import "_WKProcessPoolConfigurationInternal.h" > #import "_WKUserContentWorldInternal.h" > #import "_WKUserInitiatedActionInternal.h" >@@ -194,6 +195,10 @@ void* Object::newObject(size_t size, Type type) > wrapper = [WKNSData alloc]; > break; > >+ case Type::InternalDebugFeature: >+ wrapper = [_WKInternalDebugFeature alloc]; >+ break; >+ > case Type::Dictionary: > wrapper = [WKNSDictionary alloc]; > break; >diff --git a/Source/WebKit/Shared/WebPreferences.yaml b/Source/WebKit/Shared/WebPreferences.yaml >index 4bee637908e8404f77f15a2c24228f8c370fcaaf..8681b9c11792491fa071bd227b541ef130dc5545 100644 >--- a/Source/WebKit/Shared/WebPreferences.yaml >+++ b/Source/WebKit/Shared/WebPreferences.yaml >@@ -1127,20 +1127,13 @@ IsSecureContextAttributeEnabled: > > # For experimental features: > # The type should be boolean. >-# You must provide a humanReadableName and humanReadableName for all experimental features. They >+# You must provide a humanReadableName and humanReadableDescription for all experimental features. They > # are the text exposed to the user from the WebKit client. > # The default value may be either false (for unstable features) or > # DEFAULT_EXPERIMENTAL_FEATURES_ENABLED (for features that are ready for > # wider testing). > > >-AsyncFrameScrollingEnabled: >- type: bool >- defaultValue: false >- humanReadableName: "Async Frame Scrolling" >- humanReadableDescription: "Perform frame scrolling in a dedicated thread or process" >- category: experimental >- > SpringTimingFunctionEnabled: > type: bool > defaultValue: DEFAULT_EXPERIMENTAL_FEATURES_ENABLED >@@ -1172,38 +1165,10 @@ IntersectionObserverEnabled: > category: experimental > condition: ENABLE(INTERSECTION_OBSERVER) > >-MDNSICECandidatesEnabled: >- type: bool >- defaultValue: false >- humanReadableName: "Enable MDNS ICE candidates" >- humanReadableDescription: "Enable MDNS ICE candidates" >- webcoreBinding: RuntimeEnabledFeatures >- category: experimental >- condition: ENABLE(WEB_RTC) >- >-FetchAPIKeepAliveEnabled: >- type: bool >- defaultValue: false >- humanReadableName: "Fetch API Request KeepAlive" >- humanReadableDescription: "Enable Fetch API Request KeepAlive" >- category: experimental >- webcoreBinding: RuntimeEnabledFeatures >- webcoreName: fetchAPIKeepAliveEnabled >- >-ServiceWorkersEnabled: >- type: bool >- defaultValue: DEFAULT_SERVICE_WORKERS_ENABLED >- humanReadableName: "ServiceWorkers" >- humanReadableDescription: "Enable ServiceWorkers" >- category: experimental >- webcoreBinding: RuntimeEnabledFeatures >- webcoreName: serviceWorkerEnabled >- condition: ENABLE(SERVICE_WORKER) >- > VisualViewportAPIEnabled: > type: bool > defaultValue: DEFAULT_EXPERIMENTAL_FEATURES_ENABLED >- humanReadableName: "VisualViewportAPI" >+ humanReadableName: "Visual Viewport API" > humanReadableDescription: "Enable Visual Viewport API" > category: experimental > >@@ -1225,7 +1190,7 @@ WebAnimationsEnabled: > WebAnimationsCSSIntegrationEnabled: > type: bool > defaultValue: DEFAULT_EXPERIMENTAL_FEATURES_ENABLED >- humanReadableName: "Web Animations and CSS Integration" >+ humanReadableName: "CSS Animations via Web Animations" > humanReadableDescription: "Expose CSS Animations and CSS Transitions through getAnimations()" > category: experimental > webcoreBinding: RuntimeEnabledFeatures >@@ -1256,14 +1221,6 @@ AccessibilityObjectModelEnabled: > category: experimental > webcoreBinding: RuntimeEnabledFeatures > >-AriaReflectionEnabled: >- type: bool >- defaultValue: true >- humanReadableName: "ARIA Reflection" >- humanReadableDescription: "ARIA Reflection support" >- category: experimental >- webcoreBinding: RuntimeEnabledFeatures >- > WebVREnabled: > type: bool > defaultValue: DEFAULT_EXPERIMENTAL_FEATURES_ENABLED >@@ -1273,78 +1230,126 @@ WebVREnabled: > category: experimental > condition: PLATFORM(GTK) || PLATFORM(WPE) > >-ResourceLoadStatisticsDebugMode: >+ServerTimingEnabled: > type: bool > defaultValue: false >- humanReadableName: "ITP Debug Mode" >- humanReadableDescription: "Intelligent Tracking Prevention Debug Mode" >+ humanReadableName: "Server Timing" >+ humanReadableDescription: "Enable Server Timing API" > category: experimental > webcoreBinding: RuntimeEnabledFeatures >+ webcoreName: serverTimingEnabled > >-WebGLCompressedTextureASTCSupportEnabled: >+EncryptedMediaAPIEnabled: > type: bool >- defaultValue: false >- humanReadableName: "ASTC Texture Support" >- humanReadableDescription: "Support for ASTC compressed texture formats in WebGL" >- category: experimental >+ defaultValue: DEFAULT_EXPERIMENTAL_FEATURES_ENABLED >+ humanReadableName: "Modern Encrypted Media API" >+ humanReadableDescription: "Enable Modern Encrypted Media API" > webcoreBinding: RuntimeEnabledFeatures >+ category: experimental >+ condition: ENABLE(ENCRYPTED_MEDIA) > >-ServerTimingEnabled: >+WebAPIStatisticsEnabled: > type: bool > defaultValue: false >- humanReadableName: "Server Timing" >- humanReadableDescription: "Enable Server Timing API" >- category: experimental >+ humanReadableName: "Web API Statistics" >+ humanReadableDescription: "Enable Web API Statistics" > webcoreBinding: RuntimeEnabledFeatures >- webcoreName: serverTimingEnabled >+ category: experimental >+ >+# For internal features: >+# The type should be boolean. >+# You must provide a humanReadableName and humanReadableDescription for all debug features. They >+# are the text exposed to the user from the WebKit client. > > ExperimentalPlugInSandboxProfilesEnabled: > type: bool > defaultValue: false > humanReadableName: "Sandbox Plug-Ins" > humanReadableDescription: "Enable Plug-In sandboxing" >- category: debug >+ category: internal > webcoreBinding: RuntimeEnabledFeatures > webcoreName: experimentalPlugInSandboxProfilesEnabled > >-FullScreenEnabled: >- type: bool >- defaultValue: false >- condition: ENABLE(FULLSCREEN_API) >- hidden: EXPERIMENTAL_FULLSCREEN_API_HIDDEN >- humanReadableName: "Fullscreen API" >- humanReadableDescription: "Fullscreen API" >- category: experimental >- >-EncryptedMediaAPIEnabled: >- type: bool >- defaultValue: DEFAULT_EXPERIMENTAL_FEATURES_ENABLED >- humanReadableName: "Modern Encrypted Media API" >- humanReadableDescription: "Modern Encrypted Media API" >- webcoreBinding: RuntimeEnabledFeatures >- category: experimental >- condition: ENABLE(ENCRYPTED_MEDIA) >- > ProcessSwapOnCrossSiteNavigationEnabled: > type: bool > defaultValue: false > humanReadableName: "Swap Processes on Cross-Site Navigation" > humanReadableDescription: "Swap WebContent processes on cross-site navigations" >- category: experimental >+ category: internal > webcoreBinding: none > > SourceBufferChangeTypeEnabled: > type: bool >- defaultValue: DEFAULT_EXPERIMENTAL_FEATURES_ENABLED >+ defaultValue: false > humanReadableName: "Media Source Codec Switching Support" >- humanReadableDescription: "Enable Media Source Codec Switching through changeType()" >- category: experimental >+ humanReadableDescription: "Media Source Codec Switching through changeType()" >+ category: internal > condition: ENABLE(MEDIA_SOURCE) > >-WebAPIStatisticsEnabled: >+ResourceLoadStatisticsDebugMode: > type: bool > defaultValue: false >- humanReadableName: "Web API Statistics" >- humanReadableDescription: "Enable Web API Statistics" >+ humanReadableName: "ITP Debug Mode" >+ humanReadableDescription: "Intelligent Tracking Prevention Debug Mode" >+ category: internal >+ webcoreBinding: RuntimeEnabledFeatures >+ >+ServiceWorkersEnabled: >+ type: bool >+ defaultValue: DEFAULT_SERVICE_WORKERS_ENABLED >+ humanReadableName: "Service Workers" >+ humanReadableDescription: "Enable Service Workers" >+ category: internal >+ webcoreBinding: RuntimeEnabledFeatures >+ webcoreName: serviceWorkerEnabled >+ condition: ENABLE(SERVICE_WORKER) >+ >+AsyncFrameScrollingEnabled: >+ type: bool >+ defaultValue: false >+ humanReadableName: "Async Frame Scrolling" >+ humanReadableDescription: "Perform frame scrolling in a dedicated thread or process" >+ category: internal >+ >+MDNSICECandidatesEnabled: >+ type: bool >+ defaultValue: false >+ humanReadableName: "MDNS ICE candidates" >+ humanReadableDescription: "Enable MDNS ICE candidates" >+ webcoreBinding: RuntimeEnabledFeatures >+ category: internal >+ condition: ENABLE(WEB_RTC) >+ >+FetchAPIKeepAliveEnabled: >+ type: bool >+ defaultValue: false >+ humanReadableName: "Fetch API Request KeepAlive" >+ humanReadableDescription: "Enable Fetch API Request KeepAlive" >+ category: internal >+ webcoreBinding: RuntimeEnabledFeatures >+ webcoreName: fetchAPIKeepAliveEnabled >+ >+WebGLCompressedTextureASTCSupportEnabled: >+ type: bool >+ defaultValue: false >+ humanReadableName: "ASTC Texture Support" >+ humanReadableDescription: "Support for ASTC compressed texture formats in WebGL" >+ category: internal >+ webcoreBinding: RuntimeEnabledFeatures >+ >+FullScreenEnabled: >+ type: bool >+ defaultValue: false >+ condition: ENABLE(FULLSCREEN_API) >+ hidden: EXPERIMENTAL_FULLSCREEN_API_HIDDEN >+ humanReadableName: "Fullscreen API" >+ humanReadableDescription: "Fullscreen API" >+ category: internal >+ >+AriaReflectionEnabled: >+ type: bool >+ defaultValue: true >+ humanReadableName: "ARIA Reflection" >+ humanReadableDescription: "ARIA Reflection support" >+ category: internal > webcoreBinding: RuntimeEnabledFeatures >- category: experimental >diff --git a/Source/WebKit/Sources.txt b/Source/WebKit/Sources.txt >index 947cfd47442206e64942bd9073bc131cfc93b357..dad703a8cccb9555a31be3cc59371d4fc26eaab3 100644 >--- a/Source/WebKit/Sources.txt >+++ b/Source/WebKit/Sources.txt >@@ -292,6 +292,7 @@ UIProcess/API/APIExperimentalFeature.cpp > UIProcess/API/APIFrameInfo.cpp > UIProcess/API/APIHTTPCookieStore.cpp > UIProcess/API/APIHitTestResult.cpp >+UIProcess/API/APIInternalDebugFeature.cpp > UIProcess/API/APINavigation.cpp > UIProcess/API/APINavigationData.cpp > UIProcess/API/APIPageConfiguration.cpp >diff --git a/Source/WebKit/SourcesCocoa.txt b/Source/WebKit/SourcesCocoa.txt >index 16d07ba033ce87cfe3769ab3de8f82960ba72986..2fb8e1abe5a755e2cc4aae3ad60080b883635653 100644 >--- a/Source/WebKit/SourcesCocoa.txt >+++ b/Source/WebKit/SourcesCocoa.txt >@@ -240,6 +240,7 @@ UIProcess/API/Cocoa/_WKErrorRecoveryAttempting.mm > UIProcess/API/Cocoa/_WKExperimentalFeature.mm > UIProcess/API/Cocoa/_WKGeolocationPosition.mm > UIProcess/API/Cocoa/_WKInspector.mm >+UIProcess/API/Cocoa/_WKInternalDebugFeature.mm > UIProcess/API/Cocoa/_WKLinkIconParameters.mm > UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm > UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm >diff --git a/Source/WebKit/UIProcess/API/APIInternalDebugFeature.cpp b/Source/WebKit/UIProcess/API/APIInternalDebugFeature.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..dd60f62994b0263741561427682c7744faa6661c >--- /dev/null >+++ b/Source/WebKit/UIProcess/API/APIInternalDebugFeature.cpp >@@ -0,0 +1,49 @@ >+/* >+ * Copyright (C) 2018 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 "APIInternalDebugFeature.h" >+ >+namespace API { >+ >+Ref<InternalDebugFeature> InternalDebugFeature::create(const WTF::String& name, const WTF::String& key, const WTF::String& details, bool defaultValue, bool hidden) >+{ >+ return adoptRef(*new InternalDebugFeature(name, key, details, defaultValue, hidden)); >+} >+ >+InternalDebugFeature::InternalDebugFeature(const WTF::String& name, const WTF::String& key, const WTF::String& details, bool defaultValue, bool hidden) >+ : m_name(name) >+ , m_key(key) >+ , m_details(details) >+ , m_defaultValue(defaultValue) >+ , m_hidden(hidden) >+{ >+} >+ >+InternalDebugFeature::~InternalDebugFeature() >+{ >+} >+ >+} >diff --git a/Source/WebKit/UIProcess/API/APIInternalDebugFeature.h b/Source/WebKit/UIProcess/API/APIInternalDebugFeature.h >new file mode 100644 >index 0000000000000000000000000000000000000000..f189becec774f1e9469fc8d6af1cbdfb34b6aa19 >--- /dev/null >+++ b/Source/WebKit/UIProcess/API/APIInternalDebugFeature.h >@@ -0,0 +1,54 @@ >+/* >+ * Copyright (C) 2018 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 "APIObject.h" >+#include <wtf/text/WTFString.h> >+ >+namespace API { >+ >+class InternalDebugFeature final : public ObjectImpl<Object::Type::InternalDebugFeature> { >+public: >+ static Ref<InternalDebugFeature> create(const WTF::String& name, const WTF::String& key, const WTF::String& details, bool defaultValue, bool hidden); >+ virtual ~InternalDebugFeature(); >+ >+ WTF::String name() const { return m_name; } >+ WTF::String key() const { return m_key; } >+ WTF::String details() const { return m_details; } >+ bool defaultValue() const { return m_defaultValue; } >+ bool isHidden() const { return m_hidden; } >+ >+private: >+ explicit InternalDebugFeature(const WTF::String& name, const WTF::String& key, const WTF::String& details, bool defaultValue, bool hidden); >+ >+ WTF::String m_name; >+ WTF::String m_key; >+ WTF::String m_details; >+ bool m_defaultValue; >+ bool m_hidden; >+}; >+ >+} >diff --git a/Source/WebKit/UIProcess/API/C/WKAPICast.h b/Source/WebKit/UIProcess/API/C/WKAPICast.h >index e65fd97026ce9d982843b39bb6f8798e2874912e..718707fa9136e3965b61bcc90d795f8361854a35 100644 >--- a/Source/WebKit/UIProcess/API/C/WKAPICast.h >+++ b/Source/WebKit/UIProcess/API/C/WKAPICast.h >@@ -54,6 +54,7 @@ > namespace API { > class ContentRuleList; > class ContentRuleListStore; >+class InternalDebugFeature; > class ExperimentalFeature; > class FrameHandle; > class FrameInfo; >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm b/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm >index 3e827ec44b21e71a5b465f3e8a6509a270664550..1eac6d7c6055d0ea3eb00ef1904a8e3cf69ef486 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm >@@ -32,8 +32,8 @@ > #import "PluginProcessManager.h" > #import "WKNSArray.h" > #import "WebPreferences.h" >-#import "_WKExperimentalFeature.h" > #import "_WKExperimentalFeatureInternal.h" >+#import "_WKInternalDebugFeatureInternal.h" > #import <WebCore/SecurityOrigin.h> > #import <WebCore/Settings.h> > #import <wtf/RetainPtr.h> >@@ -527,18 +527,46 @@ static _WKStorageBlockingPolicy toAPI(WebCore::SecurityOrigin::StorageBlockingPo > _preferences->setFixedFontFamily(fixedPitchFontFamily); > } > >++ (NSArray<_WKInternalDebugFeature *> *)_internalDebugFeatures >+{ >+ auto features = WebKit::WebPreferences::internalDebugFeatures(); >+ return wrapper(API::Array::create(WTFMove(features))); >+} >+ >+- (BOOL)_isEnabledForInternalDebugFeature:(_WKInternalDebugFeature *)feature >+{ >+ return _preferences->isEnabledForFeature(*feature->_internalDebugFeature); >+} >+ >+- (void)_setEnabled:(BOOL)value forInternalDebugFeature:(_WKInternalDebugFeature *)feature >+{ >+ _preferences->setEnabledForFeature(value, *feature->_internalDebugFeature); >+} >+ > + (NSArray<_WKExperimentalFeature *> *)_experimentalFeatures > { > auto features = WebKit::WebPreferences::experimentalFeatures(); > return wrapper(API::Array::create(WTFMove(features))); > } > >+// FIXME: Remove this once Safari has adopted the new API. > - (BOOL)_isEnabledForFeature:(_WKExperimentalFeature *)feature > { >- return _preferences->isEnabledForFeature(*feature->_experimentalFeature); >+ return [self _isEnabledForExperimentalFeature:feature]; > } > >+// FIXME: Remove this once Safari has adopted the new API. > - (void)_setEnabled:(BOOL)value forFeature:(_WKExperimentalFeature *)feature >+{ >+ [self _setEnabled:value forExperimentalFeature:feature]; >+} >+ >+- (BOOL)_isEnabledForExperimentalFeature:(_WKExperimentalFeature *)feature >+{ >+ return _preferences->isEnabledForFeature(*feature->_experimentalFeature); >+} >+ >+- (void)_setEnabled:(BOOL)value forExperimentalFeature:(_WKExperimentalFeature *)feature > { > _preferences->setEnabledForFeature(value, *feature->_experimentalFeature); > } >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h b/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h >index 3879e35ed325e857b0c5ab73cd7bdac419e6533c..100fda26c29acfa83e7837ee826de98e7bb35378 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h >@@ -55,6 +55,7 @@ typedef NS_ENUM(NSInteger, _WKEditableLinkBehavior) { > } WK_API_AVAILABLE(macosx(10.13.4), ios(11.3)); > > @class _WKExperimentalFeature; >+@class _WKInternalDebugFeature; > > @interface WKPreferences () <NSCopying> > @end >@@ -130,9 +131,15 @@ typedef NS_ENUM(NSInteger, _WKEditableLinkBehavior) { > > @property (nonatomic, setter=_setAVFoundationEnabled:) BOOL _avFoundationEnabled WK_API_AVAILABLE(macosx(10.10), ios(WK_IOS_TBA)); > >++ (NSArray<_WKInternalDebugFeature *> *)_internalDebugFeatures WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); >+- (BOOL)_isEnabledForInternalDebugFeature:(_WKInternalDebugFeature *)feature WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); >+- (void)_setEnabled:(BOOL)value forInternalDebugFeature:(_WKInternalDebugFeature *)feature WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); >+ > + (NSArray<_WKExperimentalFeature *> *)_experimentalFeatures WK_API_AVAILABLE(macosx(10.12), ios(10.0)); > - (BOOL)_isEnabledForFeature:(_WKExperimentalFeature *)feature WK_API_AVAILABLE(macosx(10.12), ios(10.0)); > - (void)_setEnabled:(BOOL)value forFeature:(_WKExperimentalFeature *)feature WK_API_AVAILABLE(macosx(10.12), ios(10.0)); >+- (BOOL)_isEnabledForExperimentalFeature:(_WKExperimentalFeature *)feature WK_API_AVAILABLE(macosx(10.12), ios(10.0)); >+- (void)_setEnabled:(BOOL)value forExperimentalFeature:(_WKExperimentalFeature *)feature WK_API_AVAILABLE(macosx(10.12), ios(10.0)); > > @property (nonatomic, setter=_setShouldEnableTextAutosizingBoost:) BOOL _shouldEnableTextAutosizingBoost WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); > >diff --git a/Source/WebKit/UIProcess/API/Cocoa/_WKInternalDebugFeature.h b/Source/WebKit/UIProcess/API/Cocoa/_WKInternalDebugFeature.h >new file mode 100644 >index 0000000000000000000000000000000000000000..751549462b60e117839d81925c59357226952098 >--- /dev/null >+++ b/Source/WebKit/UIProcess/API/Cocoa/_WKInternalDebugFeature.h >@@ -0,0 +1,43 @@ >+/* >+ * Copyright (C) 2018 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 <WebKit/WKFoundation.h> >+ >+#if WK_API_ENABLED >+ >+#import <Foundation/Foundation.h> >+ >+WK_CLASS_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)) >+@interface _WKInternalDebugFeature : NSObject >+ >+@property (nonatomic, readonly, copy) NSString *key; >+@property (nonatomic, readonly, copy) NSString *name; >+@property (nonatomic, readonly, copy) NSString *details; >+@property (nonatomic, readonly) BOOL defaultValue; >+@property (nonatomic, readonly, getter=isHidden) BOOL hidden; >+ >+@end >+ >+#endif >diff --git a/Source/WebKit/UIProcess/API/Cocoa/_WKInternalDebugFeature.mm b/Source/WebKit/UIProcess/API/Cocoa/_WKInternalDebugFeature.mm >new file mode 100644 >index 0000000000000000000000000000000000000000..6c7870745562883006253a3f6732b94f888606ed >--- /dev/null >+++ b/Source/WebKit/UIProcess/API/Cocoa/_WKInternalDebugFeature.mm >@@ -0,0 +1,79 @@ >+/* >+ * Copyright (C) 2018 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 "config.h" >+#import "_WKInternalDebugFeatureInternal.h" >+ >+#if WK_API_ENABLED >+ >+@implementation _WKInternalDebugFeature >+ >+- (void)dealloc >+{ >+ _internalDebugFeature->API::InternalDebugFeature::~InternalDebugFeature(); >+ >+ [super dealloc]; >+} >+ >+- (NSString *)description >+{ >+ return [NSString stringWithFormat:@"<%@: %p; name = %@; key = %@; defaultValue = %s >", NSStringFromClass(self.class), self, self.name, self.key, self.defaultValue ? "on" : "off"]; >+} >+ >+- (NSString *)name >+{ >+ return _internalDebugFeature->name(); >+} >+ >+- (NSString *)key >+{ >+ return _internalDebugFeature->key(); >+} >+ >+- (NSString *)details >+{ >+ return _internalDebugFeature->details(); >+} >+ >+- (BOOL)defaultValue >+{ >+ return _internalDebugFeature->defaultValue(); >+} >+ >+- (BOOL)isHidden >+{ >+ return _internalDebugFeature->isHidden(); >+} >+ >+#pragma mark WKObject protocol implementation >+ >+- (API::Object&)_apiObject >+{ >+ return *_internalDebugFeature; >+} >+ >+@end >+ >+#endif >diff --git a/Source/WebKit/UIProcess/API/Cocoa/_WKInternalDebugFeatureInternal.h b/Source/WebKit/UIProcess/API/Cocoa/_WKInternalDebugFeatureInternal.h >new file mode 100644 >index 0000000000000000000000000000000000000000..dffe9c12921549d5dda502680492815449d9827b >--- /dev/null >+++ b/Source/WebKit/UIProcess/API/Cocoa/_WKInternalDebugFeatureInternal.h >@@ -0,0 +1,47 @@ >+/* >+ * Copyright (C) 2018 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 "_WKInternalDebugFeature.h" >+ >+#if WK_API_ENABLED >+ >+#import "APIInternalDebugFeature.h" >+#import "WKObject.h" >+ >+namespace WebKit { >+ >+template<> struct WrapperTraits<API::InternalDebugFeature> { >+ using WrapperClass = _WKInternalDebugFeature; >+}; >+ >+} >+ >+@interface _WKInternalDebugFeature () <WKObject> { >+@package >+ API::ObjectStorage<API::InternalDebugFeature> _internalDebugFeature; >+} >+@end >+ >+#endif >diff --git a/Source/WebKit/UIProcess/WebPreferences.cpp b/Source/WebKit/UIProcess/WebPreferences.cpp >index 084bed3ec1bed62b242f6bbfa480180d8ef23854..44a0a02b98bc6cb1b1312dd6e3a5bb24cf32d1d9 100644 >--- a/Source/WebKit/UIProcess/WebPreferences.cpp >+++ b/Source/WebKit/UIProcess/WebPreferences.cpp >@@ -131,7 +131,7 @@ void WebPreferences::updateBoolValueForKey(const String& key, bool value) > update(); // FIXME: Only send over the changed key and value. > } > >-void WebPreferences::updateBoolValueForExperimentalFeatureKey(const String& key, bool value) >+void WebPreferences::updateBoolValueForInternalDebugFeatureKey(const String& key, bool value) > { > if (key == WebPreferencesKey::processSwapOnCrossSiteNavigationEnabledKey()) { > for (auto* page : m_pages) >@@ -143,6 +143,11 @@ void WebPreferences::updateBoolValueForExperimentalFeatureKey(const String& key, > update(); // FIXME: Only send over the changed key and value. > } > >+void WebPreferences::updateBoolValueForExperimentalFeatureKey(const String& key, bool value) >+{ >+ update(); // FIXME: Only send over the changed key and value. >+} >+ > void WebPreferences::updateUInt32ValueForKey(const String& key, uint32_t value) > { > platformUpdateUInt32ValueForKey(key, value); >diff --git a/Source/WebKit/UIProcess/WebPreferences.h b/Source/WebKit/UIProcess/WebPreferences.h >index 33e84a2ffc100ed375c16561155f3bb2f14fac05..8e81e62112e221021a747a50eaf8a282ee213b3c 100644 >--- a/Source/WebKit/UIProcess/WebPreferences.h >+++ b/Source/WebKit/UIProcess/WebPreferences.h >@@ -26,6 +26,7 @@ > #pragma once > > #include "APIExperimentalFeature.h" >+#include "APIInternalDebugFeature.h" > #include "APIObject.h" > #include "FontSmoothingLevel.h" > #include "WebPreferencesDefinitions.h" >@@ -60,8 +61,13 @@ public: > > FOR_EACH_WEBKIT_PREFERENCE(DECLARE_PREFERENCE_GETTER_AND_SETTERS) > FOR_EACH_WEBKIT_DEBUG_PREFERENCE(DECLARE_PREFERENCE_GETTER_AND_SETTERS) >+ FOR_EACH_WEBKIT_INTERNAL_DEBUG_FEATURE_PREFERENCE(DECLARE_PREFERENCE_GETTER_AND_SETTERS) > FOR_EACH_WEBKIT_EXPERIMENTAL_FEATURE_PREFERENCE(DECLARE_PREFERENCE_GETTER_AND_SETTERS) > >+ static const Vector<RefPtr<API::Object>>& internalDebugFeatures(); >+ bool isEnabledForFeature(const API::InternalDebugFeature&) const; >+ void setEnabledForFeature(bool, const API::InternalDebugFeature&); >+ > static const Vector<RefPtr<API::Object>>& experimentalFeatures(); > bool isEnabledForFeature(const API::ExperimentalFeature&) const; > void setEnabledForFeature(bool, const API::ExperimentalFeature&); >@@ -79,6 +85,7 @@ private: > > void updateStringValueForKey(const String& key, const String& value); > void updateBoolValueForKey(const String& key, bool value); >+ void updateBoolValueForInternalDebugFeatureKey(const String& key, bool value); > void updateBoolValueForExperimentalFeatureKey(const String& key, bool value); > void updateUInt32ValueForKey(const String& key, uint32_t value); > void updateDoubleValueForKey(const String& key, double value); >diff --git a/Source/WebKit/UIProcess/WebProcessPool.cpp b/Source/WebKit/UIProcess/WebProcessPool.cpp >index 14b67469caeec142532c0a9e5068a45715cf803b..4bbd736cb93f9d8bd69dccd6dafea8873697ce0f 100644 >--- a/Source/WebKit/UIProcess/WebProcessPool.cpp >+++ b/Source/WebKit/UIProcess/WebProcessPool.cpp >@@ -1159,7 +1159,7 @@ Ref<WebPageProxy> WebProcessPool::createWebPage(PageClient& pageClient, Ref<API: > auto page = process->createWebPage(pageClient, WTFMove(pageConfiguration)); > if (page->preferences().processSwapOnCrossSiteNavigationEnabled()) { > m_configuration->setProcessSwapsOnNavigation(true); >- // FIXME: For now, turning on PSON from the experimental features menu also turns on >+ // FIXME: For now, turning on PSON from the debug features menu also turns on > // automatic process warming until clients can be updated. > m_configuration->setIsAutomaticProcessWarmingEnabled(true); > } >diff --git a/Source/WebKit/WebKit.xcodeproj/project.pbxproj b/Source/WebKit/WebKit.xcodeproj/project.pbxproj >index 7a46bf54ded6397c4a8dba9a8fc13f5f15d09d2e..f681719e526e850cb7b2969be89c310d37094cc4 100644 >--- a/Source/WebKit/WebKit.xcodeproj/project.pbxproj >+++ b/Source/WebKit/WebKit.xcodeproj/project.pbxproj >@@ -751,6 +751,10 @@ > 31A2EC74148D59CA00810D71 /* WKNotificationPermissionRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 31A2EC72148D59BB00810D71 /* WKNotificationPermissionRequest.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 31A505FA1680025500A930EB /* WebContextClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 31A505F81680025500A930EB /* WebContextClient.h */; }; > 31A67E0D165B2A99006CBA66 /* PlugInAutoStartProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 31A67E0B165B2A99006CBA66 /* PlugInAutoStartProvider.h */; }; >+ 31B3628F2141EA5D007BFA53 /* APIInternalDebugFeature.h in Headers */ = {isa = PBXBuildFile; fileRef = 31B3628E2141EA4D007BFA53 /* APIInternalDebugFeature.h */; }; >+ 31B362952141EBCD007BFA53 /* _WKInternalDebugFeature.h in Headers */ = {isa = PBXBuildFile; fileRef = 31B362942141EBAD007BFA53 /* _WKInternalDebugFeature.h */; settings = {ATTRIBUTES = (Private, ); }; }; >+ 31B362972141EBD9007BFA53 /* _WKInternalDebugFeatureInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 31B362932141EBAD007BFA53 /* _WKInternalDebugFeatureInternal.h */; }; >+ 31B362992141F6E8007BFA53 /* WebPreferencesInternalDebugFeatures.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31B362982141F6E0007BFA53 /* WebPreferencesInternalDebugFeatures.cpp */; }; > 31BA924D148831260062EDB5 /* WebNotificationManagerMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31BA9248148830810062EDB5 /* WebNotificationManagerMessageReceiver.cpp */; }; > 31BA924E148831260062EDB5 /* WebNotificationManagerMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 31BA9249148830810062EDB5 /* WebNotificationManagerMessages.h */; }; > 31D5929F166E060000E6BF02 /* WebPlugInClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 31D5929D166E060000E6BF02 /* WebPlugInClient.h */; }; >@@ -2842,6 +2846,12 @@ > 31A505F81680025500A930EB /* WebContextClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebContextClient.h; sourceTree = "<group>"; }; > 31A67E0A165B2A99006CBA66 /* PlugInAutoStartProvider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlugInAutoStartProvider.cpp; sourceTree = "<group>"; }; > 31A67E0B165B2A99006CBA66 /* PlugInAutoStartProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlugInAutoStartProvider.h; sourceTree = "<group>"; }; >+ 31B3628E2141EA4D007BFA53 /* APIInternalDebugFeature.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = APIInternalDebugFeature.h; sourceTree = "<group>"; }; >+ 31B362902141EABC007BFA53 /* APIInternalDebugFeature.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = APIInternalDebugFeature.cpp; sourceTree = "<group>"; }; >+ 31B362922141EBAC007BFA53 /* _WKInternalDebugFeature.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKInternalDebugFeature.mm; sourceTree = "<group>"; }; >+ 31B362932141EBAD007BFA53 /* _WKInternalDebugFeatureInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKInternalDebugFeatureInternal.h; sourceTree = "<group>"; }; >+ 31B362942141EBAD007BFA53 /* _WKInternalDebugFeature.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKInternalDebugFeature.h; sourceTree = "<group>"; }; >+ 31B362982141F6E0007BFA53 /* WebPreferencesInternalDebugFeatures.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPreferencesInternalDebugFeatures.cpp; sourceTree = "<group>"; }; > 31BA9248148830810062EDB5 /* WebNotificationManagerMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebNotificationManagerMessageReceiver.cpp; sourceTree = "<group>"; }; > 31BA9249148830810062EDB5 /* WebNotificationManagerMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNotificationManagerMessages.h; sourceTree = "<group>"; }; > 31D5929C166E05FF00E6BF02 /* WebPlugInClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPlugInClient.cpp; sourceTree = "<group>"; }; >@@ -5947,6 +5957,9 @@ > 5CAFDE422130843500B1F7E1 /* _WKInspector.h */, > 5CAFDE432130843600B1F7E1 /* _WKInspector.mm */, > 5CAFDE442130843600B1F7E1 /* _WKInspectorInternal.h */, >+ 31B362942141EBAD007BFA53 /* _WKInternalDebugFeature.h */, >+ 31B362922141EBAC007BFA53 /* _WKInternalDebugFeature.mm */, >+ 31B362932141EBAD007BFA53 /* _WKInternalDebugFeatureInternal.h */, > 2D790A9C1AD7050D00AB90B3 /* _WKLayoutMode.h */, > 51C0C9791DDD78540032CAD3 /* _WKLinkIconParameters.h */, > 51C0C97A1DDD78540032CAD3 /* _WKLinkIconParameters.mm */, >@@ -7406,6 +7419,8 @@ > 7AB6EA441EEAAE2300037B2B /* APIIconDatabaseClient.h */, > 5143B2611DDD0DA00014FAC6 /* APIIconLoadingClient.h */, > 7A8A9D571EF119AA009801AE /* APIInjectedBundleClient.h */, >+ 31B362902141EABC007BFA53 /* APIInternalDebugFeature.cpp */, >+ 31B3628E2141EA4D007BFA53 /* APIInternalDebugFeature.h */, > 7CE4D2061A46775700C7F152 /* APILegacyContextHistoryClient.h */, > 1A2464F21891E45100234C5B /* APILoaderClient.h */, > 7CD3A4801A5D02FA009623B8 /* APINavigation.cpp */, >@@ -8398,6 +8413,7 @@ > 1AB1F7951D1B3613007C9BD1 /* WebPaymentCoordinatorProxyMessages.h */, > 7CDE73A31F9DAB6500390312 /* WebPreferencesDefinitions.h */, > 7CEB00DC1FA69A890065473B /* WebPreferencesExperimentalFeatures.cpp */, >+ 31B362982141F6E0007BFA53 /* WebPreferencesInternalDebugFeatures.cpp */, > 7CB100EE1FA2D74A001729EE /* WebPreferencesKeys.cpp */, > 7CB100EF1FA2D74B001729EE /* WebPreferencesKeys.h */, > 7CB100F01FA2D784001729EE /* WebPreferencesStoreDefaultsMap.cpp */, >@@ -8724,6 +8740,8 @@ > 37A64E5518F38E3C00EB30F1 /* _WKInputDelegate.h in Headers */, > 5CAFDE452130846300B1F7E1 /* _WKInspector.h in Headers */, > 5CAFDE472130846A00B1F7E1 /* _WKInspectorInternal.h in Headers */, >+ 31B362952141EBCD007BFA53 /* _WKInternalDebugFeature.h in Headers */, >+ 31B362972141EBD9007BFA53 /* _WKInternalDebugFeatureInternal.h in Headers */, > 2D790A9D1AD7050D00AB90B3 /* _WKLayoutMode.h in Headers */, > 510F59111DDE297000412FF5 /* _WKLinkIconParameters.h in Headers */, > A118A9F31908B8EA00F7C92B /* _WKNSFileManagerExtras.h in Headers */, >@@ -8803,6 +8821,7 @@ > 7A3ACE1B1EEEF79B00A864A4 /* APIInjectedBundlePageLoaderClient.h in Headers */, > 7A8A9D5C1EF14598009801AE /* APIInjectedBundlePageResourceLoadClient.h in Headers */, > 3769079A18F31CB2001DFF04 /* APIInjectedBundlePageUIClient.h in Headers */, >+ 31B3628F2141EA5D007BFA53 /* APIInternalDebugFeature.h in Headers */, > 7CE4D2071A46776100C7F152 /* APILegacyContextHistoryClient.h in Headers */, > 1A2464F31891E45100234C5B /* APILoaderClient.h in Headers */, > 7CD3A4831A5D02FA009623B8 /* APINavigation.h in Headers */, >@@ -10943,6 +10962,7 @@ > 2D92A78D212B6AB100F493FD /* WebPlatformTouchPoint.cpp in Sources */, > 2D91344E212CF9F000128AFD /* WebPluginInfoProvider.cpp in Sources */, > 7CEB00DD1FA69ABE0065473B /* WebPreferencesExperimentalFeatures.cpp in Sources */, >+ 31B362992141F6E8007BFA53 /* WebPreferencesInternalDebugFeatures.cpp in Sources */, > 7CB100F11FA3858A001729EE /* WebPreferencesKeys.cpp in Sources */, > 7CB100F41FA38592001729EE /* WebPreferencesStoreDefaultsMap.cpp in Sources */, > 1A043A0A124D11A900FFBFB5 /* WebProcessConnection.cpp in Sources */, >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index e60abee4189f1442afc52c598099305a20175ed1..4257da6892006ee3687ee804870104353ba698bf 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1 +1,19 @@ >+2018-09-07 Dean Jackson <dino@apple.com> >+ >+ Add and expose Internal features from WebKit >+ https://bugs.webkit.org/show_bug.cgi?id=189442 >+ <rdar://problem/44243404> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Update MiniBrowser to expose an Internal feature menu. >+ >+ * MiniBrowser/mac/AppDelegate.m: >+ (defaultConfiguration): >+ * MiniBrowser/mac/SettingsController.m: >+ (-[SettingsController _populateMenu]): >+ (-[SettingsController validateMenuItem:]): >+ (-[SettingsController toggleExperimentalFeature:]): >+ (-[SettingsController toggleInternalDebugFeature:]): >+ > == Rolled over to ChangeLog-2018-09-11 == >diff --git a/Tools/MiniBrowser/mac/AppDelegate.m b/Tools/MiniBrowser/mac/AppDelegate.m >index 3a369a409c4bcda75a1136c1123a0863d5770ea7..25617ec4d66cfab44ec9a3ac07e11ac403f68cc1 100644 >--- a/Tools/MiniBrowser/mac/AppDelegate.m >+++ b/Tools/MiniBrowser/mac/AppDelegate.m >@@ -40,6 +40,7 @@ > > #if WK_API_ENABLED > #import <WebKit/_WKExperimentalFeature.h> >+#import <WebKit/_WKInternalDebugFeature.h> > #endif > > enum { >@@ -106,10 +107,16 @@ - (void)awakeFromNib > configuration.processPool = [[[WKProcessPool alloc] _initWithConfiguration:processConfiguration] autorelease]; > > #if WK_API_ENABLED >- NSArray<_WKExperimentalFeature *> *features = [WKPreferences _experimentalFeatures]; >- for (_WKExperimentalFeature *feature in features) { >+ NSArray<_WKExperimentalFeature *> *experimentalFeatures = [WKPreferences _experimentalFeatures]; >+ for (_WKExperimentalFeature *feature in experimentalFeatures) { > BOOL enabled = [[NSUserDefaults standardUserDefaults] boolForKey:feature.key]; >- [configuration.preferences _setEnabled:enabled forFeature:feature]; >+ [configuration.preferences _setEnabled:enabled forExperimentalFeature:feature]; >+ } >+ >+ NSArray<_WKInternalDebugFeature *> *internalDebugFeatures = [WKPreferences _internalDebugFeatures]; >+ for (_WKInternalDebugFeature *feature in internalDebugFeatures) { >+ BOOL enabled = [[NSUserDefaults standardUserDefaults] boolForKey:feature.key]; >+ [configuration.preferences _setEnabled:enabled forInternalDebugFeature:feature]; > } > #endif > } >diff --git a/Tools/MiniBrowser/mac/SettingsController.m b/Tools/MiniBrowser/mac/SettingsController.m >index 704170dfa6f244dac419fdcd28addaf07cf09aab..24a37de90852890a2fabe3f9a959d9d45b8c5860 100644 >--- a/Tools/MiniBrowser/mac/SettingsController.m >+++ b/Tools/MiniBrowser/mac/SettingsController.m >@@ -32,6 +32,7 @@ > > #if WK_API_ENABLED > #import <WebKit/_WKExperimentalFeature.h> >+#import <WebKit/_WKInternalDebugFeature.h> > #endif > > static NSString * const defaultURL = @"http://www.webkit.org/"; >@@ -81,6 +82,7 @@ typedef NS_ENUM(NSInteger, DebugOverylayMenuItemTag) { > WheelEventHandlerRegionOverlayTag, > #if WK_API_ENABLED > ExperimentalFeatureTag, >+ InternalDebugFeatureTag, > #endif > }; > >@@ -212,9 +214,9 @@ - (void)_populateMenu > NSMenu *experimentalFeaturesMenu = [[NSMenu alloc] initWithTitle:@"Experimental Features"]; > [experimentalFeaturesSubmenuItem setSubmenu:experimentalFeaturesMenu]; > >- NSArray<_WKExperimentalFeature *> *features = [WKPreferences _experimentalFeatures]; >+ NSArray<_WKExperimentalFeature *> *experimentalFeatures = [WKPreferences _experimentalFeatures]; > >- for (_WKExperimentalFeature *feature in features) { >+ for (_WKExperimentalFeature *feature in experimentalFeatures) { > NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:feature.name action:@selector(toggleExperimentalFeature:) keyEquivalent:@""]; > item.toolTip = feature.details; > item.representedObject = feature; >@@ -227,6 +229,26 @@ - (void)_populateMenu > [_menu addItem:experimentalFeaturesSubmenuItem]; > [experimentalFeaturesSubmenuItem release]; > [experimentalFeaturesMenu release]; >+ >+ NSMenuItem *internalDebugFeaturesSubmenuItem = [[NSMenuItem alloc] initWithTitle:@"Internal Features" action:nil keyEquivalent:@""]; >+ NSMenu *internalDebugFeaturesMenu = [[NSMenu alloc] initWithTitle:@"Internal Features"]; >+ [internalDebugFeaturesSubmenuItem setSubmenu:internalDebugFeaturesMenu]; >+ >+ NSArray<_WKInternalDebugFeature *> *internalDebugFeatures = [WKPreferences _internalDebugFeatures]; >+ >+ for (_WKInternalDebugFeature *feature in internalDebugFeatures) { >+ NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:feature.name action:@selector(toggleInternalDebugFeature:) keyEquivalent:@""]; >+ item.toolTip = feature.details; >+ item.representedObject = feature; >+ >+ [item setTag:InternalDebugFeatureTag]; >+ [item setTarget:self]; >+ [internalDebugFeaturesMenu addItem:[item autorelease]]; >+ } >+ >+ [_menu addItem:internalDebugFeaturesSubmenuItem]; >+ [internalDebugFeaturesSubmenuItem release]; >+ [internalDebugFeaturesMenu release]; > #endif // WK_API_ENABLED > > [self _addHeaderWithTitle:@"WebKit1-only Settings"]; >@@ -301,7 +323,11 @@ - (BOOL)validateMenuItem:(NSMenuItem *)menuItem > #if WK_API_ENABLED > if (menuItem.tag == ExperimentalFeatureTag) { > _WKExperimentalFeature *feature = menuItem.representedObject; >- [menuItem setState:[defaultPreferences() _isEnabledForFeature:feature] ? NSControlStateValueOn : NSControlStateValueOff]; >+ [menuItem setState:[defaultPreferences() _isEnabledForExperimentalFeature:feature] ? NSControlStateValueOn : NSControlStateValueOff]; >+ } >+ if (menuItem.tag == InternalDebugFeatureTag) { >+ _WKInternalDebugFeature *feature = menuItem.representedObject; >+ [menuItem setState:[defaultPreferences() _isEnabledForInternalDebugFeature:feature] ? NSControlStateValueOn : NSControlStateValueOff]; > } > #endif > >@@ -654,8 +680,19 @@ - (void)toggleExperimentalFeature:(id)sender > _WKExperimentalFeature *feature = ((NSMenuItem *)sender).representedObject; > WKPreferences *preferences = defaultPreferences(); > >- BOOL currentlyEnabled = [preferences _isEnabledForFeature:feature]; >- [preferences _setEnabled:!currentlyEnabled forFeature:feature]; >+ BOOL currentlyEnabled = [preferences _isEnabledForExperimentalFeature:feature]; >+ [preferences _setEnabled:!currentlyEnabled forExperimentalFeature:feature]; >+ >+ [[NSUserDefaults standardUserDefaults] setBool:!currentlyEnabled forKey:feature.key]; >+} >+ >+- (void)toggleInternalDebugFeature:(id)sender >+{ >+ _WKInternalDebugFeature *feature = ((NSMenuItem *)sender).representedObject; >+ WKPreferences *preferences = defaultPreferences(); >+ >+ BOOL currentlyEnabled = [preferences _isEnabledForInternalDebugFeature:feature]; >+ [preferences _setEnabled:!currentlyEnabled forInternalDebugFeature:feature]; > > [[NSUserDefaults standardUserDefaults] setBool:!currentlyEnabled forKey:feature.key]; > } >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index a22a35199c4bef46e98678f4b6f391920e7a8aeb..520a2dde26457ec7fcd46a049abed082c08aec73 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,17 @@ >+2018-09-07 Dean Jackson <dino@apple.com> >+ >+ Add and expose Internal features from WebKit >+ https://bugs.webkit.org/show_bug.cgi?id=189442 >+ <rdar://problem/44243404> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Skip some tests that rely on an experimental feature that has >+ moved to internal. A follow-up patch will allow WKTR to enable >+ them on demand. >+ >+ * platform/mac/TestExpectations: >+ > 2018-09-11 Myles C. Maxfield <mmaxfield@apple.com> > > Crash under PlatformPopupMenuData::encode when interacting with a select menu that has variable fonts >diff --git a/LayoutTests/platform/mac/TestExpectations b/LayoutTests/platform/mac/TestExpectations >index b4d9fc4aa1ad39f8efd1fb1a6cc449ae38ef1c44..c4bb160d375a2917664ade9cbe37897b02727f8a 100644 >--- a/LayoutTests/platform/mac/TestExpectations >+++ b/LayoutTests/platform/mac/TestExpectations >@@ -1765,3 +1765,6 @@ webkit.org/b/187393 imported/w3c/web-platform-tests/2dcontext/imagebitmap/create > [ Mojave+ ] fast/gradients/conic-extended-stops.html [ Pass ] > [ Mojave+ ] fast/gradients/conic-from-angle.html [ Pass ] > >+# Mark these as failing while Internal Debug Features default to off in WKTR >+imported/w3c/web-platform-tests/media-source/mediasource-changetype.html [ Pass Failure ] >+imported/w3c/web-platform-tests/media-source/mediasource-changetype-play.html [ Pass Failure ]
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
simon.fraser
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 189442
:
349215
|
349218
|
349455
|
349458
| 349461