Restrict DeviceMotion / DeviceOrientation APIs to secure contexts
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Dec 2018 21:49:51 +0000 (21:49 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Dec 2018 21:49:51 +0000 (21:49 +0000)
commit575247d1af6e19d31a9749be9c393c8799012c4a
treebe4cbd91b118fe7224dd7eb1dab27d705dab60e0
parentfce6d42f1960d186006681a2f78ad9ea3e910e24
Restrict DeviceMotion / DeviceOrientation APIs to secure contexts
https://bugs.webkit.org/show_bug.cgi?id=192595
<rdar://problem/46382603>

Reviewed by Dean Jackson.

Source/WebCore:

Tests: http/tests/events/device-orientation-motion-non-secure-context.html
       http/tests/events/device-orientation-motion-secure-context.html

* page/DOMWindow.cpp:
(WebCore::DOMWindow::addEventListener):
* page/SecurityOrigin.h:
(WebCore::SecurityOrigin::setIsPotentiallyTrustworthy):
* testing/Internals.cpp:
(WebCore::Internals::markContextAsInsecure):
(WebCore::Internals::postTask):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

Add layout test coverage. Note however that we currently do not have mock data providers
for these APIs.

* http/tests/events/device-orientation-motion-non-secure-context-expected.txt: Added.
* http/tests/events/device-orientation-motion-non-secure-context.html: Added.
* http/tests/events/device-orientation-motion-secure-context-expected.txt: Added.
* http/tests/events/device-orientation-motion-secure-context.html: Added.
* platform/ios/http/tests/events/device-orientation-motion-non-secure-context-expected.txt: Added.
* platform/ios/http/tests/events/device-orientation-motion-secure-context-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239087 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/events/device-orientation-motion-non-secure-context-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/events/device-orientation-motion-non-secure-context.html [new file with mode: 0644]
LayoutTests/http/tests/events/device-orientation-motion-secure-context-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/events/device-orientation-motion-secure-context.html [new file with mode: 0644]
LayoutTests/platform/ios/http/tests/events/device-orientation-motion-non-secure-context-expected.txt [new file with mode: 0644]
LayoutTests/platform/ios/http/tests/events/device-orientation-motion-secure-context-expected.txt [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/page/SecurityOrigin.h
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl