This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 24638 - [Shadow]: elementFromPoint should return the host when you hit a Text node
Summary: [Shadow]: elementFromPoint should return the host when you hit a Text node
Status: RESOLVED MOVED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - Component Model (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Dimitri Glazkov
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 28552
  Show dependency treegraph
 
Reported: 2014-02-12 23:33 UTC by Elliott Sprehn
Modified: 2015-05-27 03:21 UTC (History)
6 users (show)

See Also:


Attachments

Description Elliott Sprehn 2014-02-12 23:33:23 UTC
Seeing as we don't want to throw an exception when you put a Text node as a child of a ShadowRoot, we should at the very least return the host element so that hit testing in a ShadowRoot that has direct text children does something sensible.

We probably need to make it return the host if you hit a border/background color too?

(this also makes sense since you can querySelector(":host"), so the host really is in the same scope as the ShadowRoot.
Comment 1 Daniel Freedman 2014-02-12 23:57:33 UTC
This is conceptually similar to the fact that document.elementFromPoint will return the documentElement if the x,y target is within the document's bounds.
Comment 2 Anne 2014-02-13 10:05:18 UTC
Instead of defining it this way, someone should define hit testing on layout boxes.
Comment 3 Anne 2014-02-13 10:05:59 UTC
I'm not sure we want radically different behavior for elementFromPoint() and mouse events and :hover and such for instance.
Comment 4 Hayato Ito 2015-05-27 03:21:44 UTC
Moved to https://github.com/w3c/webcomponents/issues/67