[WebAuthN] A focused document should be required
authorjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 May 2019 23:41:36 +0000 (23:41 +0000)
committerjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 May 2019 23:41:36 +0000 (23:41 +0000)
commitaba04743fb589216c4141146b3c65754f0442827
tree20ba703d02b2bba8e277ef4c33621ebedf220992
parentcbcd04c92ee5eda00cded4bb119de16a470f7eed
[WebAuthN] A focused document should be required
https://bugs.webkit.org/show_bug.cgi?id=197543
<rdar://problem/50430989>

Reviewed by Brent Fulgham.

Source/WebCore:

This patch adds a check to see if the invoking document is focused before
calling into WebAuthN. This patch also removes some out-to-dated comments.

Test: http/wpt/webauthn/public-key-credential-unfocused-document.https.html

* Modules/credentialmanagement/CredentialsContainer.cpp:
(WebCore::CredentialsContainer::get):
(WebCore::CredentialsContainer::isCreate):
* Modules/webauthn/AuthenticatorCoordinator.cpp:
(WebCore::AuthenticatorCoordinator::create const):
(WebCore::AuthenticatorCoordinator::discoverFromExternalSource const):

LayoutTests:

* http/wpt/webauthn/public-key-credential-same-origin-with-ancestors.https.html:
* http/wpt/webauthn/public-key-credential-unfocused-document.https-expected.txt: Added.
* http/wpt/webauthn/public-key-credential-unfocused-document.https.html: Copied from LayoutTests/http/wpt/webauthn/public-key-credential-same-origin-with-ancestors.https.html.
* http/wpt/webauthn/resources/last-layer-frame.https.html:
* http/wpt/webauthn/resources/second-layer-frame.https.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244938 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/wpt/webauthn/public-key-credential-same-origin-with-ancestors.https.html
LayoutTests/http/wpt/webauthn/public-key-credential-unfocused-document.https-expected.txt [new file with mode: 0644]
LayoutTests/http/wpt/webauthn/public-key-credential-unfocused-document.https.html [new file with mode: 0644]
LayoutTests/http/wpt/webauthn/resources/last-layer-frame.https.html
LayoutTests/http/wpt/webauthn/resources/second-layer-frame.https.html
Source/WebCore/ChangeLog
Source/WebCore/Modules/credentialmanagement/CredentialsContainer.cpp
Source/WebCore/Modules/webauthn/AuthenticatorCoordinator.cpp