New issue
Advanced search Search tips

Issue 922706 link

Starred by 1 user

Issue metadata

Status: Started
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 836884



Sign in to add a comment

CaptureScreenshotTest.CaptureScreenshotArea fails with BlinkGenPropertyTrees

Project Member Reported by pdr@chromium.org, Jan 16 (6 days ago)

Issue description

CaptureScreenshotTest.CaptureScreenshotArea fails with BlinkGenPropertyTrees enabled.

autoninja -C out/Debug content_browsertests
out/Debug/content_browsertests --gtest_filter=CaptureScreenshotTest.CaptureScreenshotArea

[17237:775:0115/180131.983013:ERROR:devtools_protocol_browsertest.cc(365)] Pixel (4,4): expected ff0000ff actual ffffffff
[17237:775:0115/180131.983095:ERROR:devtools_protocol_browsertest.cc(365)] Pixel (4,5): expected ff0000ff actual ffffffff
[17237:775:0115/180131.983123:ERROR:devtools_protocol_browsertest.cc(365)] Pixel (4,6): expected ff0000ff actual ffffffff
[17237:775:0115/180131.983147:ERROR:devtools_protocol_browsertest.cc(365)] Pixel (4,7): expected ff0000ff actual ffffffff
[17237:775:0115/180131.983170:ERROR:devtools_protocol_browsertest.cc(365)] Pixel (4,8): expected ff0000ff actual ffffffff
[17237:775:0115/180131.983193:ERROR:devtools_protocol_browsertest.cc(365)] Pixel (4,9): expected ff0000ff actual ffffffff
[17237:775:0115/180131.983215:ERROR:devtools_protocol_browsertest.cc(365)] Pixel (4,10): expected ff0000ff actual ffffffff
[17237:775:0115/180131.983238:ERROR:devtools_protocol_browsertest.cc(365)] Pixel (4,11): expected ff0000ff actual ffffffff
[17237:775:0115/180131.983261:ERROR:devtools_protocol_browsertest.cc(365)] Pixel (4,12): expected ff0000ff actual ffffffff
[17237:775:0115/180131.983284:ERROR:devtools_protocol_browsertest.cc(365)] Pixel (4,13): expected ff0000ff actual ffffffff
[17237:775:0115/180131.983987:ERROR:devtools_protocol_browsertest.cc(375)] Number of pixel with an error: 17664
[17237:775:0115/180131.984015:ERROR:devtools_protocol_browsertest.cc(376)] Error Bounding Box : 4,4 92x192
../../content/browser/devtools/protocol/devtools_protocol_browsertest.cc:435: Failure
Value of: MatchesBitmap(expected_bitmap, *result_bitmap, matching_mask, device_scale_factor, error_limit)
  Actual: false
Expected: true

 

Comment 1 by pdr@chromium.org, Jan 16 (6 days ago)

Status: Started (was: Untriaged)
Two chromedriver tests also fail with white output. This may be the same issue:
autoninja -C out/Debug chromedriver_py_tests
./chrome/test/chromedriver/test/run_py_tests.py --chromedriver=out/Debug/chromedriver --filter=*testTakeElementScreenshot*

AssertionError: 'PASS' != u'FAIL: Bad pixel rgb(255,255,255) at offset 0 from data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAADICAYAAADGFbfiAAAAAXNSR0IArs4c6QAAAt1JREFUeJzt1cENwCAQwLDS/Xc+ZiAfhGRPkF/WzMwHAIf+2wEAvMlAAEgMBIDEQABIDASAxEAASAwEgMRAAEgMBIDEQABIDASAxEAASAwEgMRAAEgMBIDEQABIDASAxEAASAwEgMRAAEgMBIDEQABIDASAxEAASAwEgMRAAEgMBIDEQABIDASAxEAASAwEgMRAAEgMBIDEQABIDASAxEAASAwEgMRAAEgMBIDEQABIDASAxEAASAwEgMRAAEgMBIDEQABIDASAxEAASAwEgMRAAEgMBIDEQABIDASAxEAASAwEgMRAAEgMBIDEQABIDASAxEAASAwEgMRAAEgMBIDEQABIDASAxEAASAwEgMRAAEgMBIDEQABIDASAxEAASAwEgMRAAEgMBIDEQABIDASAxEAASAwEgMRAAEgMBIDEQABIDASAxEAASAwEgMRAAEgMBIDEQABIDASAxEAASAwEgMRAAEgMBIDEQABIDASAxEAASAwEgMRAAEgMBIDEQABIDASAxEAASAwEgMRAAEgMBIDEQABIDASAxEAASAwEgMRAAEgMBIDEQABIDASAxEAASAwEgMRAAEgMBIDEQABIDASAxEAASAwEgMRAAEgMBIDEQABIDASAxEAASAwEgMRAAEgMBIDEQABIDASAxEAASAwEgMRAAEgMBIDEQABIDASAxEAASAwEgMRAAEgMBIDEQABIDASAxEAASAwEgMRAAEgMBIDEQABIDASAxEAASAwEgMRAAEgMBIDEQABIDASAxEAASAwEgMRAAEgMBIDEQABIDASAxEAASAwEgMRAAEgMBIDEQABIDASAxEAASAwEgMRAAEgMBIDEQABIDASAxEAASAwEgMRAAEgMBIDEQABIDASAxEAASAwEgMRAAEgMBIDEQABIDASAxEAASAwEgMRAAEgMBIDEQABIDASAxEAASAwEgMRAAEgMBIDEQABIDASAxEAASAwEgGQD94QFjFkMgzMAAAAASUVORK5CYII='

