Adding a new runtime flag for modern media controls.
authorgraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Sep 2016 09:32:09 +0000 (09:32 +0000)
committergraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Sep 2016 09:32:09 +0000 (09:32 +0000)
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@206296 268f45cc-cd09-0410-ab3c-d52691b4dbfc

26 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/CommonIdentifiers.h
Source/WebCore/ChangeLog
Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
Source/WebKit/mac/WebView/WebPreferences.mm
Source/WebKit/mac/WebView/WebPreferencesPrivate.h
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit/win/ChangeLog
Source/WebKit/win/Interfaces/IWebPreferencesPrivate.idl
Source/WebKit/win/WebPreferenceKeysPrivate.h
Source/WebKit/win/WebPreferences.cpp
Source/WebKit/win/WebPreferences.h
Source/WebKit/win/WebView.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebPreferencesDefinitions.h
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Tools/ChangeLog
Tools/DumpRenderTree/mac/DumpRenderTree.mm
Tools/DumpRenderTree/win/DumpRenderTree.cpp
Tools/Scripts/webkitperl/FeatureList.pm
Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
Tools/WebKitTestRunner/InjectedBundle/TestRunner.h

index f6468f1..0e6f6d1 100644 (file)
@@ -1,3 +1,13 @@
+2016-09-23  Antoine Quint  <graouts@apple.com>
+
+        Add a new runtime flag for work on modern media controls (off by default)
+        https://bugs.webkit.org/show_bug.cgi?id=162420
+        <rdar://problem/27989489>
+
+        Reviewed by Eric Carlson.
+
+        * runtime/CommonIdentifiers.h:
+
 2016-09-23  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         REGRESSION(r194387): Crash on github.com in IntlDateTimeFormat::resolvedOptions in C locale
index 4051262..5687117 100644 (file)
@@ -70,6 +70,7 @@
     macro(Map)\
     macro(MapIterator)\
     macro(Math) \
+    macro(ModernMediaControls) \
     macro(NaN) \
     macro(Number) \
     macro(NumberFormat) \
index 328c9b0..f25d3ed 100644 (file)
@@ -1,3 +1,15 @@
+2016-09-23  Antoine Quint  <graouts@apple.com>
+
+        Add a new runtime flag for work on modern media controls (off by default)
+        https://bugs.webkit.org/show_bug.cgi?id=162420
+        <rdar://problem/27989489>
+
+        Reviewed by Eric Carlson.
+
+        * bindings/generic/RuntimeEnabledFeatures.h:
+        (WebCore::RuntimeEnabledFeatures::setModernMediaControlsEnabled):
+        (WebCore::RuntimeEnabledFeatures::modernMediaControlsEnabled):
+
 2016-09-22  Chris Dumez  <cdumez@apple.com>
 
         [ShadowDOM] Add support for Node.getRootNode(options)
index bd99d24..566e130 100644 (file)
@@ -223,6 +223,9 @@ public:
     bool isCSSGridLayoutEnabled() const { return m_cssGridLayoutEnabled; }
 #endif
 
+    void setModernMediaControlsEnabled(bool areEnabled) { m_areModernMediaControlsEnabled = areEnabled; }
+    bool modernMediaControlsEnabled() const { return m_areModernMediaControlsEnabled; }
+
     WEBCORE_EXPORT static RuntimeEnabledFeatures& sharedFeatures();
 
     WEBCORE_EXPORT void reset();
@@ -231,6 +234,7 @@ private:
     // Never instantiate.
     RuntimeEnabledFeatures();
 
+    bool m_areModernMediaControlsEnabled;
     bool m_isLocalStorageEnabled;
     bool m_isSessionStorageEnabled;
     bool m_isWebkitNotificationsEnabled;
index 02028aa..6ed298a 100644 (file)
@@ -1,3 +1,19 @@
+2016-09-23  Antoine Quint  <graouts@apple.com>
+
+        Add a new runtime flag for work on modern media controls (off by default)
+        https://bugs.webkit.org/show_bug.cgi?id=162420
+        <rdar://problem/27989489>
+
+        Reviewed by Eric Carlson.
+
+        * WebView/WebPreferenceKeysPrivate.h:
+        * WebView/WebPreferences.mm:
+        (-[WebPreferences modernMediaControlsEnabled]):
+        (-[WebPreferences setModernMediaControlsEnabled:]):
+        * WebView/WebPreferencesPrivate.h:
+        * WebView/WebView.mm:
+        (-[WebView _preferencesChanged:]):
+
 2016-09-21  Anders Carlsson  <andersca@apple.com>
 
         Support openPaymentSetup API on ApplePaySession object
