[Resource Timing] Add Experimental Feature Flag
authorjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Feb 2017 06:52:02 +0000 (06:52 +0000)
committerjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Feb 2017 06:52:02 +0000 (06:52 +0000)
https://bugs.webkit.org/show_bug.cgi?id=167147

Reviewed by Ryosuke Niwa.

Source/WebKit2:

* Shared/WebPreferencesDefinitions.h:
Move ResourceTiming to experimental section.
Disable it for El Capitan due to known issues.

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(enableExperimentalFeatures):
(resetWebPreferencesToConsistentValues):
* DumpRenderTree/win/DumpRenderTree.cpp:
(enableExperimentalFeatures):
(resetWebPreferencesToConsistentValues):
Put experimental flags in the experimental section.

Websites/webkit.org:

* experimental-features.html:
Test for Resource Timing.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212945 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebPreferencesDefinitions.h
Tools/ChangeLog
Tools/DumpRenderTree/mac/DumpRenderTree.mm
Tools/DumpRenderTree/win/DumpRenderTree.cpp
Websites/webkit.org/ChangeLog
Websites/webkit.org/experimental-features.html

index 8b052a7..dcb8b46 100644 (file)
@@ -1,5 +1,16 @@
 2017-02-23  Joseph Pecoraro  <pecoraro@apple.com>
 
+        [Resource Timing] Add Experimental Feature Flag
+        https://bugs.webkit.org/show_bug.cgi?id=167147
+
+        Reviewed by Ryosuke Niwa.
+
+        * Shared/WebPreferencesDefinitions.h:
+        Move ResourceTiming to experimental section.
+        Disable it for El Capitan due to known issues.
+
+2017-02-23  Joseph Pecoraro  <pecoraro@apple.com>
+
         [Resource Timing] Gather timing information with reliable responseEnd time
         https://bugs.webkit.org/show_bug.cgi?id=168351
 
index 7b6838c..bef2754 100644 (file)
     macro(InteractiveFormValidationEnabled, interactiveFormValidationEnabled, Bool, bool, DEFAULT_HTML_INTERACTIVE_FORM_VALIDATION_ENABLED, "HTML Interactive Form Validation", "HTML interactive form validation") \
     macro(ShouldSuppressKeyboardInputDuringProvisionalNavigation, shouldSuppressKeyboardInputDuringProvisionalNavigation, Bool, bool, false, "", "") \
     macro(CSSGridLayoutEnabled, cssGridLayoutEnabled, Bool, bool, true, "CSS Grid", "CSS Grid Layout Module support") \
-    macro(ResourceTimingEnabled, resourceTimingEnabled, Bool, bool, false, "Resource Timing", "Enable ResourceTiming API") \
     \
 
 #define FOR_EACH_WEBKIT_DOUBLE_PREFERENCE(macro) \
 #define FOR_EACH_WEBKIT_DEBUG_UINT32_PREFERENCE(macro) \
     macro(VisibleDebugOverlayRegions, visibleDebugOverlayRegions, UInt32, uint32_t, 0, "", "")
 
-// Our XCode build system does not currently have any concept of DEVELOPER_MODE.
+// Our Xcode build system does not currently have any concept of DEVELOPER_MODE.
 // Cocoa ports must disable experimental features on release branches for now.
 #if ENABLE(DEVELOPER_MODE) || PLATFORM(COCOA)
 #define DEFAULT_EXPERIMENTAL_FEATURES_ENABLED true
 #else
 #define DEFAULT_EXPERIMENTAL_FEATURES_ENABLED false
 #endif
+        
+#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200
+// <https://webkit.org/b/168415> El Capitan NetworkLoadTiming values are sometimes jumbled
+#define DEFAULT_RESOURCE_TIMING_ENABLED false
+#else
+#define DEFAULT_RESOURCE_TIMING_ENABLED DEFAULT_EXPERIMENTAL_FEATURES_ENABLED
+#endif
 
 // For experimental features:
 // - The type should be boolean.
 // - You must provide the last two parameters for all experimental features. They
 //   are the text exposed to the user from the WebKit client.
-// - They should be alphabetically ordered by the human readable text.
-// - The default value may be either false (for very unstable features) or
+// - They should be alphabetically ordered by the human readable text (the first string).
+// - The default value may be either false (for unstable features) or
 //   DEFAULT_EXPERIMENTAL_FEATURE_ENABLED (for features that are ready for
 //   wider testing).
 
