Skip to content

Accept a color function left open at the end of the string - #234

Open
lehni wants to merge 1 commit into
linebender:mainfrom
lehni:fix/css-color-unclosed
Open

lehni wants to merge 1 commit into
linebender:mainfrom
lehni:fix/css-color-unclosed

Conversation

@lehni

@lehni lehni commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

CSS's parser closes what is still open at the end of its input, so rgb(0, 255, 0 is green in browsers, in a canvas's fillStyle too: the end of the string now closes a color function, while a missing ) before anything else is still an error. Found with the web-platform-tests' canvas colour tests (2d.fillStyle.parse.rgb-eof, rgba-eof). With a test.

CSS's parser closes what is still open at the end of its input, so rgb(0, 255, 0 is green in browsers and in their canvas's fillStyle. A closing parenthesis is still required before anything else.
@lehni
lehni force-pushed the fix/css-color-unclosed branch from 0916dc8 to 7e06783 Compare October 21, 2026 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant