Diff
Modified: trunk/Source/WebCore/ChangeLog (217934 => 217935)
--- trunk/Source/WebCore/ChangeLog 2017-06-08 17:26:27 UTC (rev 217934)
+++ trunk/Source/WebCore/ChangeLog 2017-06-08 17:51:47 UTC (rev 217935)
@@ -1,5 +1,20 @@
2017-06-08 Jer Noble <[email protected]>
+ Clients of the WK2 C-API don't have their mediaContentTypesRequiringHardwareSupport setting initialized correctly.
+ https://bugs.webkit.org/show_bug.cgi?id=173091
+
+ Reviewed by Eric Carlson.
+
+ Add a new default setting value, defined separately in Settings and SettingsCocoa.
+
+ * page/Settings.cpp:
+ (WebCore::Settings::defaultMediaContentTypesRequiringHardwareSupport):
+ * page/Settings.h:
+ * page/cocoa/SettingsCocoa.mm:
+ (WebCore::Settings::defaultMediaContentTypesRequiringHardwareSupport):
+
+2017-06-08 Jer Noble <[email protected]>
+
Take the mediaContentTypesRequiringHardwareSupport Setting into account when answering HTMLMediaElement::canPlayType()
https://bugs.webkit.org/show_bug.cgi?id=173092
Modified: trunk/Source/WebCore/page/Settings.cpp (217934 => 217935)
--- trunk/Source/WebCore/page/Settings.cpp 2017-06-08 17:26:27 UTC (rev 217934)
+++ trunk/Source/WebCore/page/Settings.cpp 2017-06-08 17:51:47 UTC (rev 217935)
@@ -789,6 +789,13 @@
return gAllowsAnySSLCertificate;
}
+#if !PLATFORM(COCOA)
+const String& Settings::defaultMediaContentTypesRequiringHardwareSupport()
+{
+ return emptyString();
+}
+#endif
+
void Settings::setMediaContentTypesRequiringHardwareSupport(const String& contentTypes)
{
m_mediaContentTypesRequiringHardwareSupport = contentTypes.split(":").map(ContentType::create);
Modified: trunk/Source/WebCore/page/Settings.h (217934 => 217935)
--- trunk/Source/WebCore/page/Settings.h 2017-06-08 17:26:27 UTC (rev 217934)
+++ trunk/Source/WebCore/page/Settings.h 2017-06-08 17:51:47 UTC (rev 217935)
@@ -326,6 +326,7 @@
WEBCORE_EXPORT static void setAllowsAnySSLCertificate(bool);
static bool allowsAnySSLCertificate();
+ WEBCORE_EXPORT static const String& defaultMediaContentTypesRequiringHardwareSupport();
WEBCORE_EXPORT void setMediaContentTypesRequiringHardwareSupport(const Vector<ContentType>&);
WEBCORE_EXPORT void setMediaContentTypesRequiringHardwareSupport(const String&);
const Vector<ContentType>& mediaContentTypesRequiringHardwareSupport() const { return m_mediaContentTypesRequiringHardwareSupport; }
Modified: trunk/Source/WebCore/page/cocoa/SettingsCocoa.mm (217934 => 217935)
--- trunk/Source/WebCore/page/cocoa/SettingsCocoa.mm 2017-06-08 17:26:27 UTC (rev 217934)
+++ trunk/Source/WebCore/page/cocoa/SettingsCocoa.mm 2017-06-08 17:51:47 UTC (rev 217935)
@@ -26,6 +26,8 @@
#include "config.h"
#include "Settings.h"
+#include <wtf/NeverDestroyed.h>
+
#if PLATFORM(IOS)
#include "Device.h"
#include "SoftLinking.h"
@@ -133,4 +135,10 @@
#endif
+const String& Settings::defaultMediaContentTypesRequiringHardwareSupport()
+{
+ static NeverDestroyed<String> defaultMediaContentTypes { "video/mp4;codecs=hvc1:video/mp4;codecs=hev1" };
+ return defaultMediaContentTypes;
+}
+
} // namespace WebCore
Modified: trunk/Source/WebKit/mac/ChangeLog (217934 => 217935)
--- trunk/Source/WebKit/mac/ChangeLog 2017-06-08 17:26:27 UTC (rev 217934)
+++ trunk/Source/WebKit/mac/ChangeLog 2017-06-08 17:51:47 UTC (rev 217935)
@@ -1,3 +1,13 @@
+2017-06-08 Jer Noble <[email protected]>
+
+ Clients of the WK2 C-API don't have their mediaContentTypesRequiringHardwareSupport setting initialized correctly.
+ https://bugs.webkit.org/show_bug.cgi?id=173091
+
+ Reviewed by Eric Carlson.
+
+ * WebView/WebPreferences.mm:
+ (+[WebPreferences initialize]):
+
2017-06-07 Jer Noble <[email protected]>
Clean-up: RenderElement.h includes headers it doesn't use
Modified: trunk/Source/WebKit/mac/WebView/WebPreferences.mm (217934 => 217935)
--- trunk/Source/WebKit/mac/WebView/WebPreferences.mm 2017-06-08 17:26:27 UTC (rev 217934)
+++ trunk/Source/WebKit/mac/WebView/WebPreferences.mm 2017-06-08 17:51:47 UTC (rev 217935)
@@ -671,7 +671,7 @@
@NO, WebKitResourceTimingEnabledPreferenceKey,
@NO, WebKitCredentialManagementEnabledPreferenceKey,
@NO, WebKitMediaUserGestureInheritsFromDocument,
- @"video/mp4;codecs=hvc1:video/mp4;codecs=hev1", WebKitMediaContentTypesRequiringHardwareSupportPreferenceKey,
+ (NSString *)Settings::defaultMediaContentTypesRequiringHardwareSupport(), WebKitMediaContentTypesRequiringHardwareSupportPreferenceKey,
nil];
#if !PLATFORM(IOS)
Modified: trunk/Source/WebKit2/ChangeLog (217934 => 217935)
--- trunk/Source/WebKit2/ChangeLog 2017-06-08 17:26:27 UTC (rev 217934)
+++ trunk/Source/WebKit2/ChangeLog 2017-06-08 17:51:47 UTC (rev 217935)
@@ -1,5 +1,21 @@
2017-06-08 Jer Noble <[email protected]>
+ Clients of the WK2 C-API don't have their mediaContentTypesRequiringHardwareSupport setting initialized correctly.
+ https://bugs.webkit.org/show_bug.cgi?id=173091
+
+ Reviewed by Eric Carlson.
+
+ Rather than add yet a third way of setting this preference, centralize everything by moving the
+ definition of the default value into WebCore.
+
+ * Shared/WebPreferencesDefinitions.h:
+ * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
+ (-[WKWebViewConfiguration init]):
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::updatePreferences):
+
+2017-06-08 Jer Noble <[email protected]>
+
[WK2] mediaContentTypesRequiringHardwareSupport setting not being propogated
https://bugs.webkit.org/show_bug.cgi?id=173090
Modified: trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h (217934 => 217935)
--- trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h 2017-06-08 17:26:27 UTC (rev 217934)
+++ trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h 2017-06-08 17:51:47 UTC (rev 217935)
@@ -403,7 +403,7 @@
FOR_EACH_WEBKIT_FONT_FAMILY_PREFERENCE(macro) \
macro(DefaultTextEncodingName, defaultTextEncodingName, String, String, defaultTextEncodingNameForSystemLanguage(), "", "") \
macro(FTPDirectoryTemplatePath, ftpDirectoryTemplatePath, String, String, "", "", "") \
- macro(MediaContentTypesRequiringHardwareSupport, mediaContentTypesRequiringHardwareSupport, String, String, "", "", "") \
+ macro(MediaContentTypesRequiringHardwareSupport, mediaContentTypesRequiringHardwareSupport, String, String, WebCore::Settings::defaultMediaContentTypesRequiringHardwareSupport(), "", "") \
\
#define FOR_EACH_WEBKIT_STRING_PREFERENCE_NOT_IN_WEBCORE(macro) \
Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm (217934 => 217935)
--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm 2017-06-08 17:26:27 UTC (rev 217934)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm 2017-06-08 17:51:47 UTC (rev 217935)
@@ -40,6 +40,7 @@
#import "_WKVisitedLinkStore.h"
#import "_WKWebsiteDataStoreInternal.h"
#import <WebCore/RuntimeApplicationChecks.h>
+#import <WebCore/Settings.h>
#import <WebCore/URLParser.h>
#import <wtf/RetainPtr.h>
@@ -200,7 +201,7 @@
_allowsBlockSelection = [[NSUserDefaults standardUserDefaults] boolForKey:@"WebKitDebugAllowBlockSelection"];
#endif
- _mediaContentTypesRequiringHardwareSupport = @"video/mp4;codecs=hvc1:video/mp4;codecs=hev1";
+ _mediaContentTypesRequiringHardwareSupport = Settings::defaultMediaContentTypesRequiringHardwareSupport();
return self;
}
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (217934 => 217935)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2017-06-08 17:26:27 UTC (rev 217934)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2017-06-08 17:51:47 UTC (rev 217935)
@@ -3388,6 +3388,7 @@
settings.setLargeImageAsyncDecodingEnabled(store.getBoolValueForKey(WebPreferencesKey::largeImageAsyncDecodingEnabledKey()));
settings.setAnimatedImageAsyncDecodingEnabled(store.getBoolValueForKey(WebPreferencesKey::animatedImageAsyncDecodingEnabledKey()));
settings.setShouldSuppressKeyboardInputDuringProvisionalNavigation(store.getBoolValueForKey(WebPreferencesKey::shouldSuppressKeyboardInputDuringProvisionalNavigationKey()));
+ settings.setMediaContentTypesRequiringHardwareSupport(store.getStringValueForKey(WebPreferencesKey::mediaContentTypesRequiringHardwareSupportKey()));
}
#if ENABLE(DATA_DETECTION)