[whatwg] Questions regarding Path object

Rik Cabanier cabanier at gmail.com
Tue Apr 9 14:52:49 PDT 2013


On Tue, Apr 9, 2013 at 1:24 PM, Scratchdisk.com <service at scratchdisk.com>wrote:

> Hi Rik,
>
> Thanks for the detailed answers, and apologies for the delay. Below my
> responses.
>
> On Mar 23, 2013, at 20:13 , Rik Cabanier <cabanier at gmail.com> wrote:
>
> > There was a long conversation about this on the mailing list:
> http://lists.w3.org/Archives/Public/public-whatwg-archive/2012Sep/0288.html
> > The SVG WG also look into this during a face-to-face and we examined
> paper.js to see if it was a problem. Since we saw it was scoped, we assumed
> that there would be no problem.
> >
> > How common is it that people inject into the global scope?
>
> It is pretty common, unfortunately. I would say, most people who don't
> want to work with PaperScript and use JavaScript directly inject the
> prototypes into the global scope.
>
> Is it too late to start this discussion again?


It is not too late. Someone started the implementation on Firefox but it
stalled. [1]
The Webkit implementation is behind a compile time flag so it can still
change.


> I totally agree with Elliott Sprehn's point in the conversation mentioned
> above:


> > We already have CanvasGradient and CanvasPattern in the global
> namespace, so this should probably be called CanvasPath.
>

The intent is that we can use this object with SVG as well so we would like
to avoid prefixing it with 'Canvas'.


>
> BTW, I can't find the lengthy conversation, there appears to be only one
> answer to Elliott's message?
>

If you look at October, you will see that the conversation continued.


>
> > - I see there are many ways to construct paths from different type of
> data, and perform manipulations on them.
> >
> > The current path APIs suffer from conflating path segments and geometry.
> To fix this, I proposed to modify the API so path just describe the path
> segments [1]. In addition, I proposed to create a new 'shape' object that
> takes things like winding and the current CTM into account.
> > Even though it's not in the blog post, we should extend 'shape' so you
> can do binary operations such as unions and intersection. The skia people
> are working on library to calculate this [2] (see the mailing list for
> chromium graphics)
>
> Interesting! You seem to have forgotten to include reference [2] in the
> original email. I'd love to read more on that.
>

It was posted in the graphics-dev group [3].


>
> I really do hope that we can avoid the namespace clash. Shape is also a
> way too common word I think for it to be introduced now as new global
> constructor. Why are those not all just prefixed with Canvas?
>

Can you think of another prefix so people don't assume that shape and path
are specific to canvas?


1: https://bugzilla.mozilla.org/show_bug.cgi?id=830734
2:
http://lists.w3.org/Archives/Public/public-whatwg-archive/2012Oct/0015.html
3:
https://groups.google.com/a/chromium.org/forum/?fromgroups=#!topic/graphics-dev/fZuCeQ2Ach4


More information about the whatwg mailing list