https://bugs.webkit.org/show_bug.cgi?id=229139
Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2021-08-19
Reviewed by Adrian Perez de Castro.
Source/WebCore:
We are always claiming to be focused when the document in the active window even if the page is not actually
focused.
* dom/Document.cpp:
(WebCore::Document::hasFocus const): Check also that page is focused.
Tools:
Add a unit tests to check document.hasFocus() returns false when a web view is in the active window, but not focused.
* TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm:
(TestWebKitAPI::TEST): Ensure web view is focused as required by credentials container.
* TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebView.cpp:
(testWebViewDocumentFocus):
(beforeAll):
* TestWebKitAPI/cocoa/TestWKWebView.h:
* TestWebKitAPI/cocoa/TestWKWebView.mm:
(-[TestWKWebView focus]):
Canonical link: https://commits.webkit.org/240665@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281228 268f45cc-cd09-0410-ab3c-d52691b4dbfc