[Bug 18912] [Shadow]: ShadowRoot needs to support elementFromPoint

https://www.w3.org/Bugs/Public/show_bug.cgi?id=18912

--- Comment #4 from Dominic Cooney <dominicc@chromium.org> 2012-09-20 04:14:09 UTC ---
FWIW I think there are four plausible candidates here:

1. the shadow root
2. null (the projection is a "hole")
3. the content or shadow element that projected the element
4. the parent of #3 (which may be the shadow root in some cases)

(In reply to comment #3)
> I think that returning the shadow root in that instance makes sense.

Makes sense.

One thing that is tricky is that you won’t be able to distinguish between the
host element being at that point (I assume that returns the shadow root?) and a
projected element being at that point.

> The
> projected elements are not children of the ShadowRoot, and I think the
> developer should know that.

+1 to this.

> Also, the projected elements will be correctly
> found with document.elementFromPoint, so there is still a way to find the
> element.

That is true when the light child is in the document. However if you have an
element in shadow DOM that itself has a shadow, eg this case:

<u>

{u’s shadow root}
  <v>
    <w>

{v’s shadow root}
  <content>

then elementFromPoint(x, y) pointing to <w> will require some scrabbling around
to work out that you need to ask {u’s shadow root}.elementFromPoint to get it,
and not document nor {v’s shadow root}.

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Thursday, 20 September 2012 04:14:11 UTC