Title: [235921] trunk
Revision
235921
Author
[email protected]
Date
2018-09-11 16:23:38 -0700 (Tue, 11 Sep 2018)

Log Message

Add and expose Internal features from WebKit
https://bugs.webkit.org/show_bug.cgi?id=189442
<rdar://problem/44243404>

Reviewed by Simon Fraser.

Source/WebKit:

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):

Tools:

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:]):

LayoutTests:

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:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (235920 => 235921)


--- trunk/LayoutTests/ChangeLog	2018-09-11 23:19:02 UTC (rev 235920)
+++ trunk/LayoutTests/ChangeLog	2018-09-11 23:23:38 UTC (rev 235921)
@@ -1,3 +1,17 @@
+2018-09-07  Dean Jackson  <[email protected]>
+
+        Add and expose Internal features from WebKit
+        https://bugs.webkit.org/show_bug.cgi?id=189442
+        <rdar://problem/44243404>
+
+        Reviewed by Simon Fraser.
+
+        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  Jer Noble  <[email protected]>
 
         [MediaCapabilities] Implement MediaEngineConfigurationFactory registration

Modified: trunk/LayoutTests/platform/mac/TestExpectations (235920 => 235921)


--- trunk/LayoutTests/platform/mac/TestExpectations	2018-09-11 23:19:02 UTC (rev 235920)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2018-09-11 23:23:38 UTC (rev 235921)
@@ -1765,3 +1765,6 @@
 [ 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 ]

Modified: trunk/Source/WebKit/CMakeLists.txt (235920 => 235921)


--- trunk/Source/WebKit/CMakeLists.txt	2018-09-11 23:19:02 UTC (rev 235920)
+++ trunk/Source/WebKit/CMakeLists.txt	2018-09-11 23:23:38 UTC (rev 235921)
@@ -399,6 +399,7 @@
     ${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
@@ -405,7 +406,7 @@
 )
 
 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_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
 )

Modified: trunk/Source/WebKit/ChangeLog (235920 => 235921)


--- trunk/Source/WebKit/ChangeLog	2018-09-11 23:19:02 UTC (rev 235920)
+++ trunk/Source/WebKit/ChangeLog	2018-09-11 23:23:38 UTC (rev 235921)
@@ -1,3 +1,74 @@
+2018-09-07  Dean Jackson  <[email protected]>
+
+        Add and expose Internal features from WebKit
+        https://bugs.webkit.org/show_bug.cgi?id=189442
+        <rdar://problem/44243404>
+
+        Reviewed by Simon Fraser.
+
+        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  Eric Carlson  <[email protected]>
 
         WebPage::close should clear UserMediaPermissionRequestManager

Modified: trunk/Source/WebKit/DerivedSources.make (235920 => 235921)


