Skip to content

Commit

Permalink
Merge r221246 - Automation: takeScreenshot should use the visible con…
Browse files Browse the repository at this point in the history
…tent rect not the document rect

https://bugs.webkit.org/show_bug.cgi?id=175665

Reviewed by Brian Burg.

According to the spec, we should get the toplevel browsing context document rectangle and take a screenshot of
it using the current viewport width and height. We are currently using the document size.

19. Screen Capture.
https://w3c.github.io/webdriver/webdriver-spec.html#dfn-draw-a-bounding-box-from-the-framebuffer

* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::WebAutomationSessionProxy::takeScreenshot): Use FrameView::visibleContentRect().
  • Loading branch information
carlosgcampos committed Aug 30, 2017
1 parent b79418e commit efee4b3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions Source/WebKit/ChangeLog
@@ -1,3 +1,19 @@
2017-08-28 Carlos Garcia Campos <cgarcia@igalia.com>

Automation: takeScreenshot should use the visible content rect not the document rect
https://bugs.webkit.org/show_bug.cgi?id=175665

Reviewed by Brian Burg.

According to the spec, we should get the toplevel browsing context document rectangle and take a screenshot of
it using the current viewport width and height. We are currently using the document size.

19. Screen Capture.
https://w3c.github.io/webdriver/webdriver-spec.html#dfn-draw-a-bounding-box-from-the-framebuffer

* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::WebAutomationSessionProxy::takeScreenshot): Use FrameView::visibleContentRect().

2017-08-28 Carlos Garcia Campos <cgarcia@igalia.com>

[GTK][WPE] ASSERTION FAILED: !isOpen() in WebKit::IconDatabase::~IconDatabase()
Expand Down
Expand Up @@ -650,7 +650,7 @@ void WebAutomationSessionProxy::takeScreenshot(uint64_t pageID, uint64_t callbac
return;
}

WebCore::IntRect snapshotRect = WebCore::IntRect(WebCore::IntPoint(0, 0), frameView->contentsSize());
WebCore::IntRect snapshotRect = frameView->visibleContentRect();
if (snapshotRect.isEmpty()) {
WebProcess::singleton().parentProcessConnection()->send(Messages::WebAutomationSession::DidTakeScreenshot(callbackID, handle, String()), 0);
return;
Expand Down

0 comments on commit efee4b3

Please sign in to comment.