Bug 175665

Summary: Automation: takeScreenshot should use the visible content rect not the document rect
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WebKit2Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, joepeck, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch bburg: review+

Description Carlos Garcia Campos 2017-08-17 02:54:41 PDT
https://w3c.github.io/webdriver/webdriver-spec.html#dfn-draw-a-bounding-box-from-the-framebuffer

We should take the document rectangle and draw it with the current viewport width and height. If I understand the spec correctly we should use the document rectangle coordinates, but that's not what chromium and firefox do, they take the screenshot of the visible area.
Comment 1 Carlos Garcia Campos 2017-08-17 02:59:26 PDT
Created attachment 318346 [details]
Patch
Comment 2 BJ Burg 2017-08-18 12:13:48 PDT
Comment on attachment 318346 [details]
Patch

r=me

I don't think there are any Selenium tests that cover interesting screenshot corner cases.
Comment 3 Carlos Garcia Campos 2017-08-19 00:54:51 PDT
(In reply to Brian Burg from comment #2)
> Comment on attachment 318346 [details]
> Patch
> 
> r=me
> 
> I don't think there are any Selenium tests that cover interesting screenshot
> corner cases.

Right, they just check the commands return any data. I did several manual tests comparing with firefox and chrome.
Comment 4 Carlos Garcia Campos 2017-08-28 05:32:48 PDT
Committed r221246: <http://trac.webkit.org/changeset/221246>
Comment 5 Radar WebKit Bug Importer 2017-08-28 05:34:07 PDT
<rdar://problem/34108956>