--- trunk/Source/WebKit/DerivedSources.make	2018-09-11 23:19:02 UTC (rev 235920)
+++ trunk/Source/WebKit/DerivedSources.make	2018-09-11 23:23:38 UTC (rev 235921)
@@ -295,6 +295,7 @@
     $(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 \
@@ -301,8 +302,8 @@
 
 #
 
-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
 

Modified: trunk/Source/WebKit/Scripts/GeneratePreferences.rb (235920 => 235921)


--- trunk/Source/WebKit/Scripts/GeneratePreferences.rb	2018-09-11 23:19:02 UTC (rev 235920)
+++ trunk/Source/WebKit/Scripts/GeneratePreferences.rb	2018-09-11 23:23:38 UTC (rev 235921)
@@ -28,7 +28,7 @@
 require 'optparse'
 require 'yaml'
 
-options = { 
+options = {
   :input => nil,
   :outputDirectory => nil
 }
@@ -128,7 +128,7 @@
 
 class Preferences
   attr_accessor :preferences
-  
+
   def initialize(hash)
     @preferences = []
     hash.each do |name, options|
@@ -135,10 +135,11 @@
       @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/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"))

Modified: trunk/Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb (235920 => 235921)


--- trunk/Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb	2018-09-11 23:19:02 UTC (rev 235920)
+++ trunk/Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb	2018-09-11 23:23:38 UTC (rev 235921)
@@ -46,7 +46,14 @@
 <%- 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
 
 #define FOR_EACH_WEBKIT_EXPERIMENTAL_FEATURE_PREFERENCE(macro) \

Modified: trunk/Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb (235920 => 235921)


--- trunk/Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb	2018-09-11 23:19:02 UTC (rev 235920)
+++ trunk/Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb	2018-09-11 23:23:38 UTC (rev 235921)
@@ -63,7 +63,7 @@
     return features;
 }
 
-bool WebPreferences::isEnabledForFeature(const API::ExperimentalFeature& feature) const
+bool WebPreferences::isFeatureEnabled(const API::ExperimentalFeature& feature) const
 {
     struct FeatureGetterMapping {
         const char* name;
@@ -92,7 +92,7 @@
     return false;
 }
 
-void WebPreferences::setEnabledForFeature(bool value, const API::ExperimentalFeature& feature)
+void WebPreferences::setFeatureEnabled(const API::ExperimentalFeature& feature, bool value)
 {
     struct FeatureSetterMapping {
         const char* name;

Added: trunk/Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb (0 => 235921)


--- trunk/Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb	                        (rev 0)
+++ trunk/Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb	2018-09-11 23:23:38 UTC (rev 235921)
@@ -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::isFeatureEnabled(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::setFeatureEnabled(const API::InternalDebugFeature& feature, bool value)
+{
+    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;
+        }
+    }
+}
+
+}

Modified: trunk/Source/WebKit/Shared/API/APIObject.h (235920 => 235921)


--- trunk/Source/WebKit/Shared/API/APIObject.h	2018-09-11 23:19:02 UTC (rev 235920)
+++ trunk/Source/WebKit/Shared/API/APIObject.h	2018-09-11 23:23:38 UTC (rev 235921)
@@ -110,6 +110,7 @@
         ContentRuleListStore,
         ContextMenuListener,
         CookieManager,
+        InternalDebugFeature,
         Download,
         ExperimentalFeature,
         FormSubmissionListener,

Modified: trunk/Source/WebKit/Shared/Cocoa/APIObject.mm (235920 => 235921)


--- trunk/Source/WebKit/Shared/Cocoa/APIObject.mm	2018-09-11 23:19:02 UTC (rev 235920)
+++ trunk/Source/WebKit/Shared/Cocoa/APIObject.mm	2018-09-11 23:23:38 UTC (rev 235921)
@@ -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 @@
         wrapper = [WKNSData alloc];
         break;
 
+    case Type::InternalDebugFeature:
+        wrapper = [_WKInternalDebugFeature alloc];
+        break;
+
     case Type::Dictionary:
         wrapper = [WKNSDictionary alloc];
         break;

Modified: trunk/Source/WebKit/Shared/WebPreferences.yaml (235920 => 235921)


--- trunk/Source/WebKit/Shared/WebPreferences.yaml	2018-09-11 23:19:02 UTC (rev 235920)
+++ trunk/Source/WebKit/Shared/WebPreferences.yaml	2018-09-11 23:23:38 UTC (rev 235921)
@@ -1127,7 +1127,7 @@
 
 # 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
@@ -1134,13 +1134,6 @@
 #   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 @@
   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 @@
 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 @@
   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,39 +1230,104 @@
   category: experimental
   condition: PLATFORM(GTK) || PLATFORM(WPE)
 
+ServerTimingEnabled:
+  type: bool
+  defaultValue: false
+  humanReadableName: "Server Timing"
+  humanReadableDescription: "Enable Server Timing API"
+  category: experimental
+  webcoreBinding: RuntimeEnabledFeatures
+  webcoreName: serverTimingEnabled
+
+EncryptedMediaAPIEnabled:
+  type: bool
+  defaultValue: DEFAULT_EXPERIMENTAL_FEATURES_ENABLED
+  humanReadableName: "Modern Encrypted Media API"
+  humanReadableDescription: "Enable Modern Encrypted Media API"
+  webcoreBinding: RuntimeEnabledFeatures
+  category: experimental
+  condition: ENABLE(ENCRYPTED_MEDIA)
+
+# 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: internal
+  webcoreBinding: RuntimeEnabledFeatures
+  webcoreName: experimentalPlugInSandboxProfilesEnabled
+
+ProcessSwapOnCrossSiteNavigationEnabled:
+  type: bool
+  defaultValue: false
+  humanReadableName: "Swap Processes on Cross-Site Navigation"
+  humanReadableDescription: "Swap WebContent processes on cross-site navigations"
+  category: internal
+  webcoreBinding: none
+
+SourceBufferChangeTypeEnabled:
+  type: bool
+  defaultValue: false
+  humanReadableName: "Media Source Codec Switching Support"
+  humanReadableDescription: "Media Source Codec Switching through changeType()"
+  category: internal
+  condition: ENABLE(MEDIA_SOURCE)
+
 ResourceLoadStatisticsDebugMode:
   type: bool
   defaultValue: false
   humanReadableName: "ITP Debug Mode"
   humanReadableDescription: "Intelligent Tracking Prevention Debug Mode"
-  category: experimental
+  category: internal
   webcoreBinding: RuntimeEnabledFeatures
 
-WebGLCompressedTextureASTCSupportEnabled:
+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: "ASTC Texture Support"
-  humanReadableDescription: "Support for ASTC compressed texture formats in WebGL"
-  category: experimental
+  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)
 
-ServerTimingEnabled:
+FetchAPIKeepAliveEnabled:
   type: bool
   defaultValue: false
-  humanReadableName: "Server Timing"
-  humanReadableDescription: "Enable Server Timing API"
-  category: experimental
+  humanReadableName: "Fetch API Request KeepAlive"
+  humanReadableDescription: "Enable Fetch API Request KeepAlive"
+  category: internal
   webcoreBinding: RuntimeEnabledFeatures
-  webcoreName: serverTimingEnabled
+  webcoreName: fetchAPIKeepAliveEnabled
 
-ExperimentalPlugInSandboxProfilesEnabled:
+WebGLCompressedTextureASTCSupportEnabled:
   type: bool
   defaultValue: false
-  humanReadableName: "Sandbox Plug-Ins"
-  humanReadableDescription: "Enable Plug-In sandboxing"
-  category: debug
+  humanReadableName: "ASTC Texture Support"
+  humanReadableDescription: "Support for ASTC compressed texture formats in WebGL"
+  category: internal
   webcoreBinding: RuntimeEnabledFeatures
-  webcoreName: experimentalPlugInSandboxProfilesEnabled
 
 FullScreenEnabled:
   type: bool
@@ -1314,33 +1336,16 @@
   hidden: EXPERIMENTAL_FULLSCREEN_API_HIDDEN
   humanReadableName: "Fullscreen API"
   humanReadableDescription: "Fullscreen API"
-  category: experimental
+  category: internal
 
-EncryptedMediaAPIEnabled:
+AriaReflectionEnabled:
   type: bool
-  defaultValue: DEFAULT_EXPERIMENTAL_FEATURES_ENABLED
-  humanReadableName: "Modern Encrypted Media API"
-  humanReadableDescription: "Modern Encrypted Media API"
+  defaultValue: true
+  humanReadableName: "ARIA Reflection"
+  humanReadableDescription: "ARIA Reflection support"
+  category: internal
   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
-  webcoreBinding: none
-
-SourceBufferChangeTypeEnabled:
-  type: bool
-  defaultValue: DEFAULT_EXPERIMENTAL_FEATURES_ENABLED
-  humanReadableName: "Media Source Codec Switching Support"
-  humanReadableDescription: "Enable Media Source Codec Switching through changeType()"
-  category: experimental
-  condition: ENABLE(MEDIA_SOURCE)
-
 WebAPIStatisticsEnabled:
   type: bool
   defaultValue: false
@@ -1347,4 +1352,4 @@
   humanReadableName: "Web API Statistics"
   humanReadableDescription: "Enable Web API Statistics"
   webcoreBinding: RuntimeEnabledFeatures
-  category: experimental
+  category: internal

Modified: trunk/Source/WebKit/Sources.txt (235920 => 235921)


--- trunk/Source/WebKit/Sources.txt	2018-09-11 23:19:02 UTC (rev 235920)
+++ trunk/Source/WebKit/Sources.txt	2018-09-11 23:23:38 UTC (rev 235921)
@@ -292,6 +292,7 @@
 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

Modified: trunk/Source/WebKit/SourcesCocoa.txt (235920 => 235921)


--- trunk/Source/WebKit/SourcesCocoa.txt	2018-09-11 23:19:02 UTC (rev 235920)
+++ trunk/Source/WebKit/SourcesCocoa.txt	2018-09-11 23:23:38 UTC (rev 235921)
@@ -240,6 +240,7 @@
 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

Modified: trunk/Source/WebKit/UIProcess/API/APIExperimentalFeature.cpp (235920 => 235921)


--- trunk/Source/WebKit/UIProcess/API/APIExperimentalFeature.cpp	2018-09-11 23:19:02 UTC (rev 235920)
+++ trunk/Source/WebKit/UIProcess/API/APIExperimentalFeature.cpp	2018-09-11 23:23:38 UTC (rev 235921)
@@ -42,8 +42,4 @@
 {
 }
 
-ExperimentalFeature::~ExperimentalFeature()
-{
 }
-
-}

