Bug 175665 - Automation: takeScreenshot should use the visible content rect not the document rect
Summary: Automation: takeScreenshot should use the visible content rect not the docume...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-08-17 02:54 PDT by Carlos Garcia Campos
Modified: 2017-08-28 05:34 PDT (History)
3 users (show)

See Also:


Attachments
Patch (1.86 KB, patch)
2017-08-17 02:59 PDT, Carlos Garcia Campos
bburg: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>