W3C home > Mailing lists > Public > public-geolocation@w3.org > October 2008

Re: geolocation.clearWatchAll()

From: Aaron Boodman <aa@google.com>
Date: Fri, 3 Oct 2008 10:46:57 -0700
Message-ID: <278fd46c0810031046o24472e1bsc1ee83f68f598fc1@mail.gmail.com>
To: "Doug Turner" <doug.turner@gmail.com>
Cc: "Andrei Popescu" <andreip@google.com>, public-geolocation <public-geolocation@w3.org>

On Fri, Oct 3, 2008 at 10:38 AM, Doug Turner <doug.turner@gmail.com> wrote:
> clearWatchAll() should be scoped by the js context it is called in.

By js context, do you mean DOM window?

Let's say you use the prototype JS library, and it has functionality
that uses the Geolocation API. Let's also say that you write some of
your own code to use Geolocation. Now if you or Prototype use this
clearAllWatches(), you can break each other.

This isn't that contrived, this problem existed for a long time with
DOM 0 event handlers (onload, onclick, etc). That is part of the
reason why event listeners (addEventListener, removeEventListener)
were introduced.

- a
Received on Friday, 3 October 2008 17:47:38 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:50:51 UTC