W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2011

Re: window.find already exists

From: Aryeh Gregor <ayg@aryeh.name>
Date: Mon, 21 Nov 2011 20:33:45 -0500
Message-ID: <CAKA+AxmUFj2n7Cer5mu8m6ZkS4h3yrmmjMX5uxBU4L+qrdtF1Q@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: Simon Pieters <simonp@opera.com>, public-webapps@w3.org
On Mon, Nov 21, 2011 at 11:29 AM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> That only interferes if .find() for selectors is defined on window.
> qSA is only defined on Document and Element, though, and I see no
> reason that .find wouldn't be the same.

So then we get another built-in method that will do different things
if you call it by its bare name in an on* attribute vs. in normal JS?
find() in on* would be document.find(), while anywhere else it would
be window.find().  I ran into this once with getSelection() on window
vs. document, when Gecko had different implementations for the two,
and it was really confusing -- there was no way I'd have figured it
out if I were a typical web author.

Hopefully we can just drop window.find(), though.
Received on Tuesday, 22 November 2011 01:34:44 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:36 UTC