Backed out changeset f5ea755e3cb9 (bug 1176239) for test failures in browser_focusnavigation.js

This commit is contained in:
Carsten "Tomcat" Book 2015-07-21 15:22:15 +02:00
parent efe5c48020
commit ebdbc83ad2
6 changed files with 24 additions and 38 deletions

View File

@ -2983,20 +2983,20 @@ nsFocusManager::GetNextTabbableContent(nsIPresShell* aPresShell,
return NS_OK;
}
// If this is a remote child browser, call NavigateDocument to have
// the child process continue the navigation. Return a special error
// code to have the caller return early. If the child ends up not
// being focusable in some way, the child process will call back
// into document navigation again by calling MoveFocus.
TabParent* remote = TabParent::GetFrom(currentContent);
if (remote) {
remote->NavigateByKey(aForward, aForDocumentNavigation);
return NS_SUCCESS_DOM_NO_OPERATION;
}
// Next, for document navigation, check if this a non-remote child document.
bool checkSubDocument = true;
if (aForDocumentNavigation) {
// If this is a remote child browser, call NavigateDocument to have
// the child process continue the navigation. Return a special error
// code to have the caller return early. If the child ends up not
// being focusable in some way, the child process will call back
// into document navigation again by calling MoveFocus.
TabParent* remote = TabParent::GetFrom(currentContent);
if (remote) {
remote->NavigateDocument(aForward);
return NS_SUCCESS_DOM_NO_OPERATION;
}
// Next, check if this a non-remote child document.
nsIContent* docRoot = GetRootForChildDocument(currentContent);
if (docRoot) {
// If GetRootForChildDocument returned something then call

View File

@ -5,7 +5,7 @@
#include "domstubs.idl"
[scriptable, uuid(CE6F563B-BD77-4EF2-9D7C-A94C587353E4)]
[scriptable, uuid(A10D887D-7FC2-48A2-ABC6-A2027423860C)]
interface nsITabParent : nsISupports
{
void injectTouchEvent(in AString aType,
@ -28,13 +28,10 @@ interface nsITabParent : nsISupports
readonly attribute uint64_t tabId;
/**
* Navigate by key. If aForDocumentNavigation is true, navigate by document.
* If aForDocumentNavigation is false, navigate by element.
*
* If aForward is true, navigate to the first focusable element or document.
* If aForward is false, navigate to the last focusable element or document.
* If aForward is true, navigate to the first focusable document.
* If aForward is false, navigate to the last focusable document.
*/
void navigateByKey(in bool aForward, in bool aForDocumentNavigation);
void navigateDocument(in bool aForward);
readonly attribute boolean hasContentOpener;
};

View File

@ -698,9 +698,9 @@ child:
SetIsDocShellActive(bool aIsActive);
/**
* Navigate by key (Tab/Shift+Tab/F6/Shift+f6).
* Navigate by document.
*/
NavigateByKey(bool aForward, bool aForDocumentNavigation);
NavigateDocument(bool aForward);
/**
* The parent (chrome thread) requests that the child inform it when

View File

@ -2937,7 +2937,7 @@ TabChild::RecvSetIsDocShellActive(const bool& aIsActive)
}
bool
TabChild::RecvNavigateByKey(const bool& aForward, const bool& aForDocumentNavigation)
TabChild::RecvNavigateDocument(const bool& aForward)
{
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
if (fm) {
@ -2945,20 +2945,9 @@ TabChild::RecvNavigateByKey(const bool& aForward, const bool& aForDocumentNaviga
nsCOMPtr<nsPIDOMWindow> window = do_GetInterface(WebNavigation());
// Move to the first or last document.
uint32_t type = aForward ?
(aForDocumentNavigation ? static_cast<uint32_t>(nsIFocusManager::MOVEFOCUS_FIRSTDOC) :
static_cast<uint32_t>(nsIFocusManager::MOVEFOCUS_ROOT)) :
(aForDocumentNavigation ? static_cast<uint32_t>(nsIFocusManager::MOVEFOCUS_LASTDOC) :
static_cast<uint32_t>(nsIFocusManager::MOVEFOCUS_LAST));
fm->MoveFocus(window, nullptr, type,
fm->MoveFocus(window, nullptr, aForward ? nsIFocusManager::MOVEFOCUS_FIRSTDOC :
nsIFocusManager::MOVEFOCUS_LASTDOC,
nsIFocusManager::FLAG_BYKEY, getter_AddRefs(result));
// No valid root element was found, so move to the first focusable element.
if (!result && aForward && !aForDocumentNavigation) {
fm->MoveFocus(window, nullptr, nsIFocusManager::MOVEFOCUS_FIRST,
nsIFocusManager::FLAG_BYKEY, getter_AddRefs(result));
}
SendRequestFocus(false);
}

View File

@ -525,7 +525,7 @@ protected:
virtual bool RecvDestroy() override;
virtual bool RecvSetUpdateHitRegion(const bool& aEnabled) override;
virtual bool RecvSetIsDocShellActive(const bool& aIsActive) override;
virtual bool RecvNavigateByKey(const bool& aForward, const bool& aForDocumentNavigation) override;
virtual bool RecvNavigateDocument(const bool& aForward) override;
virtual bool RecvRequestNotifyAfterRemotePaint() override;

View File

@ -2950,9 +2950,9 @@ TabParent::SetHasContentOpener(bool aHasContentOpener)
}
NS_IMETHODIMP
TabParent::NavigateByKey(bool aForward, bool aForDocumentNavigation)
TabParent::NavigateDocument(bool aForward)
{
unused << SendNavigateByKey(aForward, aForDocumentNavigation);
unused << SendNavigateDocument(aForward);
return NS_OK;
}