[webcomponents] [Shadow] Need Document.deepActiveElement (bugzilla:28652) (#104)

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.

---
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/104

Received on Tuesday, 2 June 2015 02:26:33 UTC