You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Building off of #2300, having whitespace at the start or end of the CSS color used to set a fill style, for example, invalidates the color, which is inconsistent with browser behavior and the specification. (This specification also allows comments to appear, which are also incorrectly parsed here.)
Steps to Reproduce
Compare the results of running the following snippet in a browser and in Node.js with canvas:
constcanvas="document"inglobalThis ? document.createElement("canvas") : require("canvas").createCanvas();constcontext=canvas.getContext("2d");constentries=["red"," red"," red ","#ff0000"," #ff0000","#ff0000 "];for(constentryofentries){context.fillStyle=entry;console.log(context.fillStyle);}
Environment
canvas 2.11.2
macOS Sonoma 14.1
The text was updated successfully, but these errors were encountered:
Building off of #2300, having whitespace at the start or end of the CSS color used to set a fill style, for example, invalidates the color, which is inconsistent with browser behavior and the specification. (This specification also allows comments to appear, which are also incorrectly parsed here.)
Steps to Reproduce
Compare the results of running the following snippet in a browser and in Node.js with
canvas
:Environment
canvas
2.11.2The text was updated successfully, but these errors were encountered: