Comment 32 for bug 602877

Revision history for this message
In , Enn (enndeakin) wrote :

(In reply to comment #31)
> Let the caret navigation mode is on, some focusable element is focused. We need
> to move the caret into heading (HTML h1 for example) and make document focused.

Moving the caret and then using the suggestion I made in comment 12 will update the focus accordingly. The latest patch appears to do that.

> We do
> 1) nsIFocusManager::SetFocus on the non focusable element

That will and should do nothing.

> 2) Change ranges of related nsISelection object.
>
> I think existing code should work well for HTML input but it appears it doesn't
> work on rich text elements (like heading) when caret navigation mode is on.
> What should we do to get desired result?

How does it not work?

I don't know how the specifics of how the caret is moved. I only know that the caret is moved and the focus updated to match (this is done in nsSelectMoveScrollCommand::DoCommandBrowseWithCaretOn)

> The second question is: when nsIFocusManager::SetFocus is called on HTML button
> while focus is in another window then it seems the window containing HTML
> button is not focused. Is that expected?

The document.activeElement (of the document the button is in) should be set to that button. The window will not be made frontmost unless the raise flag is passed to SetFocus.