New issue
Advanced search Search tips

Issue 823816 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

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'.
 

Comment 1 by junov@chromium.org, Mar 20 2018

Owner: fs...@chromium.org
Status: Assigned (was: Unconfirmed)
Cc: fs...@chromium.org
Owner: ----
Status: Available (was: Assigned)

Sign in to add a comment