summaryrefslogtreecommitdiffstats
path: root/dom/base/nsFocusManager.h
diff options
context:
space:
mode:
Diffstat (limited to 'dom/base/nsFocusManager.h')
-rw-r--r--dom/base/nsFocusManager.h30
1 files changed, 24 insertions, 6 deletions
diff --git a/dom/base/nsFocusManager.h b/dom/base/nsFocusManager.h
index 6e5c761f4c..4fb9d05e1c 100644
--- a/dom/base/nsFocusManager.h
+++ b/dom/base/nsFocusManager.h
@@ -578,6 +578,10 @@ class nsFocusManager final : public nsIFocusManager,
* aSkipOwner to skip owner while searching. The flag is set when caller is
* |GetNextTabbableContent| in order to let caller handle owner.
*
+ * aReachedToEndForDocumentNavigation is true when this is a document
+ * navigation and the focus algorithm has reached to the end of the top-level
+ * document.
+ *
* NOTE:
* Consider the method searches downwards in flattened subtree
* rooted at aOwner.
@@ -586,7 +590,8 @@ class nsFocusManager final : public nsIFocusManager,
nsIContent* aOwner, nsIContent* aStartContent,
nsIContent* aOriginalStartContent, bool aForward,
int32_t aCurrentTabIndex, bool aIgnoreTabIndex,
- bool aForDocumentNavigation, bool aNavigateByKey, bool aSkipOwner);
+ bool aForDocumentNavigation, bool aNavigateByKey, bool aSkipOwner,
+ bool aReachedToEndForDocumentNavigation);
/**
* Retrieve the next tabbable element in scope including aStartContent
@@ -619,6 +624,10 @@ class nsFocusManager final : public nsIFocusManager,
* aNavigateByKey to move focus by keyboard as a side effect of computing the
* next target.
*
+ * aReachedToEndForDocumentNavigation is true when this is a document
+ * navigation and the focus algorithm has reached to the end of the top-level
+ * document.
+ *
* NOTE:
* Consider the method searches upwards in all shadow host- or slot-rooted
* flattened subtrees that contains aStartContent as non-root, except
@@ -628,7 +637,8 @@ class nsFocusManager final : public nsIFocusManager,
nsIContent* aStartOwner, nsCOMPtr<nsIContent>& aStartContent /* inout */,
nsIContent* aOriginalStartContent, bool aForward,
int32_t* aCurrentTabIndex, bool* aIgnoreTabIndex,
- bool aForDocumentNavigation, bool aNavigateByKey);
+ bool aForDocumentNavigation, bool aNavigateByKey,
+ bool aReachedToEndForDocumentNavigation);
/**
* Retrieve the next tabbable element within a document, using focusability
@@ -663,13 +673,17 @@ class nsFocusManager final : public nsIFocusManager,
*
* aNavigateByKey to move focus by keyboard as a side effect of computing the
* next target.
+ *
+ * aReachedToEndForDocumentNavigation is true when this is a document
+ * navigation and the focus algorithm has reached to the end of the top-level
+ * document.
*/
MOZ_CAN_RUN_SCRIPT nsresult GetNextTabbableContent(
mozilla::PresShell* aPresShell, nsIContent* aRootContent,
nsIContent* aOriginalStartContent, nsIContent* aStartContent,
bool aForward, int32_t aCurrentTabIndex, bool aIgnoreTabIndex,
bool aForDocumentNavigation, bool aNavigateByKey, bool aSkipPopover,
- nsIContent** aResultContent);
+ bool aReachedToEndForDocumentNavigation, nsIContent** aResultContent);
/**
* Get the next tabbable image map area and returns it.
@@ -699,9 +713,13 @@ class nsFocusManager final : public nsIFocusManager,
* Focus the first focusable content within the document with a root node of
* aRootContent. For content documents, this will be aRootContent itself, but
* for chrome documents, this will locate the next focusable content.
+ *
+ * aReachedToEndForDocumentNavigation is true when the focus algorithm has
+ * reached to the end of the top-level document.
*/
- MOZ_CAN_RUN_SCRIPT nsresult FocusFirst(mozilla::dom::Element* aRootContent,
- nsIContent** aNextContent);
+ MOZ_CAN_RUN_SCRIPT nsresult
+ FocusFirst(mozilla::dom::Element* aRootContent, nsIContent** aNextContent,
+ bool aReachedToEndForDocumentNavigation);
/**
* Retrieves and returns the root node from aDocument to be focused. Will
@@ -761,7 +779,7 @@ class nsFocusManager final : public nsIFocusManager,
MOZ_CAN_RUN_SCRIPT bool TryToMoveFocusToSubDocument(
nsIContent* aCurrentContent, nsIContent* aOriginalStartContent,
bool aForward, bool aForDocumentNavigation, bool aNavigateByKey,
- nsIContent** aResultContent);
+ bool aReachedToEndForDocumentNavigation, nsIContent** aResultContent);
// Sets the focused BrowsingContext and, if appropriate, syncs it to
// other processes.