Modified: trunk/Source/WebKit/UIProcess/API/APIExperimentalFeature.h (235920 => 235921)


--- trunk/Source/WebKit/UIProcess/API/APIExperimentalFeature.h	2018-09-11 23:19:02 UTC (rev 235920)
+++ trunk/Source/WebKit/UIProcess/API/APIExperimentalFeature.h	2018-09-11 23:23:38 UTC (rev 235921)
@@ -34,7 +34,7 @@
 class ExperimentalFeature final : public ObjectImpl<Object::Type::ExperimentalFeature> {
 public:
     static Ref<ExperimentalFeature> create(const WTF::String& name, const WTF::String& key, const WTF::String& details, bool defaultValue, bool hidden);
-    virtual ~ExperimentalFeature();
+    virtual ~ExperimentalFeature() = default;
 
     WTF::String name() const { return m_name; }
     WTF::String key() const { return m_key; }

Copied: trunk/Source/WebKit/UIProcess/API/APIInternalDebugFeature.cpp (from rev 235920, trunk/Source/WebKit/UIProcess/API/APIExperimentalFeature.cpp) (0 => 235921)


--- trunk/Source/WebKit/UIProcess/API/APIInternalDebugFeature.cpp	                        (rev 0)
+++ trunk/Source/WebKit/UIProcess/API/APIInternalDebugFeature.cpp	2018-09-11 23:23:38 UTC (rev 235921)
@@ -0,0 +1,45 @@
+/*
+ * 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)
+{
+}
+
+}

Copied: trunk/Source/WebKit/UIProcess/API/APIInternalDebugFeature.h (from rev 235920, trunk/Source/WebKit/UIProcess/API/APIExperimentalFeature.h) (0 => 235921)


--- trunk/Source/WebKit/UIProcess/API/APIInternalDebugFeature.h	                        (rev 0)
+++ trunk/Source/WebKit/UIProcess/API/APIInternalDebugFeature.h	2018-09-11 23:23:38 UTC (rev 235921)
@@ -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() = default;
+
+    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;
+};
+
+}

Modified: trunk/Source/WebKit/UIProcess/API/C/WKAPICast.h (235920 => 235921)


--- trunk/Source/WebKit/UIProcess/API/C/WKAPICast.h	2018-09-11 23:19:02 UTC (rev 235920)
+++ trunk/Source/WebKit/UIProcess/API/C/WKAPICast.h	2018-09-11 23:23:38 UTC (rev 235921)
@@ -54,6 +54,7 @@
 namespace API {
 class ContentRuleList;
 class ContentRuleListStore;
+class InternalDebugFeature;
 class ExperimentalFeature;
 class FrameHandle;
 class FrameInfo;

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm (235920 => 235921)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm	2018-09-11 23:19:02 UTC (rev 235920)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm	2018-09-11 23:23:38 UTC (rev 235921)
@@ -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,6 +527,22 @@
     _preferences->setFixedFontFamily(fixedPitchFontFamily);
 }
 
++ (NSArray<_WKInternalDebugFeature *> *)_internalDebugFeatures
+{
+    auto features = WebKit::WebPreferences::internalDebugFeatures();
+    return wrapper(API::Array::create(WTFMove(features)));
+}
+
+- (BOOL)_isEnabledForInternalDebugFeature:(_WKInternalDebugFeature *)feature
+{
+    return _preferences->isFeatureEnabled(*feature->_internalDebugFeature);
+}
+
+- (void)_setEnabled:(BOOL)value forInternalDebugFeature:(_WKInternalDebugFeature *)feature
+{
+    _preferences->setFeatureEnabled(*feature->_internalDebugFeature, value);
+}
+
 + (NSArray<_WKExperimentalFeature *> *)_experimentalFeatures
 {
     auto features = WebKit::WebPreferences::experimentalFeatures();
@@ -533,16 +549,28 @@
     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
 {
-    _preferences->setEnabledForFeature(value, *feature->_experimentalFeature);
+    [self _setEnabled:value forExperimentalFeature:feature];
 }
 
+- (BOOL)_isEnabledForExperimentalFeature:(_WKExperimentalFeature *)feature
+{
+    return _preferences->isFeatureEnabled(*feature->_experimentalFeature);
+}
+
+- (void)_setEnabled:(BOOL)value forExperimentalFeature:(_WKExperimentalFeature *)feature
+{
+    _preferences->setFeatureEnabled(*feature->_experimentalFeature, value);
+}
+
 - (BOOL)_applePayCapabilityDisclosureAllowed
 {
 #if ENABLE(APPLE_PAY)

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h (235920 => 235921)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h	2018-09-11 23:19:02 UTC (rev 235920)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h	2018-09-11 23:23:38 UTC (rev 235921)
@@ -55,6 +55,7 @@
 } WK_API_AVAILABLE(macosx(10.13.4), ios(11.3));
 
 @class _WKExperimentalFeature;
+@class _WKInternalDebugFeature;
 
 @interface WKPreferences () <NSCopying>
 @end
@@ -130,9 +131,15 @@
 
 @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));
 

Copied: trunk/Source/WebKit/UIProcess/API/Cocoa/_WKInternalDebugFeature.h (from rev 235920, trunk/Source/WebKit/UIProcess/API/APIExperimentalFeature.cpp) (0 => 235921)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/_WKInternalDebugFeature.h	                        (rev 0)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/_WKInternalDebugFeature.h	2018-09-11 23:23:38 UTC (rev 235921)
@@ -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

Copied: trunk/Source/WebKit/UIProcess/API/Cocoa/_WKInternalDebugFeature.mm (from rev 235920, trunk/Source/WebKit/UIProcess/API/APIExperimentalFeature.cpp) (0 => 235921)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/_WKInternalDebugFeature.mm	                        (rev 0)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/_WKInternalDebugFeature.mm	2018-09-11 23:23:38 UTC (rev 235921)
@@ -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

Copied: trunk/Source/WebKit/UIProcess/API/Cocoa/_WKInternalDebugFeatureInternal.h (from rev 235920, trunk/Source/WebKit/UIProcess/API/APIExperimentalFeature.cpp) (0 => 235921)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/_WKInternalDebugFeatureInternal.h	                        (rev 0)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/_WKInternalDebugFeatureInternal.h	2018-09-11 23:23:38 UTC (rev 235921)
@@ -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

Modified: trunk/Source/WebKit/UIProcess/WebPreferences.cpp (235920 => 235921)


--- trunk/Source/WebKit/UIProcess/WebPreferences.cpp	2018-09-11 23:19:02 UTC (rev 235920)
+++ trunk/Source/WebKit/UIProcess/WebPreferences.cpp	2018-09-11 23:23:38 UTC (rev 235921)
@@ -131,7 +131,7 @@
     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 @@
     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);

Modified: trunk/Source/WebKit/UIProcess/WebPreferences.h (235920 => 235921)


--- trunk/Source/WebKit/UIProcess/WebPreferences.h	2018-09-11 23:19:02 UTC (rev 235920)
+++ trunk/Source/WebKit/UIProcess/WebPreferences.h	2018-09-11 23:23:38 UTC (rev 235921)
@@ -26,6 +26,7 @@
 #pragma once
 
 #include "APIExperimentalFeature.h"
+#include "APIInternalDebugFeature.h"
 #include "APIObject.h"
 #include "FontSmoothingLevel.h"
 #include "WebPreferencesDefinitions.h"
@@ -60,13 +61,18 @@
 
     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>>& experimentalFeatures();
-    bool isEnabledForFeature(const API::ExperimentalFeature&) const;
-    void setEnabledForFeature(bool, const API::ExperimentalFeature&);
+    bool isFeatureEnabled(const API::ExperimentalFeature&) const;
+    void setFeatureEnabled(const API::ExperimentalFeature&, bool);
     void enableAllExperimentalFeatures();
 
+    static const Vector<RefPtr<API::Object>>& internalDebugFeatures();
+    bool isFeatureEnabled(const API::InternalDebugFeature&) const;
+    void setFeatureEnabled(const API::InternalDebugFeature&, bool);
+
     // Exposed for WebKitTestRunner use only.
     void forceUpdate() { update(); }
 
@@ -79,6 +85,7 @@
 
     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);

Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.cpp (235920 => 235921)


--- trunk/Source/WebKit/UIProcess/WebProcessPool.cpp	2018-09-11 23:19:02 UTC (rev 235920)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.cpp	2018-09-11 23:23:38 UTC (rev 235921)
@@ -1159,7 +1159,7 @@
     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);
     }

Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (235920 => 235921)


--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2018-09-11 23:19:02 UTC (rev 235920)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2018-09-11 23:23:38 UTC (rev 235921)
@@ -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 */,

Modified: trunk/Tools/ChangeLog (235920 => 235921)


--- trunk/Tools/ChangeLog	2018-09-11 23:19:02 UTC (rev 235920)
+++ trunk/Tools/ChangeLog	2018-09-11 23:23:38 UTC (rev 235921)
@@ -1,3 +1,21 @@
+2018-09-07  Dean Jackson  <[email protected]>
+
+        Add and expose Internal features from WebKit
+        https://bugs.webkit.org/show_bug.cgi?id=189442
+        <rdar://problem/44243404>
+
+        Reviewed by Simon Fraser.
+
+        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:]):
+
 2018-09-11  Wenson Hsieh  <[email protected]>
 
         [macOS] [WK2] Support changing foreground colors via color panel

