Bug 159851 - Web Automation: Fix element and event coord space issues
Summary: Web Automation: Fix element and event coord space issues
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Timothy Hatcher
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-07-15 17:01 PDT by Timothy Hatcher
Modified: 2016-07-15 18:21 PDT (History)
6 users (show)

See Also:


Attachments
Patch (3.78 KB, patch)
2016-07-15 17:04 PDT, Timothy Hatcher
bburg: review+
timothy: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Timothy Hatcher 2016-07-15 17:01:54 PDT
rdar://problem/27375780
Comment 1 Radar WebKit Bug Importer 2016-07-15 17:03:01 PDT
<rdar://problem/27383442>
Comment 2 Timothy Hatcher 2016-07-15 17:04:21 PDT
Created attachment 283818 [details]
Patch
Comment 3 BJ Burg 2016-07-15 17:14:30 PDT
Comment on attachment 283818 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=283818&action=review

r=me

> Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.cpp:503
>          rect = coreFrameView->rootViewToContents(rect);

I see, so in this case the topContentInset is eventually subtracted here:

ScrollPosition ScrollView::documentScrollPositionRelativeToViewOrigin() const
{
    return scrollPosition() - IntSize(
        shouldPlaceBlockDirectionScrollbarOnLeft() && m_verticalScrollbar ? m_verticalScrollbar->occupiedWidth() : 0,
        headerHeight() + topContentInset(TopContentInsetType::WebCoreOrPlatformContentInset));
}

But otherwise we get the clientRect in raw window space, which is why we have to deduct topContentInset in the other case.

You may want to add a comment or note in the changelog about this, as I thought it was a bug when reviewing.
Comment 4 Timothy Hatcher 2016-07-15 18:21:05 PDT
Comment on attachment 283818 [details]
Patch

https://trac.webkit.org/changeset/203316