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 28652 - [Shadow] Need Document.deepActiveElement
Summary: [Shadow] Need Document.deepActiveElement
Status: RESOLVED MOVED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - Component Model (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Dimitri Glazkov
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-18 07:34 UTC by Takayoshi Kochi
Modified: 2015-06-02 02:26 UTC (History)
3 users (show)

See Also:


Attachments

Description Takayoshi Kochi 2015-05-18 07:34:21 UTC
According to the current spec,
http://w3c.github.io/webcomponents/spec/shadow/#active-element
Document.activeElement returns "adjusted" element, i.e.
when the real focused element is within a shadow tree, it returns
the top-most shadow host in the Document treescope.

The real focused element can be retrieved by recursively applying
.activeElement against shadowRoots on the way, but it may be
convenient to have a way to directly retrieve the element from Document.

One use case is for accessibility plugins; when a web app is provided
as one custom element (e.g. <topeka-app> at https://polymer-topeka.appspot.com/),
Document.activeElement always points to <topeka-app>,  which does not make
much sense for accessibility plugins.
It may be also necessary to have another type of event than "focus", which
fires when Document.activeElement changes.
Comment 1 Takayoshi Kochi 2015-06-02 02:26:32 UTC
Moved to GitHub issue.
https://github.com/w3c/webcomponents/issues/104