-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Work around tained canvas error in Internet Explorer #32
Comments
do three things,
`//Get SVG element and then serialize it to convert to a stream of String //CHange/Set Canvas width/height attributes to reset origin-clean flag //Use canvg library to parse SVG and draw the image on given canvas //Convert canvas to png formated dataURL and save the body of it //Array containing all the images in the form of base64 data URLs. Hope this helps. |
Hi @idreamsahan, thanks for your suggestion! I'm not to keen on including another library just to get this test off the ground. I'm considering drawing regular glyphs to the canvas, instead of via the SVG workaround, and read the color values from there. I'll effectively have two results then, and if one of them indicated the color fonts has been rendered, I'm good. Not as clean, but should only add a few more lines of JavaScript. |
IE (not Edge) will throw a
SCRIPT5022: SecurityError
when running ChromaCheck. This is because writing an SVG to the canvas taints the canvas, disallowing ChromaCheck to look at the drawn pixels:See also this StackOverflow issue.
We draw an SVG to the canvas to work around an older Firefox issue. Maybe drop the SVG workaround? Or skip the SVG method for IE/non-Fx?
The text was updated successfully, but these errors were encountered: