WebDriver: use in-view center point for clicks instead of bounding box center point
https://bugs.webkit.org/show_bug.cgi?id=174863
Reviewed by Simon Fraser.
Source/WebCore:
Make DOMRect, and FloatPoint::narrowPrecision() available to WebKit layer. Also add
FrameView::clientToDocumentPoint().
* WebCore.xcodeproj/project.pbxproj:
* dom/Element.h:
* page/FrameView.h:
* platform/graphics/FloatPoint.h:
Source/WebDriver:
The center of the element bounding box is not always part of the element, like in multiline links, for example.
11.1 Element Interactability.
https://www.w3.org/TR/webdriver/#dfn-in-view-center-point
* CommandResult.cpp:
(WebDriver::CommandResult::httpStatusCode): Add ElementClickIntercepted and ElementNotInteractable errors.
(WebDriver::CommandResult::errorString): Ditto.
* CommandResult.h: Ditto.
* Session.cpp:
(WebDriver::Session::computeElementLayout): Get the in-view center point and isObscured from the result too.
(WebDriver::Session::getElementRect): Ignore in-view center point and isObscured.
(WebDriver::Session::elementClick): Fail in case the element is not interactable or is obscured.
* Session.h:
Source/WebKit:
Change computeElementLayout to also return the in-view center point and whether it's obscured by another
element.
* UIProcess/Automation/Automation.json: Add optional inViewCenterPoint to the result and isObscured.
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::didComputeElementLayout): Handle inViewCenterPoint and isObscured.
* UIProcess/Automation/WebAutomationSession.h:
* UIProcess/Automation/WebAutomationSession.messages.in:
* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::elementInViewClientCenterPoint): Get the client in-view center point and whether it's obscured
according to the spec.
(WebKit::WebAutomationSessionProxy::computeElementLayout): Pass inViewCenterPoint and isObscured to
DidComputeElementLayout message.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220314
268f45cc-cd09-0410-ab3c-
d52691b4dbfc