Implement <iframe allow="camera; microphone">
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Dec 2017 05:32:53 +0000 (05:32 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Dec 2017 05:32:53 +0000 (05:32 +0000)
commitf425a4ae2c592b3ff9a4d6fa0fc442687b31f870
tree5cd231ebdb23880706bebc1034b731107cb98cbf
parent4b6355b1eae4324d62e7ceab571902ad64656815
Implement <iframe allow="camera; microphone">
https://bugs.webkit.org/show_bug.cgi?id=167430
LayoutTests/imported/w3c:

Patch by Youenn Fablet <youenn@apple.com> on 2017-12-14
Reviewed by Eric Carlson.

* resources/import-expectations.json:
* web-platform-tests/feature-policy/resources/: Added as this is used for some mediacapture-streams tests.
* web-platform-tests/mediacapture-streams/: Added.

Source/WebCore:

Patch by Youenn Fablet <youenn@apple.com> on 2017-12-14
Reviewed by Eric Carlson.

Tests: imported/w3c/web-platform-tests/mediacapture-streams/MediaStream-default-feature-policy.https.sub.html

Adding allow attribute to HTMLIFrameElement as per https://wicg.github.io/feature-policy/#iframe-allow-attribute.
Cross-origin iframes will get access to camera/microphone based on this attribute value.
Same-origin iframes do not need any attribute.
In case getUserMedia requests both camera and microphone, and allow attribute is only one of these,
getUserMedia access is denied. This goes against the tests but is not very clear from the specification.

* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::isSecure):
(WebCore::isAllowedToUse):
(WebCore::canCallGetUserMedia):
(WebCore::UserMediaRequest::start):
* html/HTMLAttributeNames.in:
* html/HTMLIFrameElement.cpp:
(WebCore::HTMLIFrameElement::parseAttribute):
* html/HTMLIFrameElement.h:
* html/HTMLIFrameElement.idl:

LayoutTests:

<rdar://problem/34887226>

Patch by Youenn Fablet <youenn@apple.com> on 2017-12-14
Reviewed by Eric Carlson.

Skipping mediastream tests for wpe.
Updating expectations based on new error message.

* TestExpectations: Skipping sync XHR test using allow attribute.
* http/tests/ssl/media-stream/get-user-media-different-host-expected.txt:
* http/tests/ssl/media-stream/get-user-media-nested-expected.txt:
* platform/mac-wk1/imported/w3c/web-platform-tests/XMLHttpRequest/xmlhttprequest-sync-default-feature-policy.sub-expected.txt:
* platform/wpe/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225963 268f45cc-cd09-0410-ab3c-d52691b4dbfc
23 files changed:
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/http/tests/ssl/media-stream/get-user-media-different-host-expected.txt
LayoutTests/http/tests/ssl/media-stream/get-user-media-nested-expected.txt
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/resources/import-expectations.json
LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/xmlhttprequest-sync-default-feature-policy.sub-expected.txt
LayoutTests/imported/w3c/web-platform-tests/feature-policy/resources/featurepolicy.js
LayoutTests/imported/w3c/web-platform-tests/feature-policy/resources/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaStream-default-feature-policy.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaStream-default-feature-policy.https.html
LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaStreamTrack-init.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaStreamTrack-init.https.html
LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/OWNERS
LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/w3c-import.log
LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/XMLHttpRequest/xmlhttprequest-sync-default-feature-policy.sub-expected.txt
LayoutTests/platform/wpe/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/UserMediaRequest.cpp
Source/WebCore/html/HTMLAttributeNames.in
Source/WebCore/html/HTMLIFrameElement.cpp
Source/WebCore/html/HTMLIFrameElement.h
Source/WebCore/html/HTMLIFrameElement.idl