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

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 
sans-serif".

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

Right?

-Boris

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