Changeset 225963 in webkit
- Timestamp:
- Dec 14, 2017 9:32:53 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r225960 r225963 1 2017-12-14 Youenn Fablet <youenn@apple.com> 2 3 Implement <iframe allow="camera; microphone"> 4 https://bugs.webkit.org/show_bug.cgi?id=167430 5 <rdar://problem/34887226> 6 7 Reviewed by Eric Carlson. 8 9 Skipping mediastream tests for wpe. 10 Updating expectations based on new error message. 11 12 * TestExpectations: Skipping sync XHR test using allow attribute. 13 * http/tests/ssl/media-stream/get-user-media-different-host-expected.txt: 14 * http/tests/ssl/media-stream/get-user-media-nested-expected.txt: 15 * platform/mac-wk1/imported/w3c/web-platform-tests/XMLHttpRequest/xmlhttprequest-sync-default-feature-policy.sub-expected.txt: 16 * platform/wpe/TestExpectations: 17 1 18 2017-12-14 Zalan Bujtas <zalan@apple.com> 2 19 -
trunk/LayoutTests/TestExpectations
r225909 r225963 223 223 224 224 imported/w3c/web-platform-tests/2dcontext/transformations/canvas_transformations_reset_001.html [ ImageOnlyFailure ] 225 imported/w3c/web-platform-tests/XMLHttpRequest/xmlhttprequest-sync-default-feature-policy.sub.html [ Skip ] 225 226 webkit.org/b/179607 imported/w3c/web-platform-tests/XMLHttpRequest/access-control-and-redirects-async.htm [ Pass Failure ] 226 227 webkit.org/b/179607 imported/w3c/web-platform-tests/XMLHttpRequest/access-control-and-redirects-async-same-origin.htm [ Pass Failure ] -
trunk/LayoutTests/http/tests/ssl/media-stream/get-user-media-different-host-expected.txt
r219663 r225963 1 CONSOLE MESSAGE: line 52: T rying to call getUserMedia from a document with a different security origin than its top-level frame.1 CONSOLE MESSAGE: line 52: The top-level frame has prevented a document with a different security origin to call getUserMedia. 2 2 Tests that getUserMedia fails when the top level document and iframe do not have the same domain. 3 3 -
trunk/LayoutTests/http/tests/ssl/media-stream/get-user-media-nested-expected.txt
r219663 r225963 1 CONSOLE MESSAGE: line 52: T rying to call getUserMedia from a document with a different security origin than its top-level frame.1 CONSOLE MESSAGE: line 52: The top-level frame has prevented a document with a different security origin to call getUserMedia. 2 2 Tests that getUserMedia fails when the top level document and iframe do not have the same domain. 3 3 -
trunk/LayoutTests/imported/w3c/ChangeLog
r225961 r225963 1 2017-12-14 Youenn Fablet <youenn@apple.com> 2 3 Implement <iframe allow="camera; microphone"> 4 https://bugs.webkit.org/show_bug.cgi?id=167430 5 6 Reviewed by Eric Carlson. 7 8 * resources/import-expectations.json: 9 * web-platform-tests/feature-policy/resources/: Added as this is used for some mediacapture-streams tests. 10 * web-platform-tests/mediacapture-streams/: Added. 11 1 12 2017-12-14 Chris Dumez <cdumez@apple.com> 2 13 -
trunk/LayoutTests/imported/w3c/resources/import-expectations.json
r225593 r225963 135 135 "web-platform-tests/feature-policy": "skip", 136 136 "web-platform-tests/feature-policy/resources": "import", 137 "web-platform-tests/feature-policy/resources/": "import", 137 138 "web-platform-tests/fetch": "import", 138 139 "web-platform-tests/fullscreen": "skip", -
trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/xmlhttprequest-sync-default-feature-policy.sub-expected.txt
r224156 r225963 1 Blocked access to external URL http://www.localhost:8800/XMLHttpRequest/xmlhttprequest-sync-default-feature-policy.sub.html#iframe#sync-xhr 1 2 Blocked access to external URL http://www.localhost:8800/XMLHttpRequest/xmlhttprequest-sync-default-feature-policy.sub.html#iframe#sync-xhr 2 3 … … 7 8 PASS Default "sync-xhr" feature policy ["*"] allows same-origin iframes. 8 9 TIMEOUT Default "sync-xhr" feature policy ["*"] allows cross-origin iframes. Test timed out 9 FAIL Feature policy "sync-xhr" can be disabled in cross-origin iframes using "allow" attribute. undefined is not an object (evaluating 'frame.allow.concat') 10 TIMEOUT Feature policy "sync-xhr" can be disabled in cross-origin iframes using "allow" attribute. Test timed out 10 11 -
trunk/LayoutTests/imported/w3c/web-platform-tests/feature-policy/resources/featurepolicy.js
r224156 r225963 82 82 feature_promise_factory().then( 83 83 () => window.parent.postMessage('#OK', '*'), 84 (e) => window.parent.postMessage('#' + e. toString(), '*'));84 (e) => window.parent.postMessage('#' + e.name, '*')); 85 85 } 86 86 } -
trunk/LayoutTests/imported/w3c/web-platform-tests/feature-policy/resources/w3c-import.log
r223189 r225963 15 15 ------------------------------------------------------------------------ 16 16 List of files: 17 /LayoutTests/imported/w3c/web-platform-tests/feature-policy/resources/autoplay.js 18 /LayoutTests/imported/w3c/web-platform-tests/feature-policy/resources/feature-policy-autoplay.html 19 /LayoutTests/imported/w3c/web-platform-tests/feature-policy/resources/feature-policy-generic-sensor.html 17 20 /LayoutTests/imported/w3c/web-platform-tests/feature-policy/resources/feature-policy-payment.html 18 21 /LayoutTests/imported/w3c/web-platform-tests/feature-policy/resources/feature-policy-usb.html 22 /LayoutTests/imported/w3c/web-platform-tests/feature-policy/resources/feature-policy-wakelock.html 19 23 /LayoutTests/imported/w3c/web-platform-tests/feature-policy/resources/feature-policy-webvr.html 20 24 /LayoutTests/imported/w3c/web-platform-tests/feature-policy/resources/featurepolicy.js -
trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaStream-default-feature-policy.https-expected.txt
r224156 r225963 1 CONSOLE MESSAGE: line 1: Trying to call getUserMedia from a document with a different security origin than its top-level frame. 2 CONSOLE MESSAGE: line 1: Trying to call getUserMedia from a document with a different security origin than its top-level frame. 3 CONSOLE MESSAGE: line 1: Trying to call getUserMedia from a document with a different security origin than its top-level frame. 4 CONSOLE MESSAGE: line 1: Trying to call getUserMedia from a document with a different security origin than its top-level frame. 5 CONSOLE MESSAGE: line 1: Trying to call getUserMedia from a document with a different security origin than its top-level frame. 1 CONSOLE MESSAGE: line 1: The top-level frame has prevented a document with a different security origin to call getUserMedia. 2 CONSOLE MESSAGE: line 1: The top-level frame has prevented a document with a different security origin to call getUserMedia. 3 CONSOLE MESSAGE: line 1: The top-level frame has prevented a document with a different security origin to call getUserMedia. 4 CONSOLE MESSAGE: line 1: The top-level frame has prevented a document with a different security origin to call getUserMedia. 5 CONSOLE MESSAGE: line 1: The top-level frame has prevented a document with a different security origin to call getUserMedia. 6 CONSOLE MESSAGE: line 1: The top-level frame has prevented a document with a different security origin to call getUserMedia. 7 CONSOLE MESSAGE: line 1: The top-level frame has prevented a document with a different security origin to call getUserMedia. 6 8 7 9 8 10 PASS Default "microphone" feature policy ["self"] allows the top-level document. 9 11 PASS Default "microphone" feature policy ["self"] allows same-origin iframes. 10 FAIL Default "microphone" feature policy ["self"] disallows cross-origin iframes. assert_equals: expected "#[object NavigatorUserMediaError]" but got "#NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission." 11 FAIL Feature policy "microphone" can be enabled in cross-origin iframes using "allow" attribute. undefined is not an object (evaluating 'frame.allow.concat')12 PASS Default "microphone" feature policy ["self"] disallows cross-origin iframes. 13 FAIL Feature policy "microphone" can be enabled in cross-origin iframes using "allow" attribute. assert_equals: expected "#OK" but got "#NotAllowedError" 12 14 PASS Default "camera" feature policy ["self"] allows the top-level document. 13 15 PASS Default "camera" feature policy ["self"] allows same-origin iframes. 14 FAIL Default "camera" feature policy ["self"] disallows cross-origin iframes. assert_equals: expected "#[object NavigatorUserMediaError]" but got "#NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission." 15 FAIL Feature policy "camera" can be enabled in cross-origin iframes using "allow" attribute. undefined is not an object (evaluating 'frame.allow.concat')16 PASS Default "camera" feature policy ["self"] disallows cross-origin iframes. 17 FAIL Feature policy "camera" can be enabled in cross-origin iframes using "allow" attribute. assert_equals: expected "#OK" but got "#NotAllowedError" 16 18 PASS Default "camera; microphone" feature policy ["self"] allows the top-level document. 17 19 PASS Default "camera; microphone" feature policy ["self"] allows same-origin iframes. 18 FAIL Default "camera; microphone" feature policy ["self"] disallows cross-origin iframes. assert_equals: expected "#[object NavigatorUserMediaError]" but got "#NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission." 19 FAIL Feature policy "camera; microphone" can be enabled in cross-origin iframes using "allow" attribute. undefined is not an object (evaluating 'frame.allow.concat') 20 PASS Default "camera; microphone" feature policy ["self"] disallows cross-origin iframes. 21 PASS Feature policy "camera; microphone" can be enabled in cross-origin iframes using "allow" attribute. 20 22 -
trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaStream-default-feature-policy.https.html
r224156 r225963 38 38 cross_domain, 39 39 'microphone', 40 ' [object NavigatorUserMediaError]',40 'NotAllowedError', 41 41 function() { 42 42 return promise_factory('microphone'); … … 46 46 cross_domain, 47 47 'camera', 48 ' [object NavigatorUserMediaError]',48 'NotAllowedError', 49 49 function() { 50 50 return promise_factory('camera'); … … 54 54 cross_domain, 55 55 'camera; microphone', 56 ' [object NavigatorUserMediaError]',56 'NotAllowedError', 57 57 function() { 58 58 return promise_factory('camera; microphone'); -
trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaStreamTrack-init.https-expected.txt
r223189 r225963 6 6 7 7 8 PASS Tests that the video MediaStreamTrack objects are properly initialized 9 PASS EventTarget interface: existence and properties of interface object 10 PASS EventTarget interface object length 11 PASS EventTarget interface object name 12 PASS EventTarget interface: existence and properties of interface prototype object 13 PASS EventTarget interface: existence and properties of interface prototype object's "constructor" property 14 PASS EventTarget interface: operation addEventListener(DOMString, EventListener, boolean) 15 PASS EventTarget interface: operation removeEventListener(DOMString, EventListener, boolean) 16 PASS EventTarget interface: operation dispatchEvent(Event) 17 PASS MediaStreamTrack interface: existence and properties of interface object 18 PASS MediaStreamTrack interface object length 19 PASS MediaStreamTrack interface object name 20 PASS MediaStreamTrack interface: existence and properties of interface prototype object 21 PASS MediaStreamTrack interface: existence and properties of interface prototype object's "constructor" property 22 PASS MediaStreamTrack interface: attribute kind 23 PASS MediaStreamTrack interface: attribute id 24 PASS MediaStreamTrack interface: attribute label 25 PASS MediaStreamTrack interface: attribute enabled 26 PASS MediaStreamTrack interface: attribute muted 27 PASS MediaStreamTrack interface: attribute onmute 28 PASS MediaStreamTrack interface: attribute onunmute 29 PASS MediaStreamTrack interface: attribute readyState 30 PASS MediaStreamTrack interface: attribute onended 31 PASS MediaStreamTrack interface: attribute onoverconstrained 32 PASS MediaStreamTrack interface: operation clone() 33 PASS MediaStreamTrack interface: operation stop() 34 PASS MediaStreamTrack interface: operation getCapabilities() 35 PASS MediaStreamTrack interface: operation getConstraints() 36 PASS MediaStreamTrack interface: operation getSettings() 37 PASS MediaStreamTrack interface: operation applyConstraints(MediaTrackConstraints) 38 PASS MediaStreamTrack must be primary interface of track 39 PASS Stringification of track 40 PASS MediaStreamTrack interface: track must inherit property "kind" with the proper type 41 PASS MediaStreamTrack interface: track must inherit property "id" with the proper type 42 PASS MediaStreamTrack interface: track must inherit property "label" with the proper type 43 PASS MediaStreamTrack interface: track must inherit property "enabled" with the proper type 44 PASS MediaStreamTrack interface: track must inherit property "muted" with the proper type 45 FAIL MediaStreamTrack interface: track must inherit property "onmute" with the proper type Unrecognized type EventHandler 46 FAIL MediaStreamTrack interface: track must inherit property "onunmute" with the proper type Unrecognized type EventHandler 47 FAIL MediaStreamTrack interface: track must inherit property "readyState" with the proper type Unrecognized type MediaStreamTrackState 48 FAIL MediaStreamTrack interface: track must inherit property "onended" with the proper type Unrecognized type EventHandler 49 FAIL MediaStreamTrack interface: track must inherit property "onoverconstrained" with the proper type Unrecognized type EventHandler 50 PASS MediaStreamTrack interface: track must inherit property "clone()" with the proper type 51 PASS MediaStreamTrack interface: track must inherit property "stop()" with the proper type 52 PASS MediaStreamTrack interface: track must inherit property "getCapabilities()" with the proper type 53 PASS MediaStreamTrack interface: track must inherit property "getConstraints()" with the proper type 54 PASS MediaStreamTrack interface: track must inherit property "getSettings()" with the proper type 55 PASS MediaStreamTrack interface: track must inherit property "applyConstraints(MediaTrackConstraints)" with the proper type 56 PASS MediaStreamTrack interface: calling applyConstraints(MediaTrackConstraints) on track with too few arguments must throw TypeError 57 PASS EventTarget interface: track must inherit property "addEventListener(DOMString, EventListener, boolean)" with the proper type 58 PASS EventTarget interface: calling addEventListener(DOMString, EventListener, boolean) on track with too few arguments must throw TypeError 59 PASS EventTarget interface: track must inherit property "removeEventListener(DOMString, EventListener, boolean)" with the proper type 60 PASS EventTarget interface: calling removeEventListener(DOMString, EventListener, boolean) on track with too few arguments must throw TypeError 61 PASS EventTarget interface: track must inherit property "dispatchEvent(Event)" with the proper type 62 PASS EventTarget interface: calling dispatchEvent(Event) on track with too few arguments must throw TypeError 8 PASS getUserMedia({video:true}) creates a stream with a properly initialized video track 63 9 -
trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaStreamTrack-init.https.html
r223189 r225963 19 19 <script src=/resources/testharness.js></script> 20 20 <script src=/resources/testharnessreport.js></script> 21 <script src=/resources/WebIDLParser.js></script>22 <script src=/resources/idlharness.js></script>23 21 <script> 24 var t = async_test("Tests that the video MediaStreamTrack objects are properly initialized", {timeout:10000}); 25 var track = null 26 var idl_array = new IdlArray(); 27 28 idl_array.add_idls("interface EventTarget {\ 29 void addEventListener(DOMString type, EventListener? callback, optional boolean capture = false);\ 30 void removeEventListener(DOMString type, EventListener? callback, optional boolean capture = false);\ 31 boolean dispatchEvent(Event event);\ 32 };"); 33 34 idl_array.add_idls("interface MediaStreamTrack : EventTarget {\ 35 readonly attribute DOMString kind;\ 36 readonly attribute DOMString id;\ 37 readonly attribute DOMString label;\ 38 attribute boolean enabled;\ 39 readonly attribute boolean muted;\ 40 attribute EventHandler onmute;\ 41 attribute EventHandler onunmute;\ 42 readonly attribute MediaStreamTrackState readyState;\ 43 attribute EventHandler onended;\ 44 attribute EventHandler onoverconstrained;\ 45 MediaStreamTrack clone ();\ 46 void stop ();\ 47 MediaTrackCapabilities getCapabilities ();\ 48 MediaTrackConstraints getConstraints ();\ 49 MediaTrackSettings getSettings ();\ 50 Promise<void> applyConstraints (optional MediaTrackConstraints constraints);\ 51 };"); 52 53 t.step(function () { 54 navigator.mediaDevices.getUserMedia({video: true}) 55 .then(t.step_func(function (stream) { 22 promise_test(() => { 23 return navigator.mediaDevices.getUserMedia({video: true}) 24 .then(stream => { 56 25 var videoTracks = stream.getVideoTracks(); 57 26 assert_equals(videoTracks.length, 1, "There is exactly one video track in the media stream"); 58 27 track = videoTracks[0]; 59 idl_array.add_objects({MediaStreamTrack: ["track"]});60 idl_array.test();61 28 assert_equals(track.readyState, "live", "The track object is in live state"); 62 29 assert_equals(track.kind, "video", "The track object is of video kind"); … … 64 31 // see https://www.w3.org/Bugs/Public/show_bug.cgi?id=22212 65 32 assert_true(track.enabled, "The track object is enabed"); 66 t.done(); 67 })); 33 }); 68 34 }); 69 35 </script> -
trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/OWNERS
r224156 r225963 2 2 @alvestrand 3 3 @dontcallmedom 4 @eric-carlson 4 5 @youennf -
trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/w3c-import.log
r224156 r225963 42 42 /LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaStreamTrack-getSettings.https.html 43 43 /LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaStreamTrack-id.https.html 44 /LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaStreamTrack-idl.https.html 44 45 /LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaStreamTrack-init.https.html 45 46 /LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaStreamTrackEvent-constructor.https.html -
trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/XMLHttpRequest/xmlhttprequest-sync-default-feature-policy.sub-expected.txt
r224156 r225963 1 Blocked access to external URL http://www.localhost:8800/XMLHttpRequest/xmlhttprequest-sync-default-feature-policy.sub.html#iframe%23sync-xhr 1 2 Blocked access to external URL http://www.localhost:8800/XMLHttpRequest/xmlhttprequest-sync-default-feature-policy.sub.html#iframe%23sync-xhr 2 3 … … 7 8 PASS Default "sync-xhr" feature policy ["*"] allows same-origin iframes. 8 9 TIMEOUT Default "sync-xhr" feature policy ["*"] allows cross-origin iframes. Test timed out 9 FAIL Feature policy "sync-xhr" can be disabled in cross-origin iframes using "allow" attribute. undefined is not an object (evaluating 'frame.allow.concat') 10 TIMEOUT Feature policy "sync-xhr" can be disabled in cross-origin iframes using "allow" attribute. Test timed out 10 11 -
trunk/LayoutTests/platform/wpe/TestExpectations
r225899 r225963 425 425 Bug(WPE) fast/mediacapturefromelement [ Skip ] 426 426 Bug(WPE) fast/mediastream [ Skip ] 427 imported/w3c/web-platform-tests/mediacapture-streams [ Skip ] 427 428 Bug(WPE) fast/multicol [ Skip ] 428 429 Bug(WPE) fast/overflow [ Skip ] -
trunk/Source/WebCore/ChangeLog
r225960 r225963 1 2017-12-14 Youenn Fablet <youenn@apple.com> 2 3 Implement <iframe allow="camera; microphone"> 4 https://bugs.webkit.org/show_bug.cgi?id=167430 5 6 Reviewed by Eric Carlson. 7 8 Tests: imported/w3c/web-platform-tests/mediacapture-streams/MediaStream-default-feature-policy.https.sub.html 9 10 Adding allow attribute to HTMLIFrameElement as per https://wicg.github.io/feature-policy/#iframe-allow-attribute. 11 Cross-origin iframes will get access to camera/microphone based on this attribute value. 12 Same-origin iframes do not need any attribute. 13 In case getUserMedia requests both camera and microphone, and allow attribute is only one of these, 14 getUserMedia access is denied. This goes against the tests but is not very clear from the specification. 15 16 * Modules/mediastream/UserMediaRequest.cpp: 17 (WebCore::isSecure): 18 (WebCore::isAllowedToUse): 19 (WebCore::canCallGetUserMedia): 20 (WebCore::UserMediaRequest::start): 21 * html/HTMLAttributeNames.in: 22 * html/HTMLIFrameElement.cpp: 23 (WebCore::HTMLIFrameElement::parseAttribute): 24 * html/HTMLIFrameElement.h: 25 * html/HTMLIFrameElement.idl: 26 1 27 2017-12-14 Zalan Bujtas <zalan@apple.com> 2 28 -
trunk/Source/WebCore/Modules/mediastream/UserMediaRequest.cpp
r225828 r225963 41 41 #include "Document.h" 42 42 #include "DocumentLoader.h" 43 #include "HTMLIFrameElement.h" 44 #include "HTMLParserIdioms.h" 43 45 #include "JSMediaStream.h" 44 46 #include "JSOverconstrainedError.h" … … 96 98 { 97 99 auto& response = documentLoader.response(); 100 if (SecurityOrigin::isLocalHostOrLoopbackIPAddress(documentLoader.response().url())) 101 return true; 98 102 return SchemeRegistry::shouldTreatURLSchemeAsSecure(response.url().protocol().toStringWithoutCopying()) 99 103 && response.certificateInfo() … … 101 105 } 102 106 103 static bool canCallGetUserMedia(Document& document, String& errorMessage) 107 static bool isAllowedToUse(Document& document, Document& topDocument, bool requiresAudio, bool requiresVideo) 108 { 109 if (&document == &topDocument) 110 return true; 111 112 auto* parentDocument = document.parentDocument(); 113 if (!parentDocument) 114 return false; 115 116 if (document.securityOrigin().isSameSchemeHostPort(parentDocument->securityOrigin())) 117 return true; 118 119 auto* element = document.ownerElement(); 120 ASSERT(element); 121 if (!element) 122 return false; 123 124 if (!is<HTMLIFrameElement>(*element)) 125 return false; 126 auto& allow = downcast<HTMLIFrameElement>(*element).allow(); 127 128 bool allowCameraAccess = false; 129 bool allowMicrophoneAccess = false; 130 for (auto allowItem : StringView { allow }.split(';')) { 131 auto item = allowItem.stripLeadingAndTrailingMatchedCharacters(isHTMLSpace<UChar>); 132 if (!allowCameraAccess && item == "camera") 133 allowCameraAccess = true; 134 else if (!allowMicrophoneAccess && item == "microphone") 135 allowMicrophoneAccess = true; 136 } 137 return (allowCameraAccess || !requiresVideo) && (allowMicrophoneAccess || !requiresAudio); 138 } 139 140 static bool canCallGetUserMedia(Document& document, bool wantsAudio, bool wantsVideo, String& errorMessage) 104 141 { 105 142 bool requiresSecureConnection = DeprecatedGlobalSettings::mediaCaptureRequiresSecureConnection(); 106 143 auto& documentLoader = *document.loader(); 107 if (requiresSecureConnection && !isSecure(documentLoader) && !SecurityOrigin::isLocalHostOrLoopbackIPAddress(documentLoader.response().url())) {144 if (requiresSecureConnection && !isSecure(documentLoader)) { 108 145 errorMessage = "Trying to call getUserMedia from an insecure document."; 109 146 return false; … … 112 149 auto& topDocument = document.topDocument(); 113 150 if (&document != &topDocument) { 114 auto& topOrigin = topDocument.topOrigin(); 115 116 if (!document.securityOrigin().isSameSchemeHostPort(topOrigin)) { 117 errorMessage = "Trying to call getUserMedia from a document with a different security origin than its top-level frame."; 118 return false; 119 } 120 121 for (auto* ancestorDocument = document.parentDocument(); ancestorDocument != &topDocument; ancestorDocument = ancestorDocument->parentDocument()) { 151 for (auto* ancestorDocument = &document; ancestorDocument != &topDocument; ancestorDocument = ancestorDocument->parentDocument()) { 122 152 if (requiresSecureConnection && !isSecure(*ancestorDocument->loader())) { 123 153 errorMessage = "Trying to call getUserMedia from a document with an insecure parent frame."; … … 125 155 } 126 156 127 if (! ancestorDocument->securityOrigin().isSameSchemeHostPort(topOrigin)) {128 errorMessage = "T rying to call getUserMedia from a document with a different security origin than its top-level frame.";157 if (!isAllowedToUse(*ancestorDocument, topDocument, wantsAudio, wantsVideo)) { 158 errorMessage = "The top-level frame has prevented a document with a different security origin to call getUserMedia."; 129 159 return false; 130 160 } … … 147 177 // or due to platform limitations, jump to the step labeled Permission Failure below. 148 178 String errorMessage; 149 if (!canCallGetUserMedia(document, errorMessage)) {179 if (!canCallGetUserMedia(document, m_audioConstraints.isValid, m_videoConstraints.isValid, errorMessage)) { 150 180 deny(MediaAccessDenialReason::PermissionDenied, emptyString()); 151 181 document.domWindow()->printErrorMessage(errorMessage); -
trunk/Source/WebCore/html/HTMLAttributeNames.in
r225616 r225963 11 11 align 12 12 alink 13 allow 13 14 allowfullscreen 14 15 alt -
trunk/Source/WebCore/html/HTMLIFrameElement.cpp
r222613 r225963 94 94 if (!invalidTokens.isNull()) 95 95 document().addConsoleMessage(MessageSource::Other, MessageLevel::Error, "Error while parsing the 'sandbox' attribute: " + invalidTokens); 96 } else 96 } else if (name == allowAttr) 97 m_allow = value; 98 else 97 99 HTMLFrameElementBase::parseAttribute(name, value); 98 100 } -
trunk/Source/WebCore/html/HTMLIFrameElement.h
r205249 r225963 38 38 39 39 RenderIFrame* renderer() const; 40 const String& allow() const { return m_allow; } 40 41 41 42 private: … … 54 55 55 56 std::unique_ptr<DOMTokenList> m_sandbox; 57 String m_allow; 56 58 }; 57 59 -
trunk/Source/WebCore/html/HTMLIFrameElement.idl
r215330 r225963 30 30 [PutForwards=value] readonly attribute DOMTokenList sandbox; 31 31 [Reflect] attribute boolean allowFullscreen; 32 [CEReactions, Reflect] attribute DOMString allow; 32 33 33 34 [Reflect] attribute DOMString scrolling;
Note: See TracChangeset
for help on using the changeset viewer.