New issue
Advanced search Search tips

Issue 760147 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Aug 23
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 2
Type: Feature



Sign in to add a comment

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:
 
Components: Blink>Paint
Labels: -Type-Bug Type-Feature
Components: -Blink>Paint Blink>Scheduling
Labels: OS-Android OS-Chrome OS-Linux OS-Windows
Components: -Blink>Scheduling Blink>Canvas Blink>WebGL
Status: Untriaged (was: Unconfirmed)
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

Comment 4 by enne@chromium.org, Sep 5 2017

Status: Available (was: Untriaged)
Status: WontFix (was: Available)
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