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

On Saturday 2009-08-01 08:06 +0000, Ian Hickson wrote:
> Actually, not right. You should use the canvas as the parent, but if 
> there's a parse error you should leave the font unchanged. Sorry, I didn't 
> fully think through what you had written.

So what you're saying is that we should compute the font as though
the text were on an element with the following three CSS
declarations:
  font: 10px sans-serif;
  font: /* as specified, except with 'inherit' or 'initial' forbidden */;
  line-height: normal;
and that that element should interpret relative values as though its
parent were the canvas, unless the canvas is not in the DOM tree, in
which case relative values should be relative to something whose
font is '10px sans-serif'.

Note that '10px sans-serif' shows up in two different places in this
description, and the difference between Firefox's current behavior
and this is (1) to introduce the first of those two places (we now
only have one) and (2) forbid inherit and initial.

-David

-- 
L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/

Received on Saturday, 1 August 2009 14:55:27 UTC