[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
Sun May 29 22:21:20 PDT 2011


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


Hayato Ito <hayato at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dglazkov at chromium.org,
                   |                            |dominicc at chromium.org,
                   |                            |morrita at google.com,
                   |                            |rolandsteiner at chromium.org




--- Comment #1 from Hayato Ito <hayato at chromium.org>  2011-05-29 22:21:20 PST ---
Let me share my idea briefly here.

The main motivation is to make a 'shadow-host' act similar to a 'iframe', which is a boundary of focus scope. For example, if a iframe element is not focusable, all descendant elements in the iframe are skipped when we press 'Tab' key. I'd like to apply the same behavior to shadow host.

I am trying to implement 'tab traversal into shadow' in bug 61410. But it turned out that we should make things changed: I'd like to have focusedNode in each TreeScope, not in each Document. Let me explain by using examples:

See the following tree:

  Document (outer)
    - <p>
    - <iframe>  <--- A
       - Document (inner)
         - <input>  <---- B
         - <input>


 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


See the next tree, which contains a shadow-host element

  Document
    - <p>
    - <shadow-host>   <--- A
        .. shadow-root
             - <input>  <---- B
             - <input>


 When a node B is focused, what is expected? In working patch in https://bugs.webkit.org/attachment.cgi?id=95126, the following will happen:
  - focusController::focusedFrame -> a document (There is only one document, which is shared between an outer tree and a shadow root.)
  - document::focusedNode() -> B
  - document.activeElement ->  should be A (Not implemented yet, there is a working patch in bug 61413 ).

I'd like to vanish this difference and treat these uniformly:

- Have focusedNode in each TreeScope, not in each Document.
- To make FocusControler have focusedTreeSocpe() in addition to focusedFrame().

By these changes, we cat get current deepest focusedNode by focusController->focusedTreeScope()->focusedNode().
And ideally, document.activeElement is always same to the return value of 'document::focusedNode'.

So the latter case should be:

  focusController::focusedTreeScope() -> shadow-root 
  shadow-root::focusedNode() -> B
  shadow-root::activeElement -> ??? (Should TreeScope has activeElement?)
  document::focusedNode() -> A (shadow host)
  document.activeElement ->  A (shadow host)

This is my rough idea.

-- 
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