New issue
Advanced search Search tips
Starred by 11 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Feb 2016
Components:
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 nsdra...@gmail.com, May 12 2010 Back to list

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 
strokeText()
3. DON'T set canvas dimensions this time, then draw text again with 
strokeText()

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.
 
test.html
199 bytes Download
screenshot 2010-05-12 15:59:20.png
23.0 KB View Download
test.js
277 bytes View Download

Comment 1 by mudc...@gmail.com, 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:

http://mudcu.be/labs/JS1k/SpectraSpirograph.html

Comment 2 by ree...@gmail.com, 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 mudc...@gmail.com, 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: http://persistent.info/webkit/test-cases/strokeTest-after-resize.html

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

Comment 6 by karen@chromium.org, Dec 20 2010

Labels: Mstone-X

Comment 7 by kareng@google.com, 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)
V8	3.2.10.21
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: http://jsfiddle.net/CHCMj/

Comment 11 by mudc...@gmail.com, Oct 23 2012

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

Comment 12 by bugdroid1@chromium.org, Mar 10 2013

Labels: -Area-WebKit Cr-Content
Project Member

Comment 13 by bugdroid1@chromium.org, 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