- Revision
- 269851
- Author
- [email protected]
- Date
- 2020-11-16 06:05:59 -0800 (Mon, 16 Nov 2020)
Log Message
WebDriver: do not focus the main frame when switching to a window
https://bugs.webkit.org/show_bug.cgi?id=218383
Patch by Carlos Garcia Campos <[email protected]> on 2020-11-16
Reviewed by Brian Burg.
The spec doesn't say we should focus the main frame. This is confusing WPT test
infrastructure/testdriver/actions/crossOrigin.sub.html that first focuses an input in an iframe and then it send
keyboard events to the window (after switching to the window again even when it's already the current one, that
causes the iframe focus to be lost).
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::switchToBrowsingContext):
* WebProcess/Automation/WebAutomationSessionProxy.cpp:
* WebProcess/Automation/WebAutomationSessionProxy.h:
* WebProcess/Automation/WebAutomationSessionProxy.messages.in:
Modified Paths
Diff
Modified: trunk/Source/WebKit/ChangeLog (269850 => 269851)
--- trunk/Source/WebKit/ChangeLog 2020-11-16 12:57:13 UTC (rev 269850)
+++ trunk/Source/WebKit/ChangeLog 2020-11-16 14:05:59 UTC (rev 269851)
@@ -1,3 +1,21 @@
+2020-11-16 Carlos Garcia Campos <[email protected]>
+
+ WebDriver: do not focus the main frame when switching to a window
+ https://bugs.webkit.org/show_bug.cgi?id=218383
+
+ Reviewed by Brian Burg.
+
+ The spec doesn't say we should focus the main frame. This is confusing WPT test
+ infrastructure/testdriver/actions/crossOrigin.sub.html that first focuses an input in an iframe and then it send
+ keyboard events to the window (after switching to the window again even when it's already the current one, that
+ causes the iframe focus to be lost).
+
+ * UIProcess/Automation/WebAutomationSession.cpp:
+ (WebKit::WebAutomationSession::switchToBrowsingContext):
+ * WebProcess/Automation/WebAutomationSessionProxy.cpp:
+ * WebProcess/Automation/WebAutomationSessionProxy.h:
+ * WebProcess/Automation/WebAutomationSessionProxy.messages.in:
+
2020-11-16 Kimmo Kinnunen <[email protected]>
Final refactor for WebGL implementation to use only GraphicsContextGL
Modified: trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp (269850 => 269851)
--- trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp 2020-11-16 12:57:13 UTC (rev 269850)
+++ trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp 2020-11-16 14:05:59 UTC (rev 269851)
@@ -375,7 +375,6 @@
m_client->requestSwitchToPage(*this, *page, [frameID, page = makeRef(*page), callback = WTFMove(callback)]() {
page->setFocus(true);
- page->process().send(Messages::WebAutomationSessionProxy::FocusFrame(page->webPageID(), frameID), 0);
callback->sendSuccess();
});
Modified: trunk/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp (269850 => 269851)
--- trunk/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp 2020-11-16 12:57:13 UTC (rev 269850)
+++ trunk/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp 2020-11-16 14:05:59 UTC (rev 269851)
@@ -564,31 +564,6 @@
completionHandler(WTF::nullopt, parentFrame->frameID());
}
-void WebAutomationSessionProxy::focusFrame(WebCore::PageIdentifier pageID, Optional<WebCore::FrameIdentifier> frameID)
-{
- WebPage* page = WebProcess::singleton().webPage(pageID);
- if (!page)
- return;
-
- auto* frame = frameID ? WebProcess::singleton().webFrame(*frameID) : &page->mainWebFrame();
- if (!frame)
- return;
-
- WebCore::Frame* coreFrame = frame->coreFrame();
- if (!coreFrame)
- return;
-
- WebCore::Document* coreDocument = coreFrame->document();
- if (!coreDocument)
- return;
-
- WebCore::DOMWindow* coreDOMWindow = coreDocument->domWindow();
- if (!coreDOMWindow)
- return;
-
- coreDOMWindow->focus(true);
-}
-
static WebCore::Element* containerElementForElement(WebCore::Element& element)
{
// ยง13. Element State.
Modified: trunk/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.h (269850 => 269851)
--- trunk/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.h 2020-11-16 12:57:13 UTC (rev 269850)
+++ trunk/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.h 2020-11-16 14:05:59 UTC (rev 269851)
@@ -75,7 +75,6 @@
void resolveChildFrameWithNodeHandle(WebCore::PageIdentifier, Optional<WebCore::FrameIdentifier>, const String& nodeHandle, CompletionHandler<void(Optional<String>, Optional<WebCore::FrameIdentifier>)>&&);
void resolveChildFrameWithName(WebCore::PageIdentifier, Optional<WebCore::FrameIdentifier>, const String& name, CompletionHandler<void(Optional<String>, Optional<WebCore::FrameIdentifier>)>&&);
void resolveParentFrame(WebCore::PageIdentifier, Optional<WebCore::FrameIdentifier>, CompletionHandler<void(Optional<String>, Optional<WebCore::FrameIdentifier>)>&&);
- void focusFrame(WebCore::PageIdentifier, Optional<WebCore::FrameIdentifier>);
void computeElementLayout(WebCore::PageIdentifier, Optional<WebCore::FrameIdentifier>, String nodeHandle, bool scrollIntoViewIfNeeded, CoordinateSystem, CompletionHandler<void(Optional<String>, WebCore::IntRect, Optional<WebCore::IntPoint>, bool)>&&);
void selectOptionElement(WebCore::PageIdentifier, Optional<WebCore::FrameIdentifier>, String nodeHandle, CompletionHandler<void(Optional<String>)>&&);
void setFilesForInputFileUpload(WebCore::PageIdentifier, Optional<WebCore::FrameIdentifier>, String nodeHandle, Vector<String>&& filenames, CompletionHandler<void(Optional<String>)>&&);
Modified: trunk/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.messages.in (269850 => 269851)
--- trunk/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.messages.in 2020-11-16 12:57:13 UTC (rev 269850)
+++ trunk/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.messages.in 2020-11-16 14:05:59 UTC (rev 269851)
@@ -28,8 +28,6 @@
ResolveChildFrameWithName(WebCore::PageIdentifier pageID, Optional<WebCore::FrameIdentifier> frameID, String name) -> (Optional<String> errorType, Optional<WebCore::FrameIdentifier> frameID) Async
ResolveParentFrame(WebCore::PageIdentifier pageID, Optional<WebCore::FrameIdentifier> frameID) -> (Optional<String> errorType, Optional<WebCore::FrameIdentifier> frameID) Async
- FocusFrame(WebCore::PageIdentifier pageID, Optional<WebCore::FrameIdentifier> frameID)
-
ComputeElementLayout(WebCore::PageIdentifier pageID, Optional<WebCore::FrameIdentifier> frameID, String nodeHandle, bool scrollIntoViewIfNeeded, enum:uint8_t WebKit::CoordinateSystem coordinateSystem) -> (Optional<String> errorType, WebCore::IntRect rect, Optional<WebCore::IntPoint> inViewCenterPoint, bool isObscured) Async
SelectOptionElement(WebCore::PageIdentifier pageID, Optional<WebCore::FrameIdentifier> frameID, String nodeHandle) -> (Optional<String> errorType) Async