https://bugs.webkit.org/show_bug.cgi?id=173091
Reviewed by Eric Carlson.
Source/WebCore:
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):
Source/WebKit/mac:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
Source/WebKit2:
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):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217935
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
2017-06-08 Jer Noble <jer.noble@apple.com>
+ 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 <jer.noble@apple.com>
+
Take the mediaContentTypesRequiringHardwareSupport Setting into account when answering HTMLMediaElement::canPlayType()
https://bugs.webkit.org/show_bug.cgi?id=173092
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);
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; }
#include "config.h"
#include "Settings.h"
+#include <wtf/NeverDestroyed.h>
+
#if PLATFORM(IOS)
#include "Device.h"
#include "SoftLinking.h"
#endif
+const String& Settings::defaultMediaContentTypesRequiringHardwareSupport()
+{
+ static NeverDestroyed<String> defaultMediaContentTypes { "video/mp4;codecs=hvc1:video/mp4;codecs=hev1" };
+ return defaultMediaContentTypes;
+}
+
} // namespace WebCore
+2017-06-08 Jer Noble <jer.noble@apple.com>
+
+ 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 <jer.noble@apple.com>
Clean-up: RenderElement.h includes headers it doesn't use
@NO, WebKitResourceTimingEnabledPreferenceKey,
@NO, WebKitCredentialManagementEnabledPreferenceKey,
@NO, WebKitMediaUserGestureInheritsFromDocument,
- @"video/mp4;codecs=hvc1:video/mp4;codecs=hev1", WebKitMediaContentTypesRequiringHardwareSupportPreferenceKey,
+ (NSString *)Settings::defaultMediaContentTypesRequiringHardwareSupport(), WebKitMediaContentTypesRequiringHardwareSupportPreferenceKey,
nil];
#if !PLATFORM(IOS)
2017-06-08 Jer Noble <jer.noble@apple.com>
+ 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 <jer.noble@apple.com>
+
[WK2] mediaContentTypesRequiringHardwareSupport setting not being propogated
https://bugs.webkit.org/show_bug.cgi?id=173090
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) \
#import "_WKVisitedLinkStore.h"
#import "_WKWebsiteDataStoreInternal.h"
#import <WebCore/RuntimeApplicationChecks.h>
+#import <WebCore/Settings.h>
#import <WebCore/URLParser.h>
#import <wtf/RetainPtr.h>
_allowsBlockSelection = [[NSUserDefaults standardUserDefaults] boolForKey:@"WebKitDebugAllowBlockSelection"];
#endif
- _mediaContentTypesRequiringHardwareSupport = @"video/mp4;codecs=hvc1:video/mp4;codecs=hev1";
+ _mediaContentTypesRequiringHardwareSupport = Settings::defaultMediaContentTypesRequiringHardwareSupport();
return self;
}
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)