Closed
Bug 1117535
Opened 10 years ago
Closed 7 years ago
wrong activeElement when focusing element in ShadowDOM
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 1429656
People
(Reporter: mail, Unassigned)
References
(Blocks 1 open bug)
Details
(Keywords: testcase)
Attachments
(1 file)
2.90 KB,
text/html
|
Details |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:34.0) Gecko/20100101 Firefox/34.0
Build ID: 20141125180439
Steps to reproduce:
1. created a ShadowDOM structure (see attached test case)
2. focused element within a ShadowRoot
3. verified focused element with document.activeElement
Live test case: http://medialize.github.io/ally.js/tests/browser-bugs/gecko-shadow-dom-active-element.html
Actual results:
When focusing a shadowed element (i.e. an element within a ShadowRoot) that element is exposed to document.activeElement - i.e. document.activeElement leaks the content of the ShadowRoot.
Also there is no ShadowRoot.activeElement - which is necessary to actually get to the focused element from the adjusted target (i.e. the ShadowHost).
Also reproducible in Firefox Nightly 37.0a1 (2015-01-04).
Expected results:
document.activeElement should point to the (top most) ShadowHost containing the focused element. ShadowRoot.activeElement should point to the focused element in that ShadowRoot (as document.activeElement does for the document).
Reporter | ||
Comment 1•10 years ago
|
||
Comment 2•10 years ago
|
||
Gabor, do you know what's going on here? (after bug 777674 you are now the person I associate with shadow dom implementation stuff... :-) )
Comment 3•10 years ago
|
||
(In reply to :Gijs Kruitbosch from comment #2)
> Gabor, do you know what's going on here? (after bug 777674 you are now the
> person I associate with shadow dom implementation stuff... :-) )
I think you would have better luck with William or Olli, but I'm happy if you keep me in the loop :)
I think Olli worked on making the focusing stuff work, so I'm passing the needInfo flag to him. He might know something off the top of his head, otherwise I can dive into this.
Flags: needinfo?(gkrizsanits) → needinfo?(bugs)
Comment 4•10 years ago
|
||
I thought we had a bug open for this, but maybe not.
Blocks: webcomponents
Flags: needinfo?(bugs)
Reporter | ||
Comment 5•10 years ago
|
||
It may also be of interest that if document.activeElement is not cleaned up (reset to document.body) when he ShadowRoot that element belonged to is removed. In that case document.activeElement.blur() does nothing and the only way out of that hole is to first focus another element in the document itself, before running document.activeElement.blur().
Updated•7 years ago
|
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
Assignee | ||
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•