⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 203316 in webkit


Ignore:
Timestamp:
Jul 15, 2016, 6:19:21 PM (10 years ago)
Author:
timothy@apple.com
Message:

Web Automation: Fix element and event coord space issues
https://bugs.webkit.org/show_bug.cgi?id=159851
rdar://problem/27375780

Reviewed by Brian Burg.

  • UIProcess/Automation/WebAutomationSession.cpp:

(WebKit::WebAutomationSession::performMouseInteraction): Subtract topContentInset() before
it goes back out to WebDriver.

  • WebProcess/Automation/WebAutomationSessionProxy.cpp:

(WebKit::WebAutomationSessionProxy::computeElementLayout): When using useViewportCoordinates,
subtract topContentInset() so it matches expectations.

Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r203312 r203316  
     12016-07-15  Timothy Hatcher  <timothy@apple.com>
     2
     3        Web Automation: Fix element and event coord space issues
     4        https://bugs.webkit.org/show_bug.cgi?id=159851
     5        rdar://problem/27375780
     6
     7        Reviewed by Brian Burg.
     8
     9        * UIProcess/Automation/WebAutomationSession.cpp:
     10        (WebKit::WebAutomationSession::performMouseInteraction): Subtract topContentInset() before
     11        it goes back out to WebDriver.
     12        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
     13        (WebKit::WebAutomationSessionProxy::computeElementLayout): When using useViewportCoordinates,
     14        subtract topContentInset() so it matches expectations.
     15
    1162016-07-15  Beth Dakin  <bdakin@apple.com>
    217
  • trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp

    r203245 r203316  
    919919    updatedPositionObject = Inspector::Protocol::Automation::Point::create()
    920920        .setX(x)
    921         .setY(y)
     921        .setY(y - page->topContentInset())
    922922        .release();
    923923#endif // USE(APPKIT)
  • trunk/Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.cpp

    r203245 r203316  
    488488    WebCore::IntRect rect = coreElement->clientRect();
    489489
    490     if (!useViewportCoordinates) {
    491         WebCore::Frame* coreFrame = frame->coreFrame();
    492         if (!coreFrame) {
    493             WebProcess::singleton().parentProcessConnection()->send(Messages::WebAutomationSession::DidComputeElementLayout(callbackID, WebCore::IntRect(), frameNotFoundErrorType), 0);
    494             return;
    495         }
    496 
    497         WebCore::FrameView *coreFrameView = coreFrame->view();
    498         if (!coreFrameView) {
    499             WebProcess::singleton().parentProcessConnection()->send(Messages::WebAutomationSession::DidComputeElementLayout(callbackID, WebCore::IntRect(), frameNotFoundErrorType), 0);
    500             return;
    501         }
    502 
     490    WebCore::Frame* coreFrame = frame->coreFrame();
     491    if (!coreFrame) {
     492        WebProcess::singleton().parentProcessConnection()->send(Messages::WebAutomationSession::DidComputeElementLayout(callbackID, WebCore::IntRect(), frameNotFoundErrorType), 0);
     493        return;
     494    }
     495
     496    WebCore::FrameView *coreFrameView = coreFrame->view();
     497    if (!coreFrameView) {
     498        WebProcess::singleton().parentProcessConnection()->send(Messages::WebAutomationSession::DidComputeElementLayout(callbackID, WebCore::IntRect(), frameNotFoundErrorType), 0);
     499        return;
     500    }
     501
     502    if (useViewportCoordinates)
     503        rect.moveBy(WebCore::IntPoint(0, -coreFrameView->topContentInset()));
     504    else
    503505        rect = coreFrameView->rootViewToContents(rect);
    504     }
    505506
    506507    WebProcess::singleton().parentProcessConnection()->send(Messages::WebAutomationSession::DidComputeElementLayout(callbackID, rect, String()), 0);
Note: See TracChangeset for help on using the changeset viewer.