W3C home > Mailing lists > Public > whatwg@whatwg.org > March 2014

Re: [whatwg] [2D Canvas] Do canvases in documents without a browsing context need to be rendered?

From: Ian Hickson <ian@hixie.ch>
Date: Thu, 6 Mar 2014 18:45:08 +0000 (UTC)
To: Justin Novosad <junov@google.com>
Message-ID: <alpine.DEB.2.00.1403061844280.31525@ps20323.dreamhostps.com>
Cc: WHAT Working Group <whatwg@whatwg.org>, Rik Cabanier <cabanier@gmail.com>
On Thu, 6 Mar 2014, Justin Novosad wrote:
> On Thu, Mar 6, 2014 at 1:17 PM, Ian Hickson <ian@hixie.ch> wrote:
> > On Wed, 5 Mar 2014, Rik Cabanier wrote:
> > >
> > > Testing all browsers (except IE since 
> > > document.implementation.createHTMLDocument() doesn't work) they seem 
> > > to handle canvas contexts with no browsing context except when you 
> > > use text. Chrome crashes, firefox throws an exception and Safari 
> > > draws the text with a very small scale [1]
> >
> > The spec actually defines what happens with fonts when you don't have 
> > a defined computed style:
> >
> > # If the computed values are undefined for a particular case (e.g. because
> > # the font style source object is not an element or is not being
> > # rendered), then the relative keywords must be interpreted relative to
> > # the normal-weight 10px sans-serif default.
> >
> > This is needed for text rendering in Workers, if nothing else.
> 
> Ah! So that clears it up... almost. How do we interpret that for Path 
> objects? Does adding text to a path count as a case where font style is 
> undefined, or do we defer and resolve the font style when the path 
> object is drawn to a canvas?

Depends on the Path object. There's a "font style source object" defined 
for anything that might draw text (if I didn't screw it up), and that's 
what decides what you should be rendering relative to.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Thursday, 6 March 2014 18:46:14 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:17 UTC