New issue
Advanced search Search tips

Issue 708757 link

Starred by 7 users

Issue metadata

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



Sign in to add a comment

Document ready state and image onload may precede actual image load

Project Member Reported by chrishtr@chromium.org, Apr 5 2017

Issue description

This bug gives details on how to reproduce the situation involved:

https://github.com/jugglinmike/chrome-screenshot-race/issues/1
 
Labels: PaintTeamTriaged-20170405 BugSource-Team
Cc: foolip@chromium.org rbyers@chromium.org
Components: Blink>Infra>Predictability Tests>WebDriver
In particular, it's really important for web-platform-test ref tests that webdriver can reliably take a screenshot including loaded images.  But this presumably also affects anyone else using WebDriver to do image-based testing of their website, so we don't want to rely on the WPT-specific workaround indefinitely.  If the right fix is to add some synchronization logic of some sort to ChromeDriver, we can always do that.

Chris mentions that there's a related bug that may have the same underlying issue, and that he's doing a bisect for that.  Chris, can you link to the related bug please?  Thanks for digging into this!


The related bug is not in Chromium. I'll forward it to you offline.
Owner: rbyers@chromium.org
Rick, could you find someone to perform a manual bisect using tools/bisect-builds.py and ChromeDriver? The current instructions at
https://github.com/jugglinmike/chrome-screenshot-race/ worked for me to set
things up and reproduce.
Components: -Blink>Infra>Predictability Blink>Infra>Ecosystem
I have this issue when taking captures in chrome 58 in electron. I update the DOM and tried taking a screenshot after a mutation observer fires. However the screenshot does not always contain the update DOM. 

As suggested in this thread: https://github.com/jugglinmike/chrome-screenshot-race/issues/1#issuecomment-291667054
We tried adding 2 requestAnimationFrame after the DOM mutation event fires as a fix.

This works as a fix in most cases, however under high CPU load the issue is still prevalent.

We use this method to take captures of POS receipts that we then print on a thermal printer, and this issue causes the previous receipt painted to be printed instead of the current one. It occurs for our customers when they run virus scans that increase the CPU load in the background.

Just writing this so that you know that this issue is not only affecting QA/testing purposes.
I thought this issue was fixed, maybe. https://bugs.chromium.org/p/chromium/issues/detail?id=382170

That would be in M-60 and will not be merged back. So going to Stable soon.
Ok thanks. Do not have access to that bug report, but will keep an eye out for the next release then!
@schenney: what commit did you think fixed this?
Cc: hirosh...@chromium.org
I thought the fixes for the issue in crbug.com/382170 addressed all image loading event timing issues. I may well be wrong, however.
I took a quick look at this without luck a few months ago. I am going to take another look when I get a chance and see if it's still reproducible.
rbyers@, any update on this? (It came up as a 60 day P2.)

Comment 13 by ajuma@chromium.org, Feb 13 2018

Labels: -Pri-2 Pri-3
How are we supposed to reliably take actual screenshots of an android web view or electron window without this bug fixed? Even without images on the page (meaning only HTML), you're sometimes screenshotting a previous state.
The same issue exists when using the screenshot APIs in electron and android.
Both the deprecated PictureListener, capturePicture and the "recommended" onDraw method has the same flaw.
https://developer.android.com/reference/android/webkit/WebView.html#capturePicture()

Sign in to add a comment