canvasrenderingcontex2d.fillStyle does not accept whitespace like firefox |
||
Issue descriptioneg. ctx.fillStyle = 'red' works, but ctx.fillStyle = ' red' does not. http://output.jsbin.com/ketewagesa/1 Works in Firefox.
,
Dec 2 2016
Tested on safari, it has the same behavior as chrome
,
Dec 5 2016
I asked this question at blink-dev@, and it is pointed out that the spec here: https://drafts.csswg.org/css-color/#named-colors doesn't say anything about trimming the string before matching it. So ' red' doesn't seem to be a valid string for fillStyle.
,
Dec 6 2016
I retract my previous comments, as it is pointed out here: https://drafts.csswg.org/css-syntax/#rule-defs The white space should be accepted. Following is the quote: <whitespace-token> is never indicated in the grammar; <whitespace-token>s are allowed before, after, and between any two tokens, unless explicitly specified otherwise in prose definitions. (For example, if the prelude of a rule is a selector, whitespace is significant.)
,
Dec 10 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/759bba67481eed3cde4d6de8f95854dea1c1f81e commit 759bba67481eed3cde4d6de8f95854dea1c1f81e Author: junov <junov@chromium.org> Date: Sat Dec 10 01:35:17 2016 Fix the parsing of colors used as canvas styles to ignore whitespace BUG= 668584 Review-Url: https://codereview.chromium.org/2560993003 Cr-Commit-Position: refs/heads/master@{#437710} [add] https://crrev.com/759bba67481eed3cde4d6de8f95854dea1c1f81e/third_party/WebKit/LayoutTests/fast/canvas/canvas-whitespace-parsing.html [modify] https://crrev.com/759bba67481eed3cde4d6de8f95854dea1c1f81e/third_party/WebKit/Source/modules/canvas2d/CanvasStyle.cpp
,
Dec 10 2016
|
||
►
Sign in to add a comment |
||
Comment 1 by xidac...@chromium.org
, Nov 25 2016Owner: junov@chromium.org
Status: Assigned (was: Untriaged)