@@ -314,14 +320,15 @@ bool checkWebRTCAvailability();
 #define FOR_EACH_WEBKIT_EXPERIMENTAL_FEATURE_PREFERENCE(macro) \
     macro(SpringTimingFunctionEnabled, springTimingFunctionEnabled, Bool, bool, DEFAULT_EXPERIMENTAL_FEATURES_ENABLED, "CSS Spring Animations", "CSS Spring Animation prototype") \
     macro(GamepadsEnabled, gamepadsEnabled, Bool, bool, DEFAULT_EXPERIMENTAL_FEATURES_ENABLED, "Gamepads", "Web Gamepad API support") \
+    macro(InputEventsEnabled, inputEventsEnabled, Bool, bool, DEFAULT_EXPERIMENTAL_FEATURES_ENABLED, "Input Events", "Enable InputEvents support") \
     macro(LinkPreloadEnabled, linkPreloadEnabled, Bool, bool, DEFAULT_EXPERIMENTAL_FEATURES_ENABLED, "Link Preload", "Link preload support") \
     macro(ModernMediaControlsEnabled, modernMediaControlsEnabled, Bool, bool, DEFAULT_EXPERIMENTAL_FEATURES_ENABLED, "Modern Media Controls", "Use modern media controls look") \
-    macro(InputEventsEnabled, inputEventsEnabled, Bool, bool, DEFAULT_EXPERIMENTAL_FEATURES_ENABLED, "Input Events", "Enable InputEvents support") \
-    macro(PeerConnectionEnabled, peerConnectionEnabled, Bool, bool, checkWebRTCAvailability(), "WebRTC", "Enable WebRTC API") \
+    macro(ResourceTimingEnabled, resourceTimingEnabled, Bool, bool, DEFAULT_RESOURCE_TIMING_ENABLED, "Resource Timing", "Enable ResourceTiming API") \
     macro(SubtleCryptoEnabled, subtleCryptoEnabled, Bool, bool, DEFAULT_EXPERIMENTAL_FEATURES_ENABLED, "SubtleCrypto", "Enable SubtleCrypto support") \
-    macro(UserTimingEnabled, userTimingEnabled, Bool, bool, false, "User Timing", "Enable UserTiming API") \
+    macro(UserTimingEnabled, userTimingEnabled, Bool, bool, DEFAULT_EXPERIMENTAL_FEATURES_ENABLED, "User Timing", "Enable UserTiming API") \
     macro(WebAnimationsEnabled, webAnimationsEnabled, Bool, bool, false, "Web Animations", "Web Animations prototype") \
     macro(WebGL2Enabled, webGL2Enabled, Bool, bool, DEFAULT_EXPERIMENTAL_FEATURES_ENABLED, "WebGL 2.0", "WebGL 2 prototype") \
+    macro(PeerConnectionEnabled, peerConnectionEnabled, Bool, bool, checkWebRTCAvailability(), "WebRTC", "Enable WebRTC API") \
     \
 
 #if PLATFORM(COCOA)
index 14d714b..193f3c2 100644 (file)
@@ -1,3 +1,18 @@
+2017-02-23  Joseph Pecoraro  <pecoraro@apple.com>
+
+        [Resource Timing] Add Experimental Feature Flag
+        https://bugs.webkit.org/show_bug.cgi?id=167147
+
+        Reviewed by Ryosuke Niwa.
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (enableExperimentalFeatures):
+        (resetWebPreferencesToConsistentValues):
+        * DumpRenderTree/win/DumpRenderTree.cpp:
+        (enableExperimentalFeatures):
+        (resetWebPreferencesToConsistentValues):
+        Put experimental flags in the experimental section.
+
 2017-02-23  Beth Dakin  <bdakin@apple.com> + Dan Saunders  <dasau@microsoft.com>
 
         No reliable way to get a snapshot of WKWebView (macOS)
index a434b36..ad504b6 100644 (file)
@@ -842,10 +842,12 @@ static void enableExperimentalFeatures(WebPreferences* preferences)
     [preferences setLinkPreloadEnabled:YES];
     [preferences setModernMediaControlsEnabled:YES];
     // FIXME: InputEvents
+    [preferences setResourceTimingEnabled:YES];
     [preferences setSubtleCryptoEnabled:YES];
     [preferences setUserTimingEnabled:YES];
     [preferences setWebAnimationsEnabled:YES];
     [preferences setWebGL2Enabled:YES];
+    [preferences setPeerConnectionEnabled:YES];
 }
 
 // Called before each test.
