Changeset 248696 in webkit


Ignore:
Timestamp:
Aug 14, 2019 4:57:06 PM (5 years ago)
Author:
BJ Burg
Message:

REGRESSION(r245320): Web Automation: Perform Actions hangs when pointerdown happens near top of page
https://bugs.webkit.org/show_bug.cgi?id=200728
<rdar://problem/54260518>

Reviewed by Devin Rousso.

In the last major refactoring for this code, it seems that the argument to
platformSimulateMouseInteraction was not unified to use viewport coordinates
in all code paths. This patch fixes both callers to *not* add in topContentInset,
and instead this is added back in when doing platform-specific event simulation.

This has no effect on iOS since it's guarded by ENABLE(WEBDRIVER_MOUSE_INTERACTIONS),
which is only built on macOS.

  • UIProcess/Automation/WebAutomationSession.h:
  • UIProcess/Automation/WebAutomationSession.cpp:

(WebKit::WebAutomationSession::performMouseInteraction):

  • UIProcess/Automation/mac/WebAutomationSessionMac.mm:

(WebKit::WebAutomationSession::platformSimulateMouseInteraction):

Location:
trunk/Source/WebKit
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r248692 r248696  
     12019-08-14  Brian Burg  <bburg@apple.com>
     2
     3        REGRESSION(r245320): Web Automation: Perform Actions hangs when pointerdown happens near top of page
     4        https://bugs.webkit.org/show_bug.cgi?id=200728
     5        <rdar://problem/54260518>
     6
     7        Reviewed by Devin Rousso.
     8
     9        In the last major refactoring for this code, it seems that the argument to
     10        platformSimulateMouseInteraction was not unified to use viewport coordinates
     11        in all code paths. This patch fixes both callers to *not* add in topContentInset,
     12        and instead this is added back in when doing platform-specific event simulation.
     13
     14        This has no effect on iOS since it's guarded by ENABLE(WEBDRIVER_MOUSE_INTERACTIONS),
     15        which is only built on macOS.
     16
     17        * UIProcess/Automation/WebAutomationSession.h:
     18        * UIProcess/Automation/WebAutomationSession.cpp:
     19        (WebKit::WebAutomationSession::performMouseInteraction):
     20        * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
     21        (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
     22
    1232019-08-14  Andy Estes  <aestes@apple.com>
    224
  • trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp

    r247058 r248696  
    16271627
    16281628        x = std::min(std::max(0.0f, x), windowFrame.size().width());
    1629         y = std::min(std::max(0.0f, y + page->topContentInset()), windowFrame.size().height());
    1630 
    1631         WebCore::IntPoint positionInView = WebCore::IntPoint(static_cast<int>(x), static_cast<int>(y));
     1629        y = std::min(std::max(0.0f, y), windowFrame.size().height());
     1630
     1631        WebCore::IntPoint locationInViewport = WebCore::IntPoint(static_cast<int>(x), static_cast<int>(y));
    16321632
    16331633        auto parsedInteraction = Inspector::Protocol::AutomationHelpers::parseEnumValueFromString<Inspector::Protocol::Automation::MouseInteraction>(mouseInteractionString);
     
    16551655        callbackInMap = WTFMove(mouseEventsFlushedCallback);
    16561656
    1657         platformSimulateMouseInteraction(page, parsedInteraction.value(), protocolMouseButtonToWebMouseEventButton(parsedButton.value()), positionInView, keyModifiers);
     1657        platformSimulateMouseInteraction(page, parsedInteraction.value(), protocolMouseButtonToWebMouseEventButton(parsedButton.value()), locationInViewport, keyModifiers);
    16581658
    16591659        // If the event location was previously clipped and does not hit test anything in the window, then it will not be processed.
  • trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.h

    r245796 r248696  
    245245    // Platform-dependent implementations.
    246246#if ENABLE(WEBDRIVER_MOUSE_INTERACTIONS)
    247     void platformSimulateMouseInteraction(WebPageProxy&, MouseInteraction, WebMouseEvent::Button, const WebCore::IntPoint& locationInView, OptionSet<WebEvent::Modifier>);
     247    void platformSimulateMouseInteraction(WebPageProxy&, MouseInteraction, WebMouseEvent::Button, const WebCore::IntPoint& locationInViewport, OptionSet<WebEvent::Modifier>);
    248248#endif
    249249#if ENABLE(WEBDRIVER_TOUCH_INTERACTIONS)
  • trunk/Source/WebKit/UIProcess/Automation/mac/WebAutomationSessionMac.mm

    r241001 r248696  
    122122
    123123#if ENABLE(WEBDRIVER_MOUSE_INTERACTIONS)
    124 void WebAutomationSession::platformSimulateMouseInteraction(WebPageProxy& page, MouseInteraction interaction, WebMouseEvent::Button button, const WebCore::IntPoint& locationInView, OptionSet<WebEvent::Modifier> keyModifiers)
     124void WebAutomationSession::platformSimulateMouseInteraction(WebPageProxy& page, MouseInteraction interaction, WebMouseEvent::Button button, const WebCore::IntPoint& locationInViewport, OptionSet<WebEvent::Modifier> keyModifiers)
    125125{
    126126    IntRect windowRect;
     127    IntPoint locationInView = WebCore::IntPoint(locationInViewport.x(), locationInViewport.y() + page.topContentInset());
    127128    page.rootViewToWindow(IntRect(locationInView, IntSize()), windowRect);
    128129    IntPoint locationInWindow = windowRect.location();
Note: See TracChangeset for help on using the changeset viewer.