Setting CanvasRenderingContext2D.font ignored when font-variant = 'none'
Reported by
roel....@gmail.com,
Mar 20 2018
|
||
Issue description
UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.162 Safari/537.36
Steps to reproduce the problem:
1. Get a CanvasRenderingContext2D.
var ctx = document.createElement('canvas').getContext('2d');
2. Check the current value of the font property.
console.log(ctx.font);
3. Try to set the font property with a CSS font value that has font-variant as 'none'.
ctx.font = 'normal none 48px sans-serif';
4. Check if the font property has been updated
console.log(ctx.font)
What is the expected behavior?
ctx.font should be set to '48px sans-serif';
What went wrong?
Instead ctx.font is still equal to its original value ('10px sans-serif')
Did this work before? N/A
Does this work in other browsers? N/A
Chrome version: 65.0.3325.162 Channel: stable
OS Version: 10.0
Flash Version:
Having 'none' as font-variant is a legal CSS font value. (https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant) Even if the canvas can't use the value, that doesn't mean the entire font value should be disregarded.
Setting the value does work when instead of 'none' it is set to 'normal'.
,
Aug 13
|
||
►
Sign in to add a comment |
||
Comment 1 by junov@chromium.org
, Mar 20 2018Status: Assigned (was: Unconfirmed)