Add initial DOM support for Media Capabilities
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Dec 2017 18:28:21 +0000 (18:28 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Dec 2017 18:28:21 +0000 (18:28 +0000)
commit444372edd5f815edd1f765a540c2a04743ff0c39
tree6813f9e3b74a60112aa185eaee30b13494c8f0d4
parentf2ecbda8d949e90b2e9955627e345e3989200772
Add initial DOM support for Media Capabilities
https://bugs.webkit.org/show_bug.cgi?id=181064

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/mediacapabilities/mediacapabilities-types.html

Add basic, cross-platform, DOM facing type and API support for Media Capabilities API.

* bindings/scripts/CodeGenerator.pm:
(WK_ucfirst):
* CMakeLists.txt:
* DerivedSources.make:
* Modules/mediacapabilities/AudioConfiguration.h: Added.
* Modules/mediacapabilities/AudioConfiguration.idl: Added.
* Modules/mediacapabilities/MediaCapabilities.cpp: Added.
(WebCore::bucketMIMETypes):
(WebCore::isValidMIMEType):
(WebCore::isValidVideoConfiguration):
(WebCore::isValidAudioConfiguration):
(WebCore::isValidMediaConfiguration):
(WebCore::MediaCapabilities::decodingInfo):
(WebCore::MediaCapabilities::encodingInfo):
* Modules/mediacapabilities/MediaCapabilities.h: Added.
* Modules/mediacapabilities/MediaCapabilities.idl: Added.
* Modules/mediacapabilities/MediaCapabilitiesInfo.h: Added.
(WebCore::MediaCapabilitiesInfo::supported const):
(WebCore::MediaCapabilitiesInfo::setSupported):
(WebCore::MediaCapabilitiesInfo::smooth const):
(WebCore::MediaCapabilitiesInfo::setSmooth):
(WebCore::MediaCapabilitiesInfo::powerEfficient const):
(WebCore::MediaCapabilitiesInfo::setPowerEfficient):
* Modules/mediacapabilities/MediaCapabilitiesInfo.idl: Added.
* Modules/mediacapabilities/MediaConfiguration.h: Added.
* Modules/mediacapabilities/MediaConfiguration.idl: Added.
* Modules/mediacapabilities/MediaDecodingConfiguration.h: Added.
* Modules/mediacapabilities/MediaDecodingConfiguration.idl: Added.
* Modules/mediacapabilities/MediaDecodingType.h: Added.
* Modules/mediacapabilities/MediaDecodingType.idl: Added.
* Modules/mediacapabilities/MediaEncodingConfiguration.h: Added.
* Modules/mediacapabilities/MediaEncodingConfiguration.idl: Added.
* Modules/mediacapabilities/MediaEncodingType.h: Added.
* Modules/mediacapabilities/MediaEncodingType.idl: Added.
* Modules/mediacapabilities/NavigatorMediaCapabilities.cpp: Added.
(WebCore::NavigatorMediaCapabilities::NavigatorMediaCapabilities):
(WebCore::NavigatorMediaCapabilities::supplementName):
(WebCore::NavigatorMediaCapabilities::from):
(WebCore::NavigatorMediaCapabilities::mediaCapabilities):
(WebCore::NavigatorMediaCapabilities::mediaCapabilities const):
* Modules/mediacapabilities/NavigatorMediaCapabilities.h: Added.
* Modules/mediacapabilities/NavigatorMediaCapabilities.idl: Added.
* Modules/mediacapabilities/ScreenColorGamut.h: Added.
* Modules/mediacapabilities/ScreenColorGamut.idl: Added.
* Modules/mediacapabilities/ScreenLuminance.h: Added.
(WebCore::ScreenLuminance::min const):
(WebCore::ScreenLuminance::setMin):
(WebCore::ScreenLuminance::max const):
(WebCore::ScreenLuminance::setMax):
(WebCore::ScreenLuminance::maxAverage const):
(WebCore::ScreenLuminance::setMaxAverage):
* Modules/mediacapabilities/ScreenLuminance.idl: Added.
* Modules/mediacapabilities/VideoConfiguration.h: Added.
* Modules/mediacapabilities/VideoConfiguration.idl: Added.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setMediaCapabilitiesEnabled):
(WebCore::RuntimeEnabledFeatures::mediaCapabilitiesEnabled const):
* page/Settings.yaml:

Source/WebKit:

Add a new preference to enable the (disabled-by-default) Media Capabilities API.

* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetMediaCapabilitiesEnabled):
(WKPreferencesGetMediaCapabilitiesEnabled):
* UIProcess/API/C/WKPreferencesRef.h:

Source/WebKitLegacy/mac:

Add a new preference to enable the (disabled-by-default) Media Capabilities API.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences mediaCapabilitiesEnabled]):
(-[WebPreferences setMediaCapabilitiesEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebPreferencesToConsistentValues):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):

LayoutTests:

