[Webkit-unassigned] [Bug 61532] A focusedNode should be kept in each TreeScope, not in each Document.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jun 8 22:51:23 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=61532


Hayato Ito <hayato at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX




--- Comment #5 from Hayato Ito <hayato at chromium.org>  2011-06-08 22:51:23 PST ---
Thank you for the comments. Let me update the status.

I tried to implement this idea, keeping a focusedNode in each TreeScope.
But I have not used this approach in implementing <Tab> traversal in shadow, bug 61410.
I just used the current approach, keeping a focusedNode in each Document.

Although I am not sure which is better or not, let me close this bug as WONTFIX until we have clear thought that this is worth doing or not. I might open this issue again in the future.


(In reply to comment #4)
> (In reply to comment #1)
> > When a node B is focused, the following things will happen:
> >  - focusController::focusedFrame -> A
> >  - outerDocument::focusedNode() -> 0 (Hmm.. I'd like to change this behavior. If that were A, some things would get simpler..?)
> >  - innerDocument::focusedNode() -> B
> >  - outerDocument.activeElement -> A
> >  - innerDocument.activeElement -> B
> 
> This seems to be correct to me. The focused node is not in outerDocument, so outerDocument::focusedNode() can only be 0 (the <iframe> isn't what is focused, after all).
> 
> (In reply to comment #3)
> >   - shadow-host - A
> >      - shadow-host - B
> >         - iframe - C
> >            - shadow-host - D
> >                 <input> E ---> focused
> 
> All in all, from the discussion it seems to me, that the question rather is how should 'activeElement' behave, rather than focusedNode (?).
> 
> One possibility could be to have a separate TreeScope.activeElement: a TreeScope's activeElement could point to the deepest ancestor node of the focused node that is still in the same TreeScope, while a Document's activeElement is the deepest ancestor node of the focused node that is still in the same document. (where ancestors cross document boundaries). However, this would require a distinction between 'Document-as-TreeScope' and 'Document-as-Document'.
> 
> > > Another question: What happens when you have this?
> > > 
> > > Document
> > >   - <shadow-host> <--- A
> > >     … shadow-root
> > >       - <content>
> > >     - <input> <--- B
> > > 
> > > Say node B has focus. Is the activeElement of the document A or B?
> > 
> > Interesting. In this case, document.activeElement should be 'A' for me at the first glance.
> > But we should discuss which is better and natural.
> 
> (Assuming B is a child of the shadow host) IMHO this can only be 'B' as otherwise activeElement would require rendering knowledge.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list