Reviewers: Sami
CL:
https://codereview.chromium.org/2237433004/Message:
Hey Sami,
This is missing tests at the moment, but I thought you might want to have a
first look anyway :)
Eric
Description:
Adds DevTools commands for composited area override to the Emulation domain.
They are handled by the renderer's DevToolsEmulator.
This is a second step towards more flexible screenshots
(
bit.ly/sized-screenshots): With this override, we can position a specific
(scaled) area of the page into the top-left corner of the frame. We can then
take a screenshot after resizing the frame (RWHV) in the browser to the area
size. We are adding DevTools commands for this in a separate patch:
https://codereview.chromium.org/2226323002/We enforce the override through the root layer transform of WebViewImpl.
As the area coordinates are given relative to the page origin and a page
scale of 1.0, we take the current scroll offset and page scale into account
and update the transform when they change.
To ensure that all content in the area is recorded and shown, we override
the recording area used in CompositedLayerMapping and disable clipping to
the visual viewport while the override is active.
BUG=625577
Base URL:
https://chromium.googlesource.com/chromium/src.git@masterAffected files (+236, -24 lines):
M third_party/WebKit/Source/core/frame/FrameView.h
M third_party/WebKit/Source/core/frame/FrameView.cpp
M third_party/WebKit/Source/core/frame/VisualViewport.cpp
M third_party/WebKit/Source/core/inspector/browser_protocol.json
M third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
M third_party/WebKit/Source/core/page/ChromeClient.h
M third_party/WebKit/Source/platform/graphics/GraphicsLayer.h
M third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
M third_party/WebKit/Source/web/ChromeClientImpl.h
M third_party/WebKit/Source/web/ChromeClientImpl.cpp
M third_party/WebKit/Source/web/DevToolsEmulator.h
M third_party/WebKit/Source/web/DevToolsEmulator.cpp
M third_party/WebKit/Source/web/InspectorEmulationAgent.h
M third_party/WebKit/Source/web/InspectorEmulationAgent.cpp
M third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
M third_party/WebKit/Source/web/WebViewImpl.h
M third_party/WebKit/Source/web/WebViewImpl.cpp
M third_party/WebKit/Source/web/tests/WebInputEventConversionTest.cpp