index 2bfbf0e..b9f557d 100644 (file)
 #define WebKitDownloadAttributeEnabledPreferenceKey @"WebKitDownloadAttributeEnabled"
 #define WebKitCSSGridLayoutEnabledPreferenceKey @"WebKitCSSGridLayoutEnabled"
 #define WebKitVisualViewportEnabledPreferenceKey @"WebKitVisualViewportEnabled"
+#define WebKitModernMediaControlsEnabledPreferenceKey @"WebKitModernMediaControlsEnabled"
 
 #if !TARGET_OS_IPHONE
 // These are private both because callers should be using the cover methods and because the
index 4575ecc..62fb7ea 100644 (file)
@@ -2786,6 +2786,16 @@ static NSString *classIBCreatorID = nil;
     [self _setBoolValue:flag forKey:WebKitWebAnimationsEnabledPreferenceKey];
 }
 
+- (BOOL)modernMediaControlsEnabled
+{
+    return [self _boolValueForKey:WebKitModernMediaControlsEnabledPreferenceKey];
+}
+
+- (void)setModernMediaControlsEnabled:(BOOL)flag
+{
+    [self _setBoolValue:flag forKey:WebKitModernMediaControlsEnabledPreferenceKey];
+}
+
 @end
 
 @implementation WebPreferences (WebInternal)
index b82e12f..1e83056 100644 (file)
@@ -496,6 +496,9 @@ extern NSString *WebPreferencesCacheModelChangedInternalNotification;
 - (void)setWebAnimationsEnabled:(BOOL)flag;
 - (BOOL)webAnimationsEnabled;
 
+- (void)setModernMediaControlsEnabled:(BOOL)flag;
+- (BOOL)modernMediaControlsEnabled;
+
 @property (nonatomic) BOOL visualViewportEnabled;
 @property (nonatomic) BOOL javaScriptMarkupEnabled;
 @property (nonatomic) BOOL mediaDataLoadsAutomatically;
index 4b2ab68..ae83409 100644 (file)
@@ -2525,6 +2525,8 @@ static bool needsSelfRetainWhileLoadingQuirk()
 
     RuntimeEnabledFeatures::sharedFeatures().setDOMIteratorEnabled([preferences DOMIteratorEnabled]);
 
+    RuntimeEnabledFeatures::sharedFeatures().setModernMediaControlsEnabled([preferences modernMediaControlsEnabled]);
+
 #if ENABLE(CUSTOM_ELEMENTS)
     RuntimeEnabledFeatures::sharedFeatures().setCustomElementsEnabled([preferences customElementsEnabled]);
 #endif
index cbd07be..8dfb61b 100644 (file)
@@ -1,3 +1,21 @@
+2016-09-23  Antoine Quint  <graouts@apple.com>
+
+        Add a new runtime flag for work on modern media controls (off by default)
+        https://bugs.webkit.org/show_bug.cgi?id=162420
+        <rdar://problem/27989489>
+
+        Reviewed by Eric Carlson.
+
+        * Interfaces/IWebPreferencesPrivate.idl:
+        * WebPreferenceKeysPrivate.h:
+        * WebPreferences.cpp:
+        (WebPreferences::setModernMediaControlsEnabled):
+        (WebPreferences::modernMediaControlsEnabled):
+        (WebPreferences::setCustomElementsEnabled): Deleted.
+        * WebPreferences.h:
+        * WebView.cpp:
+        (WebView::notifyPreferencesChanged):
+
 2016-09-15  Brady Eidson  <beidson@apple.com>
 
         WKWebView.hasOnlySecureContent always returns "YES" after going back to a CachedPage (even if it has http resources).
index d7aa49d..e40d9b9 100644 (file)
@@ -183,5 +183,7 @@ interface IWebPreferencesPrivate3 : IWebPreferencesPrivate2
     HRESULT setShadowDOMEnabled([in] BOOL enabled);
     HRESULT customElementsEnabled([out, retval] BOOL* enabled);
     HRESULT setCustomElementsEnabled([in] BOOL enabled);
+    HRESULT modernMediaControlsEnabled([out, retval] BOOL* enabled);
+    HRESULT setModernMediaControlsEnabled([in] BOOL enabled);
 }
 
index 5e13774..b6e96eb 100644 (file)
 #define WebKitShadowDOMEnabledPreferenceKey "WebKitShadowDOMEnabled"
 
 #define WebKitCustomElementsEnabledPreferenceKey "WebKitCustomElementsEnabled"
