W3C home > Mailing lists > Public > whatwg@whatwg.org > November 2013

Re: [whatwg] Questions regarding Path object

From: Rik Cabanier <cabanier@gmail.com>
Date: Mon, 4 Nov 2013 09:14:24 -0800
Message-ID: <CAGN7qDDooByvLc8XTUHaHqo0OrqkmMouUSqoo6TecevkgqkUpQ@mail.gmail.com>
To: Jürg Lehni <lists@scratchdisk.com>
Cc: Juriy Zaytsev <kangax@gmail.com>, "whatwg@lists.whatwg.org" <whatwg@lists.whatwg.org>, Simon Pieters <simonp@opera.com>, Dirk Schulze <dschulze@adobe.com>, Dean Jackson <dino@apple.com>, Ian Hickson <ian@hixie.ch>
On Mon, Nov 4, 2013 at 2:07 AM, Jürg Lehni <lists@scratchdisk.com> wrote:

> Thinking more about this discussion, I had an idea for an approach that
> would avoid such future clashes all together:
>
> Instead of exposing constructors, why not simply expose the methods that
> create them?
>
> There already are such functions for gradients:
>
> ctx.createRadialGradient()
> ctx.createLinearGradient()
>
> Wouldn't it have been more aligned with this existing API also to have a
> ctx.createPath() ?


The SVG WG would like to start using the 'Path' object for its objects as
well. We'd like this to be a generic object that can be used by other parts
of the web platform.
It would be strange to require a canvas context just to create pathh.


>
> On Oct 18, 2013, at 21:06 , Dean Jackson <dino@apple.com> wrote:
>
> > On 17 Oct 2013, at 9:20 am, Ian Hickson <ian@hixie.ch> wrote:
> >
> >>> PS: iOS 7 is barely released, but the first bug reports are already
> >>> coming in, because the new Mobile Safari now defines Path, and clashes:
> >>>
> >>> https://twitter.com/danetag/status/380636739251220480
> >>
> >> Looks like this user solved the problem pretty quickly.
> >>
> >> I tried to find more evidence of problems now that iOS7 is out with
> this,
> >> but I'm not finding much. (I did a bunch of searches on Google.)
> >>
> >> Having said that, I'm not saying there's no conflicts. If Chrome and
> >> Safari want to change to a different name, we can definitely still do
> >> that, it's early days yet. DOMPath, maybe? Or Path2D, or CanvasPath.
> >>
> >> Still, on the long term it'd be sad that we can't just use Path.
> >
> > FWIW, many new specifications are hitting issues like this (well…
> > at least Web Animations!). It’s a pain that new classes can
> > clash with existing content, but I think we have to act
> > as if the future is bigger than the past and thus pick the best
> > name for the job.
> >
> > As someone else said, the rule of not injecting into the global
> > namespace from a JS library has been known for a few years now,
> > and if you’re still not doing it you’re asking for trouble.
> >
> > Dean
> >
>
>
Received on Monday, 4 November 2013 17:14:55 UTC

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