Comment 2 by pdr@chromium.org, Jan 19 (3 days ago)

Cc: eseckler@chromium.org
The following subtest of CaptureScreenshotTest.CaptureScreenshotArea will fail with BGPT:
  // Ensure that content outside the emulated frame is painted, too.
  PlaceAndCaptureBox(kFrameSize, gfx::Size(10, 8192), 1.0, 1.);

With BGPT, the layout view creates a clip node that clips out content outside the view (800x600). Without BGPT, this extra clip is not used in the compositor so no clipping occurs. As a result, content outside the bounds of the frame is painted pre-BGPT but not with BGPT. Because clip nodes are used for hit testing (see: https://crrev.com/553652), we cannot omit the LayoutView's clip in the general case.

eseckler has an old post describing how this was implemented in devtools: https://bugs.chromium.org/p/chromium/issues/detail?id=45209#c80. I think we will need to change this approach to actually resize the layout/frameview/etc when taking a screenshot, rather than relying on the view not clipping. I am not sure if the chromedriver uses of this api rely on this, or whether they resize the browser before taking a screenshot.

eseckler, do you by chance remember how important this usecase is? Would we break folks relying on this behavior?

Comment 3 by eseckler@chromium.org, Jan 19 (3 days ago)

Cc: pfeldman@chromium.org
+Pavel for any DevTools frontend use of this.
Project Member

Comment 4 by bugdroid1@chromium.org, Yesterday (36 hours ago)

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c76d8f8e89a57da69f1747b209d7aa816ab2ae0c

commit c76d8f8e89a57da69f1747b209d7aa816ab2ae0c
Author: Philip Rogers <pdr@chromium.org>
Date: Mon Jan 21 18:04:25 2019

[BlinkGenPropertyTrees] Create a device emulation transform node

Device emulation uses a transform on the inner viewport container
layer (see: WebViewImpl::UpdateDeviceEmulationTransform). This layer
transform is set on cc::Layer but is not used to update the transform
node when blink generates property trees (BlinkGenPropertyTrees, BGPT).
This patch creates a device emulation transform node for BGPT.

This patch fixes the following tests:
CaptureScreenshotTest.CaptureScreenshotArea*
ChromeDriverTest.testTakeElementScreenshot
ChromeDriverTest.testTakeElementScreenshotInIframe
HeadlessWebContentsBeginFrameControlViewportTest.RunAsyncTest

* One subtest, when content is drawn outside the emulated frame, still
fails.

Bug: 922706
Change-Id: I46fafb0f4376377d1a96a86e0d6bf2aa91ad4c8d
Reviewed-on: https://chromium-review.googlesource.com/c/1422297
Reviewed-by: David Bokan <bokan@chromium.org>
Commit-Queue: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#624618}
[modify] https://crrev.com/c76d8f8e89a57da69f1747b209d7aa816ab2ae0c/third_party/blink/renderer/core/exported/web_view_impl.cc
[modify] https://crrev.com/c76d8f8e89a57da69f1747b209d7aa816ab2ae0c/third_party/blink/renderer/core/exported/web_view_impl.h
[modify] https://crrev.com/c76d8f8e89a57da69f1747b209d7aa816ab2ae0c/third_party/blink/renderer/core/exported/web_view_test.cc
[modify] https://crrev.com/c76d8f8e89a57da69f1747b209d7aa816ab2ae0c/third_party/blink/renderer/core/frame/visual_viewport.cc
[modify] https://crrev.com/c76d8f8e89a57da69f1747b209d7aa816ab2ae0c/third_party/blink/renderer/core/frame/visual_viewport.h
[modify] https://crrev.com/c76d8f8e89a57da69f1747b209d7aa816ab2ae0c/third_party/blink/renderer/core/frame/visual_viewport_test.cc
[modify] https://crrev.com/c76d8f8e89a57da69f1747b209d7aa816ab2ae0c/third_party/blink/renderer/core/page/chrome_client.h
[modify] https://crrev.com/c76d8f8e89a57da69f1747b209d7aa816ab2ae0c/third_party/blink/renderer/core/page/chrome_client_impl.cc
[modify] https://crrev.com/c76d8f8e89a57da69f1747b209d7aa816ab2ae0c/third_party/blink/renderer/core/page/chrome_client_impl.h

Comment 5 by pdr@chromium.org, Today (10 hours ago)

The devtools feature will still work with this change because they resize the frame when taking a full-page screenshot.

This bug is almost fixed but I have a separate thread with some folks about whether the outside-frame content change is benign.

Sign in to add a comment