* fast/dom/navigator-detached-no-crash-expected.txt:
* media/mediacapabilities/mediacapabilities-types-expected.txt: Added.
* media/mediacapabilities/mediacapabilities-types.html: Added.
* platform/gtk/fast/dom/navigator-detached-no-crash-expected.txt:
* platform/mac-elcapitan-wk2/fast/dom/navigator-detached-no-crash-expected.txt:
* platform/mac-wk1/fast/dom/navigator-detached-no-crash-expected.txt:
* platform/win/fast/dom/navigator-detached-no-crash-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@226228 268f45cc-cd09-0410-ab3c-d52691b4dbfc
55 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/dom/navigator-detached-no-crash-expected.txt
LayoutTests/media/mediacapabilities/mediacapabilities-types-expected.txt [new file with mode: 0644]
LayoutTests/media/mediacapabilities/mediacapabilities-types.html [new file with mode: 0644]
LayoutTests/platform/gtk/fast/dom/navigator-detached-no-crash-expected.txt
LayoutTests/platform/mac-elcapitan-wk2/fast/dom/navigator-detached-no-crash-expected.txt
LayoutTests/platform/mac-wk1/fast/dom/navigator-detached-no-crash-expected.txt
LayoutTests/platform/win/fast/dom/navigator-detached-no-crash-expected.txt
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.make
Source/WebCore/Modules/mediacapabilities/AudioConfiguration.h [new file with mode: 0644]
Source/WebCore/Modules/mediacapabilities/AudioConfiguration.idl [new file with mode: 0644]
Source/WebCore/Modules/mediacapabilities/MediaCapabilities.cpp [new file with mode: 0644]
Source/WebCore/Modules/mediacapabilities/MediaCapabilities.h [new file with mode: 0644]
Source/WebCore/Modules/mediacapabilities/MediaCapabilities.idl [new file with mode: 0644]
Source/WebCore/Modules/mediacapabilities/MediaCapabilitiesInfo.h [new file with mode: 0644]
Source/WebCore/Modules/mediacapabilities/MediaCapabilitiesInfo.idl [new file with mode: 0644]
Source/WebCore/Modules/mediacapabilities/MediaConfiguration.h [new file with mode: 0644]
Source/WebCore/Modules/mediacapabilities/MediaConfiguration.idl [new file with mode: 0644]
Source/WebCore/Modules/mediacapabilities/MediaDecodingConfiguration.h [new file with mode: 0644]
Source/WebCore/Modules/mediacapabilities/MediaDecodingConfiguration.idl [new file with mode: 0644]
Source/WebCore/Modules/mediacapabilities/MediaDecodingType.h [new file with mode: 0644]
Source/WebCore/Modules/mediacapabilities/MediaDecodingType.idl [new file with mode: 0644]
Source/WebCore/Modules/mediacapabilities/MediaEncodingConfiguration.h [new file with mode: 0644]
Source/WebCore/Modules/mediacapabilities/MediaEncodingConfiguration.idl [new file with mode: 0644]
Source/WebCore/Modules/mediacapabilities/MediaEncodingType.h [new file with mode: 0644]
Source/WebCore/Modules/mediacapabilities/MediaEncodingType.idl [new file with mode: 0644]
Source/WebCore/Modules/mediacapabilities/NavigatorMediaCapabilities.cpp [new file with mode: 0644]
Source/WebCore/Modules/mediacapabilities/NavigatorMediaCapabilities.h [new file with mode: 0644]
Source/WebCore/Modules/mediacapabilities/NavigatorMediaCapabilities.idl [new file with mode: 0644]
Source/WebCore/Modules/mediacapabilities/ScreenColorGamut.h [new file with mode: 0644]
Source/WebCore/Modules/mediacapabilities/ScreenColorGamut.idl [new file with mode: 0644]
Source/WebCore/Modules/mediacapabilities/ScreenLuminance.h [new file with mode: 0644]
Source/WebCore/Modules/mediacapabilities/ScreenLuminance.idl [new file with mode: 0644]
Source/WebCore/Modules/mediacapabilities/VideoConfiguration.h [new file with mode: 0644]
Source/WebCore/Modules/mediacapabilities/VideoConfiguration.idl [new file with mode: 0644]
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/WebCoreBuiltinNames.h
Source/WebCore/bindings/scripts/CodeGenerator.pm
Source/WebCore/page/RuntimeEnabledFeatures.h
Source/WebCore/page/Settings.yaml
Source/WebKit/ChangeLog
Source/WebKit/Shared/WebPreferences.yaml
Source/WebKit/UIProcess/API/C/WKPreferences.cpp
Source/WebKit/UIProcess/API/C/WKPreferencesRef.h
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h
Source/WebKitLegacy/mac/WebView/WebPreferences.mm
Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h
Source/WebKitLegacy/mac/WebView/WebView.mm
Tools/ChangeLog
Tools/DumpRenderTree/mac/DumpRenderTree.mm
Tools/WebKitTestRunner/TestController.cpp