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

Changeset 262861 in webkit


Ignore:
Timestamp:
Jun 10, 2020, 2:44:04 PM (6 years ago)
Author:
BJ Burg
Message:

WebDriver on non-iOS ports cannot perform ActionChain which has scrolling down to the element and click it
https://bugs.webkit.org/show_bug.cgi?id=208232
<rdar://problem/59859491>

Reviewed by Devin Rousso.

Source/WebCore:

  • platform/ScrollView.h:
  • platform/ScrollView.cpp:

(WebCore::ScrollView::rootViewToContents const):
Create a version of this function that works with FloatPoint.

Source/WebKit:

  • UIProcess/Automation/mac/WebAutomationSessionMac.mm:

(WebKit::WebAutomationSession::platformSimulateMouseInteraction):
The provided coordinates are in LayoutViewport coordinate system, which does
not take topContentInset into account. Add back in the topContentInset
when translating to flipped window coordinates.

  • WebProcess/Automation/WebAutomationSessionProxy.cpp:

(WebKit::WebAutomationSessionProxy::computeElementLayout):
The calculations of element bounds and IVCP have an incorrect handling of
root coordinates as contents/absolute coordinates. Add the missing conversion.

Location:
trunk/Source
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r262857 r262861  
     12020-06-10  Brian Burg  <bburg@apple.com>
     2
     3        WebDriver on non-iOS ports cannot perform ActionChain which has scrolling down to the element and click it
     4        https://bugs.webkit.org/show_bug.cgi?id=208232
     5        <rdar://problem/59859491>
     6
     7        Reviewed by Devin Rousso.
     8
     9        * platform/ScrollView.h:
     10        * platform/ScrollView.cpp:
     11        (WebCore::ScrollView::rootViewToContents const):
     12        Create a version of this function that works with FloatPoint.
     13
    1142020-06-10  Commit Queue  <commit-queue@webkit.org>
    215
  • trunk/Source/WebCore/platform/ScrollView.cpp

    r261874 r262861  
    945945}
    946946
     947FloatPoint ScrollView::rootViewToContents(const FloatPoint& rootViewPoint) const
     948{
     949    return viewToContents(convertFromRootView(rootViewPoint));
     950}
     951
    947952IntPoint ScrollView::rootViewToContents(const IntPoint& rootViewPoint) const
    948953{
  • trunk/Source/WebCore/platform/ScrollView.h

    r259846 r262861  
    280280    bool scrollbarsSuppressed() const { return m_scrollbarsSuppressed; }
    281281
     282    WEBCORE_EXPORT FloatPoint rootViewToContents(const FloatPoint&) const;
    282283    WEBCORE_EXPORT IntPoint rootViewToContents(const IntPoint&) const;
    283284    WEBCORE_EXPORT IntPoint contentsToRootView(const IntPoint&) const;
  • trunk/Source/WebKit/ChangeLog

    r262860 r262861  
     12020-06-10  Brian Burg  <bburg@apple.com>
     2
     3        WebDriver on non-iOS ports cannot perform ActionChain which has scrolling down to the element and click it
     4        https://bugs.webkit.org/show_bug.cgi?id=208232
     5        <rdar://problem/59859491>
     6
     7        Reviewed by Devin Rousso.
     8
     9        * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
     10        (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
     11        The provided coordinates are in LayoutViewport coordinate system, which does
     12        not take topContentInset into account. Add back in the topContentInset
     13        when translating to flipped window coordinates.
     14
     15        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
     16        (WebKit::WebAutomationSessionProxy::computeElementLayout):
     17        The calculations of element bounds and IVCP have an incorrect handling of
     18        root coordinates as contents/absolute coordinates. Add the missing conversion.
     19
    1202020-06-10  Brent Fulgham  <bfulgham@apple.com>
    221
  • trunk/Source/WebKit/UIProcess/Automation/mac/WebAutomationSessionMac.mm

    r262815 r262861  
    141141    IntRect windowRect;
    142142
    143     IntPoint locationInView = WebCore::IntPoint(locationInViewport.x(), locationInViewport.y());
     143    IntPoint locationInView = locationInViewport + IntPoint(0, page.topContentInset());
    144144    page.rootViewToWindow(IntRect(locationInView, IntSize()), windowRect);
    145145    IntPoint locationInWindow = windowRect.location();
  • trunk/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp

    r260653 r262861  
    689689        break;
    690690    case CoordinateSystem::LayoutViewport:
    691         resultElementBounds = enclosingIntRect(mainView->absoluteToLayoutViewportRect(elementBoundsInRootCoordinates));
     691        resultElementBounds = enclosingIntRect(mainView->absoluteToLayoutViewportRect(mainView->rootViewToContents(elementBoundsInRootCoordinates)));
    692692        break;
    693693    }
     
    743743    switch (coordinateSystem) {
    744744    case CoordinateSystem::Page:
    745         resultInViewCenterPoint = roundedIntPoint(mainView->absoluteToDocumentPoint(inViewCenterPointInRootCoordinates));
     745        resultInViewCenterPoint = roundedIntPoint(mainView->absoluteToDocumentPoint(mainView->rootViewToContents(inViewCenterPointInRootCoordinates)));
    746746        break;
    747747    case CoordinateSystem::LayoutViewport:
    748         resultInViewCenterPoint = roundedIntPoint(mainView->absoluteToLayoutViewportPoint(inViewCenterPointInRootCoordinates));
     748        resultInViewCenterPoint = roundedIntPoint(mainView->absoluteToLayoutViewportPoint(mainView->rootViewToContents(inViewCenterPointInRootCoordinates)));
    749749        break;
    750750    }
Note: See TracChangeset for help on using the changeset viewer.