W3C home > Mailing lists > Public > public-html@w3.org > August 2009

Re: canvas text: ctx.font='inherit'

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Fri, 31 Jul 2009 21:13:09 -0400
Message-ID: <4A7396A5.9090801@mit.edu>
To: Ian Hickson <ian@hixie.ch>
CC: Simon Pieters <simonp@opera.com>, "public-html@w3.org" <public-html@w3.org>
Ian Hickson wrote:
> Firefox uses the canvas element's computed value for 'font' for _any_ 
> invalid value passed to the 'font' attribute.

Sort of.  What Firefox does is to treat the font as having the following 
  declarations specified:

   font: whatever-you-passed-in;
   line-height: normal;

and then act as if that rule were applied to a node that is the child of 
the <canvas> element (unless the canvas element is not in the document 
tree, in which case the style is treated as inheriting from "font: 10px 

> I've clarified that 'initial' and 'inherit' must be ignored. I haven't 
> changed the spec to match either WebKit or Gecko here.

So basically the behavior should be as Firefox now except:

1)  Treat inherit and initial as CSS syntax errors.
2)  Always use "font: 10px sans serif" as the parent's font, not
     just when the <canvase> is outside of a DOM tree.


Received on Saturday, 1 August 2009 01:14:21 UTC

This archive was generated by hypermail 2.4.0 : Saturday, 9 October 2021 18:44:52 UTC