New issue
Advanced search Search tips

Issue 44017 link

Starred by 11 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Feb 2016
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows
Pri: 2
Type: Bug

Sign in to add a comment

strokeText() produces no output when canvas dimensions are set dynamically

Reported by, May 12 2010

Issue description

Chrome Version       : 6.0.401.0 (46998) Ubuntu 10.04 64-bit
URLs (if applicable) : N/A
Other browsers tested:
Add OK or FAIL after other browsers where you have tested this issue:
     Safari 4: OK
  Firefox 3.x: OK
         IE 7: N/A
         IE 8: N/A

What steps will reproduce the problem?
1. Create a simple HTML file with a <canvas> element. I've attached a 
simple HTML file I tested with.
2. Use JavaScript to set the canvas dimensions, then draw some text with 
3. DON'T set canvas dimensions this time, then draw text again with 

What is the expected result?
The text shows as in the attached screenshot even if the canvas dimensions 
are set in JavaScript

What happens instead?
Nothing is shown unless no canvas dimensions are set dynamically

I've attached the simple HTML and JavaScript files I've used to test this 
issue. When testing, the console reports no errors or warnings whatsoever.
199 bytes Download
screenshot 2010-05-12 15:59:20.png
23.0 KB View Download
277 bytes View Download

Comment 1 by, Aug 7 2010

I've created a fix for this in my submission to the JS1k challenge.  What you do is set the canvas.width/canvas.height onload, and then encapsulate the ctx.strokeText in a setTimeout().  Here's an example:

Comment 2 by, Aug 24 2010

I can confirm that I am still seeing behaviour that seems to be caused by this. Text is visible in Firefox but not in Chrome. The canvas is created programmatically using JavaScript (generated through Google Web Toolkit).

As I understand it the above workaround is no good, as it requires the canvas to still be initialised in the html document rather than through a createElement call.

Comment 3 by, Aug 25 2010

Yeah - it's a workaround.  It's more of a que for the developers of Chrome to find the solution to solve issue (as it already works partially). 

Thanks for confirming ;)
 Issue 59482  has been merged into this issue.
Labels: -Area-Undefined Area-WebKit OS-Windows OS-Linux
Status: Untriaged
I uploaded the test case to:

The strokeText() call appears to work on Mac, but not on Windows, so I suspect a Skia issue.

Comment 6 by, Dec 20 2010

Labels: Mstone-X

Comment 7 by, May 13 2011

Status: Available
When is this getting fixed? I see this issue in:-
Google Chrome	12.0.742.112 (Official Build 90304)
WebKit	534.30 (branches/chromium/742@89068)
Flash	10,3,181,34
User Agent	Mozilla/5.0 (Windows NT 5.1) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.112 Safari/534.30

And I am using Win XP SP3.
Update. This persists in Chrome 14 too. JSFiddle code:

Comment 11 by, Oct 23 2012

This bug appears to be fixed in Chrome 22 :)
Project Member

Comment 12 by, Mar 10 2013

Labels: -Area-WebKit Cr-Content
Project Member

Comment 13 by, Apr 6 2013

Labels: -Cr-Content Cr-Blink
Components: -Blink Blink>Canvas
Status: WontFix (was: Available)
Closing per #11

Sign in to add a comment