+
+#define WebKitModernMediaControlsEnabledPreferenceKey "WebKitModernMediaControlsEnabled"
index 175b7c7..d21df75 100644 (file)
@@ -1979,3 +1979,17 @@ HRESULT WebPreferences::setCustomElementsEnabled(BOOL enabled)
     setBoolValue(WebKitCustomElementsEnabledPreferenceKey, enabled);
     return S_OK;
 }
+
+HRESULT WebPreferences::setModernMediaControlsEnabled(BOOL enabled)
+{
+    setBoolValue(WebKitModernMediaControlsEnabledPreferenceKey, enabled);
+    return S_OK;
+}
+
+HRESULT WebPreferences::modernMediaControlsEnabled(_Out_ BOOL* enabled)
+{
+    if (!enabled)
+        return E_POINTER;
+    *enabled = boolValueForKey(WebKitModernMediaControlsEnabledPreferenceKey);
+    return S_OK;
+}
index 70599de..9fa915a 100644 (file)
@@ -241,6 +241,8 @@ public:
     virtual HRESULT STDMETHODCALLTYPE setShadowDOMEnabled(BOOL);
     virtual HRESULT STDMETHODCALLTYPE customElementsEnabled(_Out_ BOOL*);
     virtual HRESULT STDMETHODCALLTYPE setCustomElementsEnabled(BOOL);
+    virtual HRESULT STDMETHODCALLTYPE modernMediaControlsEnabled(_Out_ BOOL*);
+    virtual HRESULT STDMETHODCALLTYPE setModernMediaControlsEnabled(BOOL);
 
     // WebPreferences
 
index 980edeb..e2acfcb 100644 (file)
@@ -5082,6 +5082,11 @@ HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification)
     RuntimeEnabledFeatures::sharedFeatures().setCustomElementsEnabled(!!enabled);
 #endif
 
+    hr = prefsPrivate->modernMediaControlsEnabled(&enabled);
+    if (FAILED(hr))
+        return hr;
+    RuntimeEnabledFeatures::sharedFeatures().setModernMediaControlsEnabled(!!enabled);
+
     hr = preferences->privateBrowsingEnabled(&enabled);
     if (FAILED(hr))
         return hr;
index 57ac9df..113eb35 100644 (file)
@@ -1,3 +1,17 @@
+2016-09-23  Antoine Quint  <graouts@apple.com>
+
+        Add a new runtime flag for work on modern media controls (off by default)
+        https://bugs.webkit.org/show_bug.cgi?id=162420
+        <rdar://problem/27989489>
+
+        Reviewed by Eric Carlson.
+
+        * Shared/WebPreferencesDefinitions.h:
+        * WebProcess/InjectedBundle/InjectedBundle.cpp:
+        (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::updatePreferences):
+
 2016-09-23  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         REGRESSION(r194387): Crash on github.com in IntlDateTimeFormat::resolvedOptions in C locale
index b3a9734..23f33de 100644 (file)
     macro(CSSGridLayoutEnabled, cssGridLayoutEnabled, Bool, bool, true, "CSS Grid", "CSS Grid Layout Module support") \
     macro(CustomElementsEnabled, customElementsEnabled, Bool, bool, true, "Custom Elements", "HTML Custom Elements prototype") \
     macro(GamepadsEnabled, gamepadsEnabled, Bool, bool, false, "Gamepads", "Web Gamepad API support") \
+    macro(ModernMediaControlsEnabled, modernMediaControlsEnabled, Bool, bool, false, "Modern Media Controls", "Use modern media controls look") \
     macro(SpringTimingFunctionEnabled, springTimingFunctionEnabled, Bool, bool, true, "CSS Spring Animations", "CSS Spring Animation prototype") \
     macro(WebGL2Enabled, webGL2Enabled, Bool, bool, true, "WebGL 2.0", "WebGL 2 prototype") \
     macro(VisualViewportEnabled, visualViewportEnabled, Bool, bool, false, "Visual Viewport", "Use Visual Viewport for fixed elements when zooming") \
