Changeset 269851 in webkit
- Timestamp:
- Nov 16, 2020 6:05:59 AM (3 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r269850 r269851 1 2020-11-16 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 WebDriver: do not focus the main frame when switching to a window 4 https://bugs.webkit.org/show_bug.cgi?id=218383 5 6 Reviewed by Brian Burg. 7 8 The spec doesn't say we should focus the main frame. This is confusing WPT test 9 infrastructure/testdriver/actions/crossOrigin.sub.html that first focuses an input in an iframe and then it send 10 keyboard events to the window (after switching to the window again even when it's already the current one, that 11 causes the iframe focus to be lost). 12 13 * UIProcess/Automation/WebAutomationSession.cpp: 14 (WebKit::WebAutomationSession::switchToBrowsingContext): 15 * WebProcess/Automation/WebAutomationSessionProxy.cpp: 16 * WebProcess/Automation/WebAutomationSessionProxy.h: 17 * WebProcess/Automation/WebAutomationSessionProxy.messages.in: 18 1 19 2020-11-16 Kimmo Kinnunen <kkinnunen@apple.com> 2 20 -
trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp
r269421 r269851 376 376 m_client->requestSwitchToPage(*this, *page, [frameID, page = makeRef(*page), callback = WTFMove(callback)]() { 377 377 page->setFocus(true); 378 page->process().send(Messages::WebAutomationSessionProxy::FocusFrame(page->webPageID(), frameID), 0);379 378 380 379 callback->sendSuccess(); -
trunk/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp
r268383 r269851 565 565 } 566 566 567 void WebAutomationSessionProxy::focusFrame(WebCore::PageIdentifier pageID, Optional<WebCore::FrameIdentifier> frameID)568 {569 WebPage* page = WebProcess::singleton().webPage(pageID);570 if (!page)571 return;572 573 auto* frame = frameID ? WebProcess::singleton().webFrame(*frameID) : &page->mainWebFrame();574 if (!frame)575 return;576 577 WebCore::Frame* coreFrame = frame->coreFrame();578 if (!coreFrame)579 return;580 581 WebCore::Document* coreDocument = coreFrame->document();582 if (!coreDocument)583 return;584 585 WebCore::DOMWindow* coreDOMWindow = coreDocument->domWindow();586 if (!coreDOMWindow)587 return;588 589 coreDOMWindow->focus(true);590 }591 592 567 static WebCore::Element* containerElementForElement(WebCore::Element& element) 593 568 { -
trunk/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.h
r260653 r269851 76 76 void resolveChildFrameWithName(WebCore::PageIdentifier, Optional<WebCore::FrameIdentifier>, const String& name, CompletionHandler<void(Optional<String>, Optional<WebCore::FrameIdentifier>)>&&); 77 77 void resolveParentFrame(WebCore::PageIdentifier, Optional<WebCore::FrameIdentifier>, CompletionHandler<void(Optional<String>, Optional<WebCore::FrameIdentifier>)>&&); 78 void focusFrame(WebCore::PageIdentifier, Optional<WebCore::FrameIdentifier>);79 78 void computeElementLayout(WebCore::PageIdentifier, Optional<WebCore::FrameIdentifier>, String nodeHandle, bool scrollIntoViewIfNeeded, CoordinateSystem, CompletionHandler<void(Optional<String>, WebCore::IntRect, Optional<WebCore::IntPoint>, bool)>&&); 80 79 void selectOptionElement(WebCore::PageIdentifier, Optional<WebCore::FrameIdentifier>, String nodeHandle, CompletionHandler<void(Optional<String>)>&&); -
trunk/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.messages.in
r255343 r269851 29 29 ResolveParentFrame(WebCore::PageIdentifier pageID, Optional<WebCore::FrameIdentifier> frameID) -> (Optional<String> errorType, Optional<WebCore::FrameIdentifier> frameID) Async 30 30 31 FocusFrame(WebCore::PageIdentifier pageID, Optional<WebCore::FrameIdentifier> frameID)32 33 31 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 34 32
Note: See TracChangeset
for help on using the changeset viewer.