W3C home > Mailing lists > Public > www-style@w3.org > October 2012

Re: [cssom-view] new method, like document.elementFromPoint(), but in the document's coordinate space

From: Shane Stephens <shans@google.com>
Date: Fri, 26 Oct 2012 12:04:44 +1100
Message-ID: <CAGTfzwSZig0mFsFtTDy10xxvixDbf1vE+CB2ScXA0bfkm=9EZw@mail.gmail.com>
To: Sebastian Zartner <sebastianzartner@gmail.com>
Cc: "Edward O'Connor" <eoconnor@apple.com>, www-style list <www-style@w3.org>
I think elementsFromPoint isn't a great name, because I don't think it's a
good idea to have document.elementFromPoint take viewport coordinates but
document.elementsFromPoint take document coordinates.

On the other hand, the functionality proposed (all elements at the point
sorted by z-order) sounds useful.

Cheers,
    -Shane


On Wed, Oct 24, 2012 at 4:04 PM, Sebastian Zartner <
sebastianzartner@gmail.com> wrote:

> On Wed, Oct 24, 2012 at 12:33 AM, Edward O'Connor <eoconnor@apple.com>
> wrote:
> >
> > Hi,
> >
> > Both document.elementFromPoint() and document.caretPositionFromPoint()
> > take viewpoint coordinates, and return null if the coordinates given
> > identify a point outside of the visible viewport. This prevents using
> > these methods for hit testing elements elsewhere in the document.
>
> How about document.elementsFromPoint(), so you get all elements at
> that point sorted descending by z-order?
> And wouldn't <element>.caretPositionFromPoint() make more sense? So
> you could even get the caret positions from overlapping elements.
>
> Sebastian
>
>
Received on Friday, 26 October 2012 01:05:11 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:01 GMT