index d03c59f..b10a871 100644 (file)
@@ -212,6 +212,9 @@ void InjectedBundle::overrideBoolPreferenceForTestRunner(WebPageGroupProxy* page
         RuntimeEnabledFeatures::sharedFeatures().setWebGL2Enabled(enabled);
 #endif
 
+    if (preference == "WebKitModernMediaControlsEnabled")
+        RuntimeEnabledFeatures::sharedFeatures().setModernMediaControlsEnabled(enabled);
+
     // Map the names used in LayoutTests with the names used in WebCore::Settings and WebPreferencesStore.
 #define FOR_EACH_OVERRIDE_BOOL_PREFERENCE(macro) \
     macro(WebKitAcceleratedCompositingEnabled, AcceleratedCompositingEnabled, acceleratedCompositingEnabled) \
index acbe5b4..e1cb62c 100644 (file)
@@ -3224,6 +3224,8 @@ void WebPage::updatePreferences(const WebPreferencesStore& store)
 
     settings.setVisualViewportEnabled(store.getBoolValueForKey(WebPreferencesKey::visualViewportEnabledKey()));
 
+    RuntimeEnabledFeatures::sharedFeatures().setModernMediaControlsEnabled(store.getBoolValueForKey(WebPreferencesKey::modernMediaControlsEnabledKey()));
+
     bool processSuppressionEnabled = store.getBoolValueForKey(WebPreferencesKey::pageVisibilityBasedProcessSuppressionEnabledKey());
     if (m_processSuppressionEnabled != processSuppressionEnabled) {
         m_processSuppressionEnabled = processSuppressionEnabled;
index 31be77a..dfcc0a4 100644 (file)
@@ -1,3 +1,22 @@
+2016-09-23  Antoine Quint  <graouts@apple.com>
+
+        Add a new runtime flag for work on modern media controls (off by default)
+        https://bugs.webkit.org/show_bug.cgi?id=162420
+        <rdar://problem/27989489>
+
+        Reviewed by Eric Carlson.
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (resetWebPreferencesToConsistentValues):
+        * DumpRenderTree/win/DumpRenderTree.cpp:
+        (resetWebPreferencesToConsistentValues):
+        * Scripts/webkitperl/FeatureList.pm:
+        * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+        (WTR::InjectedBundle::beginTesting):
+        * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
+        (WTR::TestRunner::setModernMediaControlsEnabled):
+        * WebKitTestRunner/InjectedBundle/TestRunner.h:
+
 2016-09-23  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         REGRESSION(r194387): Crash on github.com in IntlDateTimeFormat::resolvedOptions in C locale
index 5def99d..e2d8a87 100644 (file)
@@ -989,6 +989,8 @@ static void resetWebPreferencesToConsistentValues()
 
     [preferences setDownloadAttributeEnabled:YES];
 
+    [preferences setModernMediaControlsEnabled:NO];
+
     [preferences setHiddenPageDOMTimerThrottlingEnabled:NO];
     [preferences setHiddenPageCSSAnimationSuspensionEnabled:NO];
 
index f3bcd5f..bdddbb4 100644 (file)
@@ -854,6 +854,7 @@ static void resetWebPreferencesToConsistentValues(IWebPreferences* preferences)
     prefsPrivate3->setCustomElementsEnabled(TRUE);
 
     prefsPrivate3->setDOMIteratorEnabled(TRUE);
+    prefsPrivate3->setModernMediaControlsEnabled(FALSE);
 
     setAlwaysAcceptCookies(false);
 }
index 69dce76..b4f9765 100644 (file)
@@ -113,6 +113,7 @@ my (
     $mediaStreamSupport,
     $meterElementSupport,
     $mhtmlSupport,
+    $modernMediaControls,
     $modulesSupport,
     $mouseCursorScaleSupport,
     $netscapePluginAPISupport,
index 972d1e6..6552545 100644 (file)
@@ -319,6 +319,8 @@ void InjectedBundle::beginTesting(WKDictionaryRef settings)
 
     m_testRunner->setWebGL2Enabled(true);
 
+    m_testRunner->setModernMediaControlsEnabled(false);
+
     m_testRunner->setFetchAPIEnabled(true);
 
     m_testRunner->setDownloadAttributeEnabled(true);
index 977b833..74d325a 100644 (file)
@@ -361,6 +361,13 @@ void TestRunner::setDOMIteratorEnabled(bool enabled)
     WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled);
 }
 
+void TestRunner::setModernMediaControlsEnabled(bool enabled)
+{
+    WKRetainPtr<WKStringRef> key(AdoptWK, WKStringCreateWithUTF8CString("WebKitModernMediaControlsEnabled"));
+    auto& injectedBundle = InjectedBundle::singleton();
+    WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled);
+}
+
 void TestRunner::setWebGL2Enabled(bool enabled)
 {
     WKRetainPtr<WKStringRef> key(AdoptWK, WKStringCreateWithUTF8CString("WebKitWebGL2Enabled"));
index e83087f..e7564ad 100644 (file)
@@ -103,6 +103,7 @@ public:
     void setShadowDOMEnabled(bool);
     void setCustomElementsEnabled(bool);
     void setDOMIteratorEnabled(bool);
+    void setModernMediaControlsEnabled(bool);
     void setWebGL2Enabled(bool);
     void setFetchAPIEnabled(bool);
     void setAllowUniversalAccessFromFileURLs(bool);