@@ -951,9 +953,6 @@ static void resetWebPreferencesToConsistentValues()
     [preferences setHiddenPageCSSAnimationSuspensionEnabled:NO];
     
     [preferences setMediaStreamEnabled:YES];
-    [preferences setPeerConnectionEnabled:YES];
-
-    [preferences setResourceTimingEnabled:YES];
 
     [WebPreferences _clearNetworkLoaderSession];
     [WebPreferences _setCurrentNetworkLoaderSessionCookieAcceptPolicy:NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain];
index a7dff05..c4470c0 100644 (file)
@@ -774,12 +774,15 @@ static void enableExperimentalFeatures(IWebPreferences* preferences)
     // FIXME: CSSGridLayout
     // FIXME: SpringTimingFunction
     // FIXME: Gamepads
+    prefsPrivate4->setLinkPreloadEnabled(TRUE);
     // FIXME: ModernMediaControls
     // FIXME: InputEvents
+    prefsPrivate4->setResourceTimingEnabled(TRUE);
     // FIXME: SubtleCrypto
     prefsPrivate4->setUserTimingEnabled(TRUE);
     prefsPrivate4->setWebAnimationsEnabled(TRUE);
     // FIXME: WebGL2
+    // FIXME: WebRTC
 }
 
 static void resetWebPreferencesToConsistentValues(IWebPreferences* preferences)
@@ -878,8 +881,6 @@ static void resetWebPreferencesToConsistentValues(IWebPreferences* preferences)
     prefsPrivate4->setShadowDOMEnabled(TRUE);
     prefsPrivate4->setCustomElementsEnabled(TRUE);
     prefsPrivate4->setModernMediaControlsEnabled(FALSE);
-    prefsPrivate4->setResourceTimingEnabled(TRUE);
-    prefsPrivate4->setLinkPreloadEnabled(TRUE);
 
     setAlwaysAcceptCookies(false);
 }
index 3c39307..75fe6f9 100644 (file)
@@ -1,3 +1,13 @@
+2017-02-23  Joseph Pecoraro  <pecoraro@apple.com>
+
+        [Resource Timing] Add Experimental Feature Flag
+        https://bugs.webkit.org/show_bug.cgi?id=167147
+
+        Reviewed by Ryosuke Niwa.
+
+        * experimental-features.html:
+        Test for Resource Timing.
+
 2017-02-23  Alex Christensen  <achristensen@webkit.org>
 
         Add WebRTC to experimental-features.html
index 06c9795..737b15e 100644 (file)
@@ -73,11 +73,6 @@ function testCSSGrid() {
     return CSS.supports("display", "grid");
 }
 
-function testWebGL2() {
-    let canvas = document.createElement("canvas");
-    return canvas.getContext("webgl2");
-}
-
 function testLinkPreload() {
     var link = document.createElement("link");
     return link.relList.supports("preload");
@@ -87,10 +82,6 @@ function testGamepad() {
     return navigator.getGamepads;
 }
 
-function testWebRTC() {
-    return window.RTCPeerConnection;
-}
-
 function testSpringAnimation() {
     return CSS.supports("transition-timing-function", "spring(1 100 10 0)");
 }
@@ -111,18 +102,31 @@ function testES6Modules() {
     return window.es6modules;
 }
 
+function testResourceTiming() {
+    return !!window.PerformanceResourceTiming;
+}
+
 function testSubtleCrypto() {
     return window.crypto.subtle;
 }
 
 function testUserTiming() {
-    return window.performance.mark;
+    return !!window.PerformanceMark;
 }
 
 function testWebAnimations() {
     return !!window.Animation;
 }
 
+function testWebGL2() {
+    let canvas = document.createElement("canvas");
+    return canvas.getContext("webgl2");
+}
+
+function testWebRTC() {
+    return window.RTCPeerConnection;
+}
+
 window.addEventListener("load", function () {
     Array.from(document.querySelectorAll(".test")).forEach(element => {
         var enabled = false;
@@ -150,6 +154,7 @@ window.addEventListener("load", function () {
         <div class="test" id="FormValidation"><p>HTML Form Validation</p></div>
         <div class="test" id="InputEvents"><p>HTML Input Events</p></div>
         <div class="test" id="LinkPreload"><p>Link Preload</p></div>
+        <div class="test" id="ResourceTiming"><p>Resource Timing</p></div>
         <div class="test" id="SubtleCrypto"><p>SubtleCrypto</p></div>
         <div class="test" id="VariationFonts"><p>Variation Fonts</p></div>
         <div class="test" id="UserTiming"><p>User Timing</p></div>