Modified: trunk/Tools/MiniBrowser/mac/AppDelegate.m (235920 => 235921)


--- trunk/Tools/MiniBrowser/mac/AppDelegate.m	2018-09-11 23:19:02 UTC (rev 235920)
+++ trunk/Tools/MiniBrowser/mac/AppDelegate.m	2018-09-11 23:23:38 UTC (rev 235921)
@@ -40,6 +40,7 @@
 
 #if WK_API_ENABLED
 #import <WebKit/_WKExperimentalFeature.h>
+#import <WebKit/_WKInternalDebugFeature.h>
 #endif
 
 enum {
@@ -106,11 +107,17 @@
         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
     }
 

Modified: trunk/Tools/MiniBrowser/mac/SettingsController.m (235920 => 235921)


--- trunk/Tools/MiniBrowser/mac/SettingsController.m	2018-09-11 23:19:02 UTC (rev 235920)
+++ trunk/Tools/MiniBrowser/mac/SettingsController.m	2018-09-11 23:23:38 UTC (rev 235921)
@@ -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 @@
     WheelEventHandlerRegionOverlayTag,
 #if WK_API_ENABLED
     ExperimentalFeatureTag,
+    InternalDebugFeatureTag,
 #endif
 };
 
@@ -212,9 +214,9 @@
     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 @@
     [_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,8 +323,12 @@
 #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
 
     return YES;
@@ -654,11 +680,22 @@
     _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];
+}
 #endif
 
 - (BOOL)debugOverlayVisible:(NSMenuItem *)menuItem
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to