Diff
Modified: trunk/LayoutTests/ChangeLog (212322 => 212323)
--- trunk/LayoutTests/ChangeLog 2017-02-14 21:15:07 UTC (rev 212322)
+++ trunk/LayoutTests/ChangeLog 2017-02-14 22:34:48 UTC (rev 212323)
@@ -1,3 +1,18 @@
+2017-02-14 Eric Carlson <[email protected]>
+
+ [MediaStream] add navigator.getUserMedia for compatibility with legacy content
+ https://bugs.webkit.org/show_bug.cgi?id=168324
+ <rdar://problem/30513125>
+
+ Reviewed by Youenn Fablet.
+
+ * fast/mediastream/argument-types-expected.txt:
+ * fast/mediastream/argument-types.html: Added.
+ * fast/mediastream/getusermedia-expected.txt:
+ * fast/mediastream/getusermedia.html: Added.
+ * fast/mediastream/script-tests/argument-types.js: Added.
+ * fast/mediastream/webkitGetUserMedia-shadowing-then.html: Added.
+
2017-02-13 Dean Jackson <[email protected]>
Rename preferLowPowerToHighPerformance to powerPreference
Modified: trunk/LayoutTests/fast/dom/navigator-detached-no-crash.html (212322 => 212323)
--- trunk/LayoutTests/fast/dom/navigator-detached-no-crash.html 2017-02-14 21:15:07 UTC (rev 212322)
+++ trunk/LayoutTests/fast/dom/navigator-detached-no-crash.html 2017-02-14 22:34:48 UTC (rev 212323)
@@ -53,7 +53,7 @@
var strings = [ ];
for (p in old_nav) {
// Don't include some features until most platforms have support.
- if (p == 'geolocation' || p == 'webkitGetUserMedia' || p == 'mediaDevices' || p == "getGamepads")
+ if (p == 'geolocation' || p == 'getUserMedia' || p == 'mediaDevices' || p == "getGamepads")
continue;
if (typeof old_nav[p] == 'function') {
Modified: trunk/LayoutTests/fast/mediastream/argument-types-expected.txt (212322 => 212323)
--- trunk/LayoutTests/fast/mediastream/argument-types-expected.txt 2017-02-14 21:15:07 UTC (rev 212322)
+++ trunk/LayoutTests/fast/mediastream/argument-types-expected.txt 2017-02-14 22:34:48 UTC (rev 212323)
@@ -3,45 +3,45 @@
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-PASS navigator.webkitGetUserMedia() threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia(undefined) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia(null) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia({ }) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia({video: true}) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia(true) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia(42) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia(Infinity) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia(-Infinity) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia(emptyFunction) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia({video: true}, emptyFunction) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia(undefined, emptyFunction) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia(null, emptyFunction) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia({ }, emptyFunction) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia(true, emptyFunction) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia(42, emptyFunction) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia(Infinity, emptyFunction) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia(-Infinity, emptyFunction) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia(emptyFunction, emptyFunction) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia({video: true}, "foobar") threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia({video: true}, undefined) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia({video: true}, null) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia({video: true}, {}) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia({video: true}, true) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia({video: true}, 42) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia({video: true}, Infinity) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia({video: true}, -Infinity) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia({ }, emptyFunction, emptyFunction) did not throw exception.
-PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, emptyFunction) did not throw exception.
-PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, undefined) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function.
-PASS navigator.webkitGetUserMedia({audio:true, video:true}, emptyFunction, undefined) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function.
-PASS navigator.webkitGetUserMedia({audio:true}, emptyFunction, undefined) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function.
-PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, "video") threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function.
-PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, null) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function.
-PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, {}) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function.
-PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, true) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function.
-PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, 42) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function.
-PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, Infinity) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function.
-PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, -Infinity) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function.
+PASS navigator.getUserMedia() threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia(undefined) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia(null) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia({ }) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia({video: true}) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia(true) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia(42) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia(Infinity) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia(-Infinity) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia(emptyFunction) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia({video: true}, emptyFunction) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia(undefined, emptyFunction) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia(null, emptyFunction) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia({ }, emptyFunction) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia(true, emptyFunction) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia(42, emptyFunction) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia(Infinity, emptyFunction) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia(-Infinity, emptyFunction) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia(emptyFunction, emptyFunction) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia({video: true}, "foobar") threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia({video: true}, undefined) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia({video: true}, null) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia({video: true}, {}) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia({video: true}, true) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia({video: true}, 42) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia({video: true}, Infinity) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia({video: true}, -Infinity) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia({ }, emptyFunction, emptyFunction) did not throw exception.
+PASS navigator.getUserMedia({video: true}, emptyFunction, emptyFunction) did not throw exception.
+PASS navigator.getUserMedia({video: true}, emptyFunction, undefined) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
+PASS navigator.getUserMedia({audio:true, video:true}, emptyFunction, undefined) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
+PASS navigator.getUserMedia({audio:true}, emptyFunction, undefined) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
+PASS navigator.getUserMedia({video: true}, emptyFunction, "video") threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
+PASS navigator.getUserMedia({video: true}, emptyFunction, null) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
+PASS navigator.getUserMedia({video: true}, emptyFunction, {}) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
+PASS navigator.getUserMedia({video: true}, emptyFunction, true) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
+PASS navigator.getUserMedia({video: true}, emptyFunction, 42) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
+PASS navigator.getUserMedia({video: true}, emptyFunction, Infinity) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
+PASS navigator.getUserMedia({video: true}, emptyFunction, -Infinity) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
PASS successfullyParsed is true
TEST COMPLETE
Added: trunk/LayoutTests/fast/mediastream/argument-types.html (0 => 212323)
--- trunk/LayoutTests/fast/mediastream/argument-types.html (rev 0)
+++ trunk/LayoutTests/fast/mediastream/argument-types.html 2017-02-14 22:34:48 UTC (rev 212323)
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+ <head>
+ <script src=""
+ </head>
+ <body>
+ <script src=""
+ <script src=""
+ </body>
+</html>
Modified: trunk/LayoutTests/fast/mediastream/getusermedia-expected.txt (212322 => 212323)
--- trunk/LayoutTests/fast/mediastream/getusermedia-expected.txt 2017-02-14 21:15:07 UTC (rev 212322)
+++ trunk/LayoutTests/fast/mediastream/getusermedia-expected.txt 2017-02-14 22:34:48 UTC (rev 212323)
@@ -1,37 +1,37 @@
-Tests webkitGetUserMedia.
+Tests getUserMedia.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-PASS navigator.webkitGetUserMedia({audio:false, video:false}, error, expectedError); did not throw exception.
-PASS navigator.webkitGetUserMedia({audio:false, video:false}, error, null); threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function.
-PASS navigator.webkitGetUserMedia({audio:true}, gotStream1, error); did not throw exception.
+PASS navigator.getUserMedia({audio:false, video:false}, error, expectedError); did not throw exception.
+PASS navigator.getUserMedia({audio:false, video:false}, error, null); threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
+PASS navigator.getUserMedia({audio:true}, gotStream1, error); did not throw exception.
PASS Error callback called.
PASS Stream generated.
PASS stream.getAudioTracks().length is 1
PASS stream.getVideoTracks().length is 0
-PASS navigator.webkitGetUserMedia({video:true}, gotStream2, null); threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function.
-PASS navigator.webkitGetUserMedia({video:true}, gotStream2, error); did not throw exception.
+PASS navigator.getUserMedia({video:true}, gotStream2, null); threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
+PASS navigator.getUserMedia({video:true}, gotStream2, error); did not throw exception.
PASS Stream generated.
PASS stream.getAudioTracks().length is 0
PASS stream.getVideoTracks().length is 1
-PASS navigator.webkitGetUserMedia({audio:true, video:true}, gotStream3, null); threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function.
-PASS navigator.webkitGetUserMedia({audio:true, video:true}, gotStream3, error); did not throw exception.
+PASS navigator.getUserMedia({audio:true, video:true}, gotStream3, null); threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
+PASS navigator.getUserMedia({audio:true, video:true}, gotStream3, error); did not throw exception.
PASS Stream generated.
PASS stream.getAudioTracks().length is 1
PASS stream.getVideoTracks().length is 1
-PASS navigator.webkitGetUserMedia({audio:{}, video:true}, gotStream4, null); threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function.
-PASS navigator.webkitGetUserMedia({audio:{}, video:true}, gotStream4, error); did not throw exception.
+PASS navigator.getUserMedia({audio:{}, video:true}, gotStream4, null); threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
+PASS navigator.getUserMedia({audio:{}, video:true}, gotStream4, error); did not throw exception.
PASS Stream generated.
PASS stream.getAudioTracks().length is 1
PASS stream.getVideoTracks().length is 1
-PASS navigator.webkitGetUserMedia({audio:true, video:{width:{exact:11}}}, gotStreamInError, null); threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function.
-PASS navigator.webkitGetUserMedia({audio:true, video:{width:{exact:11}}}, gotStreamInError, error1); did not throw exception.
+PASS navigator.getUserMedia({audio:true, video:{width:{exact:11}}}, gotStreamInError, null); threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
+PASS navigator.getUserMedia({audio:true, video:{width:{exact:11}}}, gotStreamInError, error1); did not throw exception.
PASS Error callback called.
FAIL errorArg.name should be OverconstrainedError. Was Error.
PASS errorArg.message is "Invalid constraint"
-PASS navigator.webkitGetUserMedia({audio:{volume:{exact:1}}, video:true}, gotStream5, 0); threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function.
-PASS navigator.webkitGetUserMedia({audio:{volume:{exact:1}}, video:true}, gotStream5, error); did not throw exception.
+PASS navigator.getUserMedia({audio:{volume:{exact:1}}, video:true}, gotStream5, 0); threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
+PASS navigator.getUserMedia({audio:{volume:{exact:1}}, video:true}, gotStream5, error); did not throw exception.
PASS Stream generated.
PASS stream.getAudioTracks().length is 1
PASS stream.getVideoTracks().length is 1
Added: trunk/LayoutTests/fast/mediastream/getusermedia.html (0 => 212323)
--- trunk/LayoutTests/fast/mediastream/getusermedia.html (rev 0)
+++ trunk/LayoutTests/fast/mediastream/getusermedia.html 2017-02-14 22:34:48 UTC (rev 212323)
@@ -0,0 +1,105 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+ <head>
+ <script src=""
+ </head>
+ <body>
+ <p id="description"></p>
+ <div id="console"></div>
+ <script>
+ description("Tests getUserMedia.");
+
+ function setUserMediaPermission(isGranted) {
+ if (window.testRunner)
+ testRunner.setUserMediaPermission(isGranted);
+ else
+ debug("This test can not be run without the testRunner");
+ }
+
+ var stream;
+ var errorArg;
+
+ function error() {
+ testFailed('Error callback called.');
+ finishJSTest();
+ }
+
+ function expectedError() {
+ testPassed('Error callback called.');
+ }
+
+ function gotStreamInError(s) {
+ testFailed('Stream generated.');
+ finishJSTest();
+ }
+
+ function gotStream5(s) {
+ stream = s;
+ testPassed('Stream generated.');
+ shouldBe('stream.getAudioTracks().length', '1');
+ shouldBe('stream.getVideoTracks().length', '1');
+ finishJSTest();
+ }
+
+ function error1(e) {
+ errorArg = e;
+ testPassed('Error callback called.');
+ shouldBeEqualToString('errorArg.name', 'OverconstrainedError');
+ shouldBeEqualToString('errorArg.message', 'Invalid constraint');
+
+ shouldThrow("navigator.getUserMedia({audio:{volume:{exact:1}}, video:true}, gotStream5, 0);");
+ shouldNotThrow("navigator.getUserMedia({audio:{volume:{exact:1}}, video:true}, gotStream5, error);");
+ }
+
+ function gotStream4(s) {
+ stream = s;
+ testPassed('Stream generated.');
+ shouldBe('stream.getAudioTracks().length', '1');
+ shouldBe('stream.getVideoTracks().length', '1');
+
+ shouldThrow("navigator.getUserMedia({audio:true, video:{width:{exact:11}}}, gotStreamInError, null);");
+ shouldNotThrow("navigator.getUserMedia({audio:true, video:{width:{exact:11}}}, gotStreamInError, error1);");
+ }
+
+ function gotStream3(s) {
+ stream = s;
+ testPassed('Stream generated.');
+ shouldBe('stream.getAudioTracks().length', '1');
+ shouldBe('stream.getVideoTracks().length', '1');
+
+ shouldThrow("navigator.getUserMedia({audio:{}, video:true}, gotStream4, null);");
+ shouldNotThrow("navigator.getUserMedia({audio:{}, video:true}, gotStream4, error);");
+ }
+
+ function gotStream2(s) {
+ stream = s;
+ testPassed('Stream generated.');
+ shouldBe('stream.getAudioTracks().length', '0');
+ shouldBe('stream.getVideoTracks().length', '1');
+
+ shouldThrow("navigator.getUserMedia({audio:true, video:true}, gotStream3, null);");
+ shouldNotThrow("navigator.getUserMedia({audio:true, video:true}, gotStream3, error);");
+ }
+
+ function gotStream1(s) {
+ stream = s;
+ testPassed('Stream generated.');
+ shouldBe('stream.getAudioTracks().length', '1');
+ shouldBe('stream.getVideoTracks().length', '0');
+
+ shouldThrow("navigator.getUserMedia({video:true}, gotStream2, null);")
+ shouldNotThrow("navigator.getUserMedia({video:true}, gotStream2, error);")
+ }
+
+ shouldNotThrow("navigator.getUserMedia({audio:false, video:false}, error, expectedError);")
+ shouldThrow("navigator.getUserMedia({audio:false, video:false}, error, null);")
+
+ setUserMediaPermission(true);
+ shouldNotThrow("navigator.getUserMedia({audio:true}, gotStream1, error);");
+
+ window.jsTestIsAsync = true;
+ window.successfullyParsed = true;
+ </script>
+ <script src=""
+ </body>
+</html>
Added: trunk/LayoutTests/fast/mediastream/script-tests/argument-types.js (0 => 212323)
--- trunk/LayoutTests/fast/mediastream/script-tests/argument-types.js (rev 0)
+++ trunk/LayoutTests/fast/mediastream/script-tests/argument-types.js 2017-02-14 22:34:48 UTC (rev 212323)
@@ -0,0 +1,70 @@
+description("Tests the acceptable types for arguments to navigator.getUserMedia methods.");
+
+function test(_expression_, expressionShouldThrow, expectedException) {
+ if (expressionShouldThrow) {
+ if (expectedException)
+ shouldThrow(_expression_, '"' + expectedException + '"');
+ else
+ shouldThrow(_expression_, '"TypeError: Not enough arguments"');
+ } else {
+ shouldNotThrow(_expression_);
+ }
+}
+
+var errorCallbackError = new TypeError("Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function")
+var invalidDictionaryError = new TypeError('First argument of getUserMedia must be a valid Dictionary')
+var notSupportedError = new Error('NotSupportedError: DOM Exception 9');
+var successCallbackError = new TypeError("Argument 2 ('successCallback') to Navigator.getUserMedia must be a function")
+var typeError = new TypeError('Type error');
+var typeNotAnObjectError = new TypeError('Not an object.');
+
+var emptyFunction = function() {};
+
+// No arguments
+test('navigator.getUserMedia()', true);
+
+// 1 Argument (Navigtor.getUserMedia requires at least 3 arguments).
+test('navigator.getUserMedia(undefined)', true);
+test('navigator.getUserMedia(null)', true);
+test('navigator.getUserMedia({ })', true);
+test('navigator.getUserMedia({video: true})', true);
+test('navigator.getUserMedia(true)', true);
+test('navigator.getUserMedia(42)', true);
+test('navigator.getUserMedia(Infinity)', true);
+test('navigator.getUserMedia(-Infinity)', true);
+test('navigator.getUserMedia(emptyFunction)', true);
+
+// 2 Arguments.
+test('navigator.getUserMedia({video: true}, emptyFunction)', true);
+test('navigator.getUserMedia(undefined, emptyFunction)', true);
+test('navigator.getUserMedia(null, emptyFunction)', true);
+test('navigator.getUserMedia({ }, emptyFunction)', true);
+test('navigator.getUserMedia(true, emptyFunction)', true);
+test('navigator.getUserMedia(42, emptyFunction)', true);
+test('navigator.getUserMedia(Infinity, emptyFunction)', true);
+test('navigator.getUserMedia(-Infinity, emptyFunction)', true);
+test('navigator.getUserMedia(emptyFunction, emptyFunction)', true);
+test('navigator.getUserMedia({video: true}, "foobar")', true);
+test('navigator.getUserMedia({video: true}, undefined)', true);
+test('navigator.getUserMedia({video: true}, null)', true);
+test('navigator.getUserMedia({video: true}, {})', true);
+test('navigator.getUserMedia({video: true}, true)', true);
+test('navigator.getUserMedia({video: true}, 42)', true);
+test('navigator.getUserMedia({video: true}, Infinity)', true);
+test('navigator.getUserMedia({video: true}, -Infinity)', true);
+
+// 3 Arguments.
+test('navigator.getUserMedia({ }, emptyFunction, emptyFunction)', false);
+test('navigator.getUserMedia({video: true}, emptyFunction, emptyFunction)', false);
+test('navigator.getUserMedia({video: true}, emptyFunction, undefined)', true, errorCallbackError);
+test('navigator.getUserMedia({audio:true, video:true}, emptyFunction, undefined)', true, errorCallbackError);
+test('navigator.getUserMedia({audio:true}, emptyFunction, undefined)', true, errorCallbackError);
+test('navigator.getUserMedia({video: true}, emptyFunction, "video")', true, errorCallbackError);
+test('navigator.getUserMedia({video: true}, emptyFunction, null)', true, errorCallbackError );
+test('navigator.getUserMedia({video: true}, emptyFunction, {})', true, errorCallbackError);
+test('navigator.getUserMedia({video: true}, emptyFunction, true)', true, errorCallbackError);
+test('navigator.getUserMedia({video: true}, emptyFunction, 42)', true, errorCallbackError);
+test('navigator.getUserMedia({video: true}, emptyFunction, Infinity)', true, errorCallbackError);
+test('navigator.getUserMedia({video: true}, emptyFunction, -Infinity)', true, errorCallbackError);
+
+window.jsTestIsAsync = false;
Added: trunk/LayoutTests/fast/mediastream/webkitGetUserMedia-shadowing-then.html (0 => 212323)
--- trunk/LayoutTests/fast/mediastream/webkitGetUserMedia-shadowing-then.html (rev 0)
+++ trunk/LayoutTests/fast/mediastream/webkitGetUserMedia-shadowing-then.html 2017-02-14 22:34:48 UTC (rev 212323)
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <title>Shadowing then()</title>
+</head>
+<body>
+<!--
+This test verifies that the implementation of navigator.getUserMedia does not use public promise APIs.
+-->
+<p id="output"></p>
+<script>
+ if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ }
+
+ function endTest(testStatus) {
+ document.getElementById("output").textContent = testStatus;
+ testRunner.notifyDone();
+ }
+
+ // Shadow Promise.prototype.then
+ Promise.prototype.then = (function () {
+ const realThen = Promise.prototype.then;
+ return function () {
+ endTest("FAIL: Executed shadowed, public .then()");
+ }
+ })();
+
+ function gotUserMedia(mediaStream) {
+ endTest("FAIL: Got user media");
+ }
+
+ function userMediaError(error) {
+ endTest("PASS");
+ }
+
+ var options = { audio: false, video: false };
+ navigator.getUserMedia(options, gotUserMedia, userMediaError);
+
+</script>
+</body>
+</html>
Modified: trunk/Source/WebCore/CMakeLists.txt (212322 => 212323)
--- trunk/Source/WebCore/CMakeLists.txt 2017-02-14 21:15:07 UTC (rev 212322)
+++ trunk/Source/WebCore/CMakeLists.txt 2017-02-14 22:34:48 UTC (rev 212323)
@@ -221,6 +221,7 @@
Modules/mediastream/MediaTrackConstraints.idl
Modules/mediastream/MediaTrackSupportedConstraints.idl
Modules/mediastream/NavigatorMediaDevices.idl
+ Modules/mediastream/NavigatorUserMedia.idl
Modules/mediastream/OverconstrainedError.idl
Modules/mediastream/OverconstrainedErrorEvent.idl
Modules/mediastream/RTCConfiguration.idl
@@ -3666,6 +3667,7 @@
${WEBCORE_DIR}/Modules/fetch/FetchRequest.js
${WEBCORE_DIR}/Modules/fetch/FetchResponse.js
${WEBCORE_DIR}/Modules/fetch/WorkerGlobalScopeFetch.js
+ ${WEBCORE_DIR}/Modules/mediastream/NavigatorUserMedia.js
${WEBCORE_DIR}/Modules/mediastream/RTCPeerConnection.js
${WEBCORE_DIR}/Modules/mediastream/RTCPeerConnectionInternals.js
${WEBCORE_DIR}/Modules/streams/ByteLengthQueuingStrategy.js
Modified: trunk/Source/WebCore/ChangeLog (212322 => 212323)
--- trunk/Source/WebCore/ChangeLog 2017-02-14 21:15:07 UTC (rev 212322)
+++ trunk/Source/WebCore/ChangeLog 2017-02-14 22:34:48 UTC (rev 212323)
@@ -1,3 +1,25 @@
+2017-02-14 Eric Carlson <[email protected]>
+
+ [MediaStream] add navigator.getUserMedia for compatibility with legacy content
+ https://bugs.webkit.org/show_bug.cgi?id=168324
+ <rdar://problem/30513125>
+
+ Reviewed by Youenn Fablet.
+
+ Tests: fast/mediastream/argument-types.html
+ fast/mediastream/getusermedia.html
+ fast/mediastream/webkitGetUserMedia-shadowing-then.html
+
+ * CMakeLists.txt:
+ * DerivedSources.cpp:
+ * DerivedSources.make:
+ * Modules/mediastream/MediaDevices.idl:
+ * Modules/mediastream/NavigatorUserMedia.idl: Added.
+ * Modules/mediastream/NavigatorUserMedia.js: Added.
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/WebCoreBuiltinNames.h:
+ * page/Navigator.idl:
+
2017-02-14 Chris Dumez <[email protected]>
Fallback to legacy type only when event is trusted
Modified: trunk/Source/WebCore/DerivedSources.cpp (212322 => 212323)
--- trunk/Source/WebCore/DerivedSources.cpp 2017-02-14 21:15:07 UTC (rev 212322)
+++ trunk/Source/WebCore/DerivedSources.cpp 2017-02-14 22:34:48 UTC (rev 212323)
@@ -349,6 +349,7 @@
#include "JSNavigatorContentUtils.cpp"
#include "JSNavigatorGeolocation.cpp"
#include "JSNavigatorMediaDevices.cpp"
+#include "JSNavigatorUserMedia.cpp"
#include "JSNavigatorVibration.cpp"
#include "JSNode.cpp"
#include "JSNodeFilter.cpp"
Modified: trunk/Source/WebCore/DerivedSources.make (212322 => 212323)
--- trunk/Source/WebCore/DerivedSources.make 2017-02-14 21:15:07 UTC (rev 212322)
+++ trunk/Source/WebCore/DerivedSources.make 2017-02-14 22:34:48 UTC (rev 212323)
@@ -162,6 +162,7 @@
$(WebCore)/Modules/mediastream/MediaTrackConstraints.idl \
$(WebCore)/Modules/mediastream/MediaTrackSupportedConstraints.idl \
$(WebCore)/Modules/mediastream/NavigatorMediaDevices.idl \
+ $(WebCore)/Modules/mediastream/NavigatorUserMedia.idl \
$(WebCore)/Modules/mediastream/OverconstrainedError.idl \
$(WebCore)/Modules/mediastream/OverconstrainedErrorEvent.idl \
$(WebCore)/Modules/mediastream/RTCConfiguration.idl \
@@ -1341,6 +1342,7 @@
$(WebCore)/Modules/fetch/FetchRequest.js \
$(WebCore)/Modules/fetch/FetchResponse.js \
${WebCore}/Modules/fetch/WorkerGlobalScopeFetch.js \
+ $(WebCore)/Modules/mediastream/NavigatorUserMedia.js \
$(WebCore)/Modules/mediastream/RTCPeerConnection.js \
$(WebCore)/Modules/mediastream/RTCPeerConnectionInternals.js \
$(WebCore)/Modules/streams/ByteLengthQueuingStrategy.js \
Modified: trunk/Source/WebCore/Modules/mediastream/MediaDevices.idl (212322 => 212323)
--- trunk/Source/WebCore/Modules/mediastream/MediaDevices.idl 2017-02-14 21:15:07 UTC (rev 212322)
+++ trunk/Source/WebCore/Modules/mediastream/MediaDevices.idl 2017-02-14 22:34:48 UTC (rev 212323)
@@ -34,7 +34,7 @@
] interface MediaDevices {
MediaTrackSupportedConstraints getSupportedConstraints();
- Promise<MediaStream> getUserMedia(optional MediaStreamConstraints constraints);
+ [PrivateIdentifier, PublicIdentifier] Promise<MediaStream> getUserMedia(optional MediaStreamConstraints constraints);
Promise<sequence<MediaDeviceInfo>> enumerateDevices();
};
Added: trunk/Source/WebCore/Modules/mediastream/NavigatorUserMedia.idl (0 => 212323)
--- trunk/Source/WebCore/Modules/mediastream/NavigatorUserMedia.idl (rev 0)
+++ trunk/Source/WebCore/Modules/mediastream/NavigatorUserMedia.idl 2017-02-14 22:34:48 UTC (rev 212323)
@@ -0,0 +1,36 @@
+/*
+* Copyright (C) 2017 Apple Inc. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions
+* are met:
+*
+* 1. Redistributions of source code must retain the above copyright
+* notice, this list of conditions and the following disclaimer.
+* 2. Redistributions in binary form must reproduce the above copyright
+* notice, this list of conditions and the following disclaimer
+* in the documentation and/or other materials provided with the
+* distribution.
+* 3. Neither the name of Ericsson nor the names of its contributors
+* may be used to endorse or promote products derived from this
+* software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+[
+ Conditional=MEDIA_STREAM,
+ EnabledAtRuntime=MediaStream,
+] partial interface Navigator {
+ [JSBuiltin] void getUserMedia(MediaStreamConstraints constraints, NavigatorUserMediaSuccessCallback successCallback, NavigatorUserMediaErrorCallback errorCallback);
+};
Added: trunk/Source/WebCore/Modules/mediastream/NavigatorUserMedia.js (0 => 212323)
--- trunk/Source/WebCore/Modules/mediastream/NavigatorUserMedia.js (rev 0)
+++ trunk/Source/WebCore/Modules/mediastream/NavigatorUserMedia.js 2017-02-14 22:34:48 UTC (rev 212323)
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2015 Canon Inc.
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// @conditional=ENABLE(MEDIA_STREAM)
+
+function getUserMedia(options, successCallback, errorCallback)
+{
+ "use strict";
+
+ // FIXME: We should raise a DOM unsupported exception if there is no navigator and properly detect whether method is not called on a Navigator object.
+ if (!(this.mediaDevices && this.mediaDevices.@getUserMedia))
+ throw @makeThisTypeError("Navigator", "getUserMedia");
+
+ if (arguments.length < 3)
+ @throwTypeError("Not enough arguments");
+
+ if (options !== @Object(options))
+ @throwTypeError("Argument 1 (options) to Navigator.getUserMedia must be an object");
+
+ if (typeof successCallback !== "function")
+ @throwTypeError("Argument 2 ('successCallback') to Navigator.getUserMedia must be a function");
+ if (typeof errorCallback !== "function")
+ @throwTypeError("Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function");
+
+ this.mediaDevices.@getUserMedia(options).@then(successCallback, errorCallback);
+}
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (212322 => 212323)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2017-02-14 21:15:07 UTC (rev 212322)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2017-02-14 22:34:48 UTC (rev 212323)
@@ -146,6 +146,8 @@
073B87671E4385AC0071C0EC /* AudioSampleBufferList.h in Headers */ = {isa = PBXBuildFile; fileRef = 073B87631E43859D0071C0EC /* AudioSampleBufferList.h */; };
073B87681E4385AC0071C0EC /* AudioSampleDataSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 073B87641E43859D0071C0EC /* AudioSampleDataSource.cpp */; };
073B87691E4385AC0071C0EC /* AudioSampleDataSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 073B87651E43859D0071C0EC /* AudioSampleDataSource.h */; };
+ 073BE34017D17E01002BD431 /* JSNavigatorUserMedia.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 073BE33E17D17E01002BD431 /* JSNavigatorUserMedia.cpp */; };
+ 073BE34117D17E01002BD431 /* JSNavigatorUserMedia.h in Headers */ = {isa = PBXBuildFile; fileRef = 073BE33F17D17E01002BD431 /* JSNavigatorUserMedia.h */; settings = {ATTRIBUTES = (Private, ); }; };
073BE34E17D180B2002BD431 /* RTCSessionDescriptionDescriptor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07221BAB17CF0AD400848E51 /* RTCSessionDescriptionDescriptor.cpp */; };
073BE34F17D18183002BD431 /* RTCIceCandidateDescriptor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07221BA617CF0AD400848E51 /* RTCIceCandidateDescriptor.cpp */; };
0744ECED1E0C4E30000D0944 /* MockRealtimeAudioSourceMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0744ECEC1E0C4AE5000D0944 /* MockRealtimeAudioSourceMac.mm */; };
@@ -7180,6 +7182,7 @@
07221B5717CEC32700848E51 /* MediaStreamTrackEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaStreamTrackEvent.cpp; sourceTree = "<group>"; };
07221B5817CEC32700848E51 /* MediaStreamTrackEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaStreamTrackEvent.h; sourceTree = "<group>"; };
07221B5917CEC32700848E51 /* MediaStreamTrackEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MediaStreamTrackEvent.idl; sourceTree = "<group>"; };
+ 07221B5C17CEC32700848E51 /* NavigatorUserMedia.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NavigatorUserMedia.idl; sourceTree = "<group>"; };
07221B6317CEC32700848E51 /* RTCDataChannel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RTCDataChannel.cpp; sourceTree = "<group>"; };
07221B6417CEC32700848E51 /* RTCDataChannel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCDataChannel.h; sourceTree = "<group>"; };
07221B6517CEC32700848E51 /* RTCDataChannel.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = RTCDataChannel.idl; sourceTree = "<group>"; };
@@ -7272,6 +7275,8 @@
073B87631E43859D0071C0EC /* AudioSampleBufferList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioSampleBufferList.h; sourceTree = "<group>"; };
073B87641E43859D0071C0EC /* AudioSampleDataSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AudioSampleDataSource.cpp; sourceTree = "<group>"; };
073B87651E43859D0071C0EC /* AudioSampleDataSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioSampleDataSource.h; sourceTree = "<group>"; };
+ 073BE33E17D17E01002BD431 /* JSNavigatorUserMedia.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSNavigatorUserMedia.cpp; sourceTree = "<group>"; };
+ 073BE33F17D17E01002BD431 /* JSNavigatorUserMedia.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSNavigatorUserMedia.h; sourceTree = "<group>"; };
0744ECEB1E0C4AE5000D0944 /* MockRealtimeAudioSourceMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MockRealtimeAudioSourceMac.h; sourceTree = "<group>"; };
0744ECEC1E0C4AE5000D0944 /* MockRealtimeAudioSourceMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MockRealtimeAudioSourceMac.mm; sourceTree = "<group>"; };
074E82B818A69F0E007EF54C /* PlatformTimeRanges.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformTimeRanges.cpp; sourceTree = "<group>"; };
@@ -8851,6 +8856,7 @@
419BC2DC1685329900D64D6D /* VisitedLinkState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VisitedLinkState.cpp; sourceTree = "<group>"; };
419BC2DD1685329900D64D6D /* VisitedLinkState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VisitedLinkState.h; sourceTree = "<group>"; };
419BE7521BC7F3DB00E1C85B /* WebCoreBuiltinNames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreBuiltinNames.h; sourceTree = "<group>"; };
+ 419BE75A1BCBD3ED00E1C85B /* NavigatorUserMedia.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode._javascript_; path = NavigatorUserMedia.js; sourceTree = "<group>"; };
419FAFAD1ABABCD5005B828B /* ReadableStreamDefaultReader.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ReadableStreamDefaultReader.idl; sourceTree = "<group>"; };
41A023ED1A39DB7900F722CF /* ReadableStream.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ReadableStream.idl; sourceTree = "<group>"; };
41A023ED1A39DB7900F722DF /* WritableStream.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WritableStream.idl; sourceTree = "<group>"; };
@@ -15337,6 +15343,8 @@
5EA725CA1ACABCB500EAD17B /* NavigatorMediaDevices.cpp */,
5EA725CB1ACABCB500EAD17B /* NavigatorMediaDevices.h */,
5EA725CC1ACABCB500EAD17B /* NavigatorMediaDevices.idl */,
+ 07221B5C17CEC32700848E51 /* NavigatorUserMedia.idl */,
+ 419BE75A1BCBD3ED00E1C85B /* NavigatorUserMedia.js */,
0704A4051D6DE9F10086DCDB /* OverconstrainedError.h */,
0704A4031D6DE9F10086DCDB /* OverconstrainedError.idl */,
072A703E1D6E8F6200DF0AFC /* OverconstrainedErrorEvent.h */,
@@ -15564,6 +15572,8 @@
932CC0D11DFFD667004C0F9F /* JSMediaTrackConstraints.h */,
0787C4671BFBDF6F006DCD7F /* JSMediaTrackSupportedConstraints.cpp */,
0787C4681BFBDF6F006DCD7F /* JSMediaTrackSupportedConstraints.h */,
+ 073BE33E17D17E01002BD431 /* JSNavigatorUserMedia.cpp */,
+ 073BE33F17D17E01002BD431 /* JSNavigatorUserMedia.h */,
0704A4091D6DFC690086DCDB /* JSOverconstrainedError.cpp */,
0704A40A1D6DFC690086DCDB /* JSOverconstrainedError.h */,
0704A4131D6F39FB0086DCDB /* JSOverconstrainedErrorEvent.cpp */,
@@ -26790,6 +26800,7 @@
C6F08FCA1431000D00685849 /* JSMutationRecord.h in Headers */,
BCD9C2C10C17B69E005C90A2 /* JSNamedNodeMap.h in Headers */,
A9D247F80D757E3400FDF959 /* JSNavigator.h in Headers */,
+ 073BE34117D17E01002BD431 /* JSNavigatorUserMedia.h in Headers */,
BC9439C3116CF4940048C750 /* JSNodeCustom.h in Headers */,
14115B7309F84CD600CA4FC1 /* JSNodeFilter.h in Headers */,
1A750D8E0A90E521000FF215 /* JSNodeIterator.h in Headers */,
@@ -30628,6 +30639,7 @@
C6F08FC91431000D00685849 /* JSMutationRecord.cpp in Sources */,
BCD9C2C00C17B69E005C90A2 /* JSNamedNodeMap.cpp in Sources */,
A9D247F70D757E3400FDF959 /* JSNavigator.cpp in Sources */,
+ 073BE34017D17E01002BD431 /* JSNavigatorUserMedia.cpp in Sources */,
14DC0D3709FED073007B0235 /* JSNode.cpp in Sources */,
BCD9C2640C17AA67005C90A2 /* JSNodeCustom.cpp in Sources */,
E3150EA61DA7219000194012 /* JSNodeDOMJIT.cpp in Sources */,
Modified: trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h (212322 => 212323)
--- trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h 2017-02-14 21:15:07 UTC (rev 212322)
+++ trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h 2017-02-14 22:34:48 UTC (rev 212323)
@@ -49,6 +49,7 @@
macro(fetchRequest) \
macro(fillFromJS) \
macro(finishConsumingStream) \
+ macro(getUserMedia) \
macro(getRemoteStreams) \
macro(getSenders) \
macro(getTracks) \
Modified: trunk/Source/WebCore/page/Navigator.idl (212322 => 212323)
--- trunk/Source/WebCore/page/Navigator.idl 2017-02-14 21:15:07 UTC (rev 212322)
+++ trunk/Source/WebCore/page/Navigator.idl 2017-02-14 22:34:48 UTC (rev 212323)
@@ -24,7 +24,7 @@
readonly attribute DOMMimeTypeArray mimeTypes;
readonly attribute boolean cookieEnabled;
boolean javaEnabled();
-
+
// FIXME: Convert this #if'def to an IDL conditional attribute.
#if defined(WTF_PLATFORM_IOS) && WTF_PLATFORM_IOS
readonly attribute boolean standalone;
Modified: trunk/Source/WebInspectorUI/ChangeLog (212322 => 212323)
--- trunk/Source/WebInspectorUI/ChangeLog 2017-02-14 21:15:07 UTC (rev 212322)
+++ trunk/Source/WebInspectorUI/ChangeLog 2017-02-14 22:34:48 UTC (rev 212323)
@@ -1,3 +1,13 @@
+2017-02-14 Eric Carlson <[email protected]>
+
+ [MediaStream] add navigator.getUserMedia for compatibility with legacy content
+ https://bugs.webkit.org/show_bug.cgi?id=168324
+ <rdar://problem/30513125>
+
+ Reviewed by Youenn Fablet.
+
+ * UserInterface/Models/NativeFunctionParameters.js:
+
2017-02-13 Devin Rousso <[email protected]>
Web Inspector: provide a way to show current value of CSS variables in style rules
Modified: trunk/Source/WebInspectorUI/UserInterface/Models/NativeFunctionParameters.js (212322 => 212323)
--- trunk/Source/WebInspectorUI/UserInterface/Models/NativeFunctionParameters.js 2017-02-14 21:15:07 UTC (rev 212322)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/NativeFunctionParameters.js 2017-02-14 22:34:48 UTC (rev 212323)
@@ -1161,6 +1161,21 @@
__proto__: null,
},
+ Navigator: {
+ getUserMedia: "options, successCallback, errorCallback",
+ __proto__: null,
+ },
+
+ NavigatorUserMediaErrorCallback: {
+ handleEvent: "error",
+ __proto__: null,
+ },
+
+ NavigatorUserMediaSuccessCallback: {
+ handleEvent: "stream",
+ __proto__: null,
+ },
+
NodeFilter: {
acceptNode: "[n]",
__proto__: null,