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

Re: [whatwg] new constructor method for Path2D

From: Ian Hickson <ian@hixie.ch>
Date: Wed, 5 Mar 2014 22:43:36 +0000 (UTC)
To: Jeff Muizelaar <jmuizelaar@mozilla.com>
Message-ID: <alpine.DEB.2.00.1403052242100.31525@ps20323.dreamhostps.com>
Cc: "whatwg@whatwg.org" <whatwg@whatwg.org>, Rik Cabanier <cabanier@gmail.com>
On Wed, 5 Mar 2014, Jeff Muizelaar wrote:
> On Mar 5, 2014, at 5:34 PM, Ian Hickson <ian@hixie.ch> wrote:
> > On Wed, 5 Mar 2014, Rik Cabanier wrote:
> >> 
> >> To work around this, we could add a couple of constructor methods to 
> >> the 2D context:
> >> 
> >> Path2D createPath();
> >> 
> >> Creates a new empty Path object [...]
> > 
> > This used to be how many Web APIs worked, but over the years we've 
> > received enormous volumes of feedback to the effect that 
> > constructor-based APIs are way better than factory-based APIs. Is 
> > there no way we could at least have all the canvases within a Document 
> > in Firefox use the same backend? It would be really unfortunate to 
> > have to use factories here to get around an implementation detail in 
> > one browser.
> 
> The choice of backend depends on the size of the canvas. So it wouldn’t 
> be easy to have all canvases within a document use the same backend.

Ah, ok.

This makes a factory method somewhat less useful, because what if the 
canvas changes size later? Do all the paths have to be "re-bound"?

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Wednesday, 5 March 2014 22:44:39 UTC

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