RESOLVED FIXED 181064
Add initial DOM support for Media Capabilities
https://bugs.webkit.org/show_bug.cgi?id=181064
Summary Add initial DOM support for Media Capabilities
Jer Noble
Reported 2017-12-20 16:25:51 PST
Add initial DOM support for Media Capabilities
Attachments
Patch (95.15 KB, patch)
2017-12-20 16:32 PST, Jer Noble
no flags
Archive of layout-test-results from ews102 for mac-elcapitan (2.26 MB, application/zip)
2017-12-20 17:31 PST, EWS Watchlist
no flags
Archive of layout-test-results from ews104 for mac-elcapitan-wk2 (2.55 MB, application/zip)
2017-12-20 17:49 PST, EWS Watchlist
no flags
Archive of layout-test-results from ews114 for mac-elcapitan (2.90 MB, application/zip)
2017-12-20 18:05 PST, EWS Watchlist
no flags
Patch (97.24 KB, patch)
2017-12-20 21:13 PST, Jer Noble
no flags
Patch (103.41 KB, patch)
2017-12-20 22:18 PST, Jer Noble
no flags
Patch (103.77 KB, patch)
2017-12-20 22:46 PST, Jer Noble
no flags
Archive of layout-test-results from ews102 for mac-elcapitan (2.15 MB, application/zip)
2017-12-20 23:53 PST, EWS Watchlist
no flags
Archive of layout-test-results from ews106 for mac-elcapitan-wk2 (2.54 MB, application/zip)
2017-12-21 00:06 PST, EWS Watchlist
no flags
Archive of layout-test-results from ews112 for mac-elcapitan (3.00 MB, application/zip)
2017-12-21 00:16 PST, EWS Watchlist
no flags
Patch (108.36 KB, patch)
2017-12-21 08:31 PST, Jer Noble
no flags
Jer Noble
Comment 1 2017-12-20 16:32:39 PST
Radar WebKit Bug Importer
Comment 2 2017-12-20 16:34:10 PST
EWS Watchlist
Comment 3 2017-12-20 16:36:44 PST
Attachment 329964 [details] did not pass style-queue: ERROR: Source/WebCore/Modules/mediacapabilities/ScreenColorGamut.h:31: enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums. [readability/enum_casing] [4] ERROR: Source/WebCore/Modules/mediacapabilities/ScreenColorGamut.h:32: enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums. [readability/enum_casing] [4] Total errors found: 2 in 48 files If any of these errors are false positives, please file a bug against check-webkit-style.
EWS Watchlist
Comment 4 2017-12-20 17:31:54 PST Comment hidden (obsolete)
EWS Watchlist
Comment 5 2017-12-20 17:31:55 PST Comment hidden (obsolete)
EWS Watchlist
Comment 6 2017-12-20 17:49:37 PST Comment hidden (obsolete)
EWS Watchlist
Comment 7 2017-12-20 17:49:38 PST Comment hidden (obsolete)
EWS Watchlist
Comment 8 2017-12-20 18:05:38 PST Comment hidden (obsolete)
EWS Watchlist
Comment 9 2017-12-20 18:05:44 PST Comment hidden (obsolete)
Eric Carlson
Comment 10 2017-12-20 20:47:35 PST
Comment on attachment 329964 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=329964&action=review > Source/WebCore/Modules/mediacapabilities/MediaCapabilities.cpp:66 > + // value describing a single media codec. Otherwise, it eMUST contain no parameters. Nit: "eMUST" > Source/WebCore/Modules/mediacapabilities/MediaCapabilities.cpp:97 > + // 1. If configurationâs contentType is not a valid video MIME type, return false and abort these steps. Nit: might as well cite the spec here as you did in isValidVideoConfiguration > Source/WebCore/Modules/mediacapabilities/MediaCapabilities.cpp:136 > + > + m_taskQueue.enqueueTask([configuration = WTFMove(configuration), promise = WTFMove(promise)] () mutable { // 4. Let p be a new promise. // 5. In parallel, run the create a MediaCapabilitiesInfo algorithm with configuration and resolve p with its result. // 6. Return p. > Source/WebCore/Modules/mediacapabilities/MediaCapabilities.cpp:144 > +{ > + if (!isValidMediaConfiguration(configuration)) { Citation and steps as in decodingInfo? > Source/WebKit/UIProcess/API/C/WKPreferences.cpp:1942 > + > +void WKPreferencesSetMediaCapabilitiesEnabled(WKPreferencesRef preferencesRef, bool enabled) > +{ > + toImpl(preferencesRef)->setMediaCapabilitiesEnabled(enabled); > +} > + > +bool WKPreferencesGetMediaCapabilitiesEnabled(WKPreferencesRef preferencesRef) > +{ > + return toImpl(preferencesRef)->mediaCapabilitiesEnabled(); > +} > + Do we really need to add this to the C API? > Source/WebKit/UIProcess/API/C/WKPreferencesRef.h:308 > +WK_EXPORT bool WKPreferencesGetMediaCapabilitiesEnabled(WKPreferencesRef preferencesRef); > +WK_EXPORT void WKPreferencesSetMediaCapabilitiesEnabled(WKPreferencesRef preferencesRef, bool enabled); Ditto. > Source/WebKitLegacy/mac/WebView/WebPreferences.mm:684 > + @NO, WebKitMediaCapabilitiesEnabledPreferenceKey, Do we really need to add this to WK1? If this is just for testing, you can add a function to InternalSettings to set the runtime flag (eg. InternalSettings::setScreenCaptureEnabled).
Jer Noble
Comment 11 2017-12-20 21:13:25 PST
EWS Watchlist
Comment 12 2017-12-20 21:16:20 PST
Attachment 330003 [details] did not pass style-queue: ERROR: Source/WebCore/Modules/mediacapabilities/ScreenColorGamut.h:31: enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums. [readability/enum_casing] [4] ERROR: Source/WebCore/Modules/mediacapabilities/ScreenColorGamut.h:32: enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums. [readability/enum_casing] [4] Total errors found: 2 in 50 files If any of these errors are false positives, please file a bug against check-webkit-style.
Jer Noble
Comment 13 2017-12-20 21:41:03 PST
(In reply to Eric Carlson from comment #10) > Comment on attachment 329964 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=329964&action=review > > > Source/WebCore/Modules/mediacapabilities/MediaCapabilities.cpp:66 > > + // value describing a single media codec. Otherwise, it eMUST contain no parameters. > > Nit: "eMUST" Fixed; > > Source/WebCore/Modules/mediacapabilities/MediaCapabilities.cpp:97 > > + // 1. If configurationâs contentType is not a valid video MIME type, return false and abort these steps. > > Nit: might as well cite the spec here as you did in isValidVideoConfiguration Ok. > > Source/WebCore/Modules/mediacapabilities/MediaCapabilities.cpp:136 > > + > > + m_taskQueue.enqueueTask([configuration = WTFMove(configuration), promise = WTFMove(promise)] () mutable { > > // 4. Let p be a new promise. > // 5. In parallel, run the create a MediaCapabilitiesInfo algorithm with > configuration and resolve p with its result. > // 6. Return p. Ok. > > Source/WebCore/Modules/mediacapabilities/MediaCapabilities.cpp:144 > > +{ > > + if (!isValidMediaConfiguration(configuration)) { > > Citation and steps as in decodingInfo? Added. > > Source/WebKit/UIProcess/API/C/WKPreferences.cpp:1942 > > + > > +void WKPreferencesSetMediaCapabilitiesEnabled(WKPreferencesRef preferencesRef, bool enabled) > > +{ > > + toImpl(preferencesRef)->setMediaCapabilitiesEnabled(enabled); > > +} > > + > > +bool WKPreferencesGetMediaCapabilitiesEnabled(WKPreferencesRef preferencesRef) > > +{ > > + return toImpl(preferencesRef)->mediaCapabilitiesEnabled(); > > +} > > + > > Do we really need to add this to the C API? Yep. Because, amazingly, WebKitTestRunner still uses the C preferences API. :( > > Source/WebKit/UIProcess/API/C/WKPreferencesRef.h:308 > > +WK_EXPORT bool WKPreferencesGetMediaCapabilitiesEnabled(WKPreferencesRef preferencesRef); > > +WK_EXPORT void WKPreferencesSetMediaCapabilitiesEnabled(WKPreferencesRef preferencesRef, bool enabled); > > Ditto. > > > Source/WebKitLegacy/mac/WebView/WebPreferences.mm:684 > > + @NO, WebKitMediaCapabilitiesEnabledPreferenceKey, > > Do we really need to add this to WK1? If this is just for testing, you can > add a function to InternalSettings to set the runtime flag (eg. > InternalSettings::setScreenCaptureEnabled). I guess we could, but that's not how any of the other preferences work. Adding it only to InternalSettings would mean we'd have to enable it for individual tests in the test itself. This API will eventually be enabled by default (on Cocoa ports, at least), so adding "internal" enable doesn't seem correct here.
Jer Noble
Comment 14 2017-12-20 22:18:48 PST
EWS Watchlist
Comment 15 2017-12-20 22:20:47 PST
Attachment 330008 [details] did not pass style-queue: ERROR: Source/WebCore/Modules/mediacapabilities/ScreenColorGamut.h:31: enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums. [readability/enum_casing] [4] ERROR: Source/WebCore/Modules/mediacapabilities/ScreenColorGamut.h:32: enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums. [readability/enum_casing] [4] Total errors found: 2 in 50 files If any of these errors are false positives, please file a bug against check-webkit-style.
Jer Noble
Comment 16 2017-12-20 22:46:55 PST
EWS Watchlist
Comment 17 2017-12-20 22:48:58 PST
Attachment 330011 [details] did not pass style-queue: ERROR: Source/WebCore/Modules/mediacapabilities/ScreenColorGamut.h:31: enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums. [readability/enum_casing] [4] ERROR: Source/WebCore/Modules/mediacapabilities/ScreenColorGamut.h:32: enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums. [readability/enum_casing] [4] Total errors found: 2 in 50 files If any of these errors are false positives, please file a bug against check-webkit-style.
EWS Watchlist
Comment 18 2017-12-20 23:53:47 PST Comment hidden (obsolete)
EWS Watchlist
Comment 19 2017-12-20 23:53:48 PST Comment hidden (obsolete)
EWS Watchlist
Comment 20 2017-12-21 00:06:19 PST Comment hidden (obsolete)
EWS Watchlist
Comment 21 2017-12-21 00:06:20 PST Comment hidden (obsolete)
EWS Watchlist
Comment 22 2017-12-21 00:16:29 PST Comment hidden (obsolete)
EWS Watchlist
Comment 23 2017-12-21 00:16:31 PST Comment hidden (obsolete)
Jer Noble
Comment 24 2017-12-21 08:31:50 PST
EWS Watchlist
Comment 25 2017-12-21 08:34:29 PST
Attachment 330031 [details] did not pass style-queue: ERROR: Source/WebCore/Modules/mediacapabilities/ScreenColorGamut.h:31: enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums. [readability/enum_casing] [4] ERROR: Source/WebCore/Modules/mediacapabilities/ScreenColorGamut.h:32: enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums. [readability/enum_casing] [4] Total errors found: 2 in 55 files If any of these errors are false positives, please file a bug against check-webkit-style.
WebKit Commit Bot
Comment 26 2017-12-21 10:28:27 PST
Comment on attachment 330031 [details] Patch Clearing flags on attachment: 330031 Committed r226228: <https://trac.webkit.org/changeset/226228>
WebKit Commit Bot
Comment 27 2017-12-21 10:28:29 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.