Title: [203316] trunk/Source/WebKit2
Revision
203316
Author
[email protected]
Date
2016-07-15 18:19:21 -0700 (Fri, 15 Jul 2016)

Log 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.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (203315 => 203316)


--- trunk/Source/WebKit2/ChangeLog	2016-07-16 01:14:57 UTC (rev 203315)
+++ trunk/Source/WebKit2/ChangeLog	2016-07-16 01:19:21 UTC (rev 203316)
@@ -1,3 +1,18 @@
+2016-07-15  Timothy Hatcher  <[email protected]>
+
+        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.
+
 2016-07-15  Beth Dakin  <[email protected]>
 
         Mac UI process needs to know about element focus and blur, much like iOS

Modified: trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp (203315 => 203316)


--- trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp	2016-07-16 01:14:57 UTC (rev 203315)
+++ trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp	2016-07-16 01:19:21 UTC (rev 203316)
@@ -918,7 +918,7 @@
 
     updatedPositionObject = Inspector::Protocol::Automation::Point::create()
         .setX(x)
-        .setY(y)
+        .setY(y - page->topContentInset())
         .release();
 #endif // USE(APPKIT)
 }

Modified: trunk/Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.cpp (203315 => 203316)


--- trunk/Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.cpp	2016-07-16 01:14:57 UTC (rev 203315)
+++ trunk/Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.cpp	2016-07-16 01:19:21 UTC (rev 203316)
@@ -487,21 +487,22 @@
 
     WebCore::IntRect rect = coreElement->clientRect();
 
-    if (!useViewportCoordinates) {
-        WebCore::Frame* coreFrame = frame->coreFrame();
-        if (!coreFrame) {
-            WebProcess::singleton().parentProcessConnection()->send(Messages::WebAutomationSession::DidComputeElementLayout(callbackID, WebCore::IntRect(), frameNotFoundErrorType), 0);
-            return;
-        }
+    WebCore::Frame* coreFrame = frame->coreFrame();
+    if (!coreFrame) {
+        WebProcess::singleton().parentProcessConnection()->send(Messages::WebAutomationSession::DidComputeElementLayout(callbackID, WebCore::IntRect(), frameNotFoundErrorType), 0);
+        return;
+    }
 
-        WebCore::FrameView *coreFrameView = coreFrame->view();
-        if (!coreFrameView) {
-            WebProcess::singleton().parentProcessConnection()->send(Messages::WebAutomationSession::DidComputeElementLayout(callbackID, WebCore::IntRect(), frameNotFoundErrorType), 0);
-            return;
-        }
+    WebCore::FrameView *coreFrameView = coreFrame->view();
+    if (!coreFrameView) {
+        WebProcess::singleton().parentProcessConnection()->send(Messages::WebAutomationSession::DidComputeElementLayout(callbackID, WebCore::IntRect(), frameNotFoundErrorType), 0);
+        return;
+    }
 
+    if (useViewportCoordinates)
+        rect.moveBy(WebCore::IntPoint(0, -coreFrameView->topContentInset()));
+    else
         rect = coreFrameView->rootViewToContents(rect);
-    }
 
     WebProcess::singleton().parentProcessConnection()->send(Messages::WebAutomationSession::DidComputeElementLayout(callbackID, rect, String()), 0);
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to