Implement Feature policy self/none/* parsing
authoryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 May 2019 17:38:42 +0000 (17:38 +0000)
committeryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 May 2019 17:38:42 +0000 (17:38 +0000)
commite653befee12e83367a223c4e60b4240fb08747b5
tree7dc926131a92a3354c7af09ebd00bcf106153c4d
parent229ba77ce41e09c627ffdbd8bc8448e2a575e9e1
Implement Feature policy self/none/* parsing
https://bugs.webkit.org/show_bug.cgi?id=198078

Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

* web-platform-tests/mediacapture-streams/MediaStream-feature-policy-none.https-expected.txt: Added.
* web-platform-tests/mediacapture-streams/MediaStream-feature-policy-none.https.html: Added.

Source/WebCore:

Start to implement https://w3c.github.io/webappsec-feature-policy/#algo-parse-policy-directive
'src' is not supported yet.
Apply the rules to getUserMedia.
Update getDisplayMedia keyword from 'display' to 'display-capture' as per spec.

Test: imported/w3c/web-platform-tests/mediacapture-streams/MediaStream-feature-policy-none.https.html

* Headers.cmake:
* Modules/mediastream/UserMediaController.cpp:
(WebCore::isSecure):
(WebCore::isAllowedByFeaturePolicy):
(WebCore::isAllowedToUse):
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* html/FeaturePolicy.cpp: Added.
(WebCore::isAllowedByFeaturePolicy):
(WebCore::processOriginItem):
(WebCore::updateList):
(WebCore::FeaturePolicy::parse):
(WebCore::FeaturePolicy::allows const):
* html/FeaturePolicy.h: Added.
* html/HTMLIFrameElement.cpp:
(WebCore::HTMLIFrameElement::featurePolicy const):
* html/HTMLIFrameElement.h:

Source/WebKit:

Fix a case where completion handler might not always be called.

* WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
(WebKit::UserMediaPermissionRequestManager::userMediaAccessWasGranted):

LayoutTests:

* http/tests/media/media-stream/get-display-media-iframe-allow-attribute-expected.txt:
* http/tests/media/media-stream/get-display-media-iframe-allow-attribute.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245625 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/media/media-stream/get-display-media-iframe-allow-attribute-expected.txt
LayoutTests/http/tests/media/media-stream/get-display-media-iframe-allow-attribute.html
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaStream-feature-policy-none.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaStream-feature-policy-none.https.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Headers.cmake
Source/WebCore/Modules/mediastream/UserMediaController.cpp
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/html/FeaturePolicy.cpp [new file with mode: 0644]
Source/WebCore/html/FeaturePolicy.h [new file with mode: 0644]
Source/WebCore/html/HTMLIFrameElement.cpp
Source/WebCore/html/HTMLIFrameElement.h
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp