Feature request: ability to repaint before Javascript code finishing
Reported by
project....@gmail.com,
Aug 29 2017
|
|||||
Issue description
UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36
Steps to reproduce the problem:
Right now, we cannot repaint the browser (including the Canvas element) before a Javascript function finish.
For example, in the following code, the browser will not repaint until the code runs completely.
function foo() {
for (let i = 0; i < 1000; i++) {
ComputeSomething();
RedrawWebGLCanvas();
}
}
In the code, we can only see the latest WebGL canvas, there is no chance to repaint the WebGL canvas or any DOM elements while the function is still running.
(By the way, if we add a break point and debug it in the DevTool, then we can see all repaints in every step.)
What is the expected behavior?
What went wrong?
Could you add an API so that the code can repaint UI (at least Canvas) even the code is running? Just like 'console.log' can print something to console even before the code completes.
Thank you.
Did this work before? N/A
Does this work in other browsers? N/A
Chrome version: 60.0.3112.101 Channel: n/a
OS Version: OS X 10.12.6
Flash Version:
,
Aug 29 2017
,
Sep 4 2017
Seems like this would require a new canvas API. Note that you can already kind of do explicit frame commits like this using the offscreen canvas API: https://developer.mozilla.org/fi/docs/Web/API/OffscreenCanvas
,
Sep 5 2017
,
Aug 23
We are adding a similar functionality to offscreencanvas on workers. But I don't ever see this making into normal canvas. |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by dtapu...@chromium.org
, Aug 29 2017Labels: -Type-Bug Type-Feature