Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(882)

Unified Diff: Source/core/page/FocusController.cpp

Issue 67473002: Have ElementTraversal / NodeTraversal's next() methods take a reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase on master Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/inspector/InspectorDOMAgent.cpp ('k') | Source/core/page/TouchDisambiguation.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/FocusController.cpp
diff --git a/Source/core/page/FocusController.cpp b/Source/core/page/FocusController.cpp
index fedbebfc32e8a490911e0e7247a675c6c5309f0f..f0df193b3b447370976138bf8de40fda8397a6e2 100644
--- a/Source/core/page/FocusController.cpp
+++ b/Source/core/page/FocusController.cpp
@@ -468,7 +468,7 @@ Node* FocusController::findFocusableNode(FocusDirection direction, FocusNavigati
Node* FocusController::findNodeWithExactTabIndex(Node* start, int tabIndex, FocusDirection direction)
{
// Search is inclusive of start
- for (Node* node = start; node; node = direction == FocusDirectionForward ? NodeTraversal::next(node) : NodeTraversal::previous(node)) {
+ for (Node* node = start; node; node = direction == FocusDirectionForward ? NodeTraversal::next(*node) : NodeTraversal::previous(node)) {
if (shouldVisit(node) && adjustedTabIndex(node) == tabIndex)
return node;
}
@@ -480,7 +480,7 @@ static Node* nextNodeWithGreaterTabIndex(Node* start, int tabIndex)
// Search is inclusive of start
int winningTabIndex = std::numeric_limits<short>::max() + 1;
Node* winner = 0;
- for (Node* node = start; node; node = NodeTraversal::next(node)) {
+ for (Node* node = start; node; node = NodeTraversal::next(*node)) {
if (shouldVisit(node) && node->tabIndex() > tabIndex && node->tabIndex() < winningTabIndex) {
winner = node;
winningTabIndex = node->tabIndex();
@@ -511,14 +511,14 @@ Node* FocusController::nextFocusableNode(FocusNavigationScope scope, Node* start
int tabIndex = adjustedTabIndex(start);
// If a node is excluded from the normal tabbing cycle, the next focusable node is determined by tree order
if (tabIndex < 0) {
- for (Node* node = NodeTraversal::next(start); node; node = NodeTraversal::next(node)) {
+ for (Node* node = NodeTraversal::next(*start); node; node = NodeTraversal::next(*node)) {
if (shouldVisit(node) && adjustedTabIndex(node) >= 0)
return node;
}
}
// First try to find a node with the same tabindex as start that comes after start in the scope.
- if (Node* winner = findNodeWithExactTabIndex(NodeTraversal::next(start), tabIndex, FocusDirectionForward))
+ if (Node* winner = findNodeWithExactTabIndex(NodeTraversal::next(*start), tabIndex, FocusDirectionForward))
return winner;
if (!tabIndex)
@@ -780,7 +780,7 @@ void FocusController::findFocusCandidateInContainer(Node* container, const Layou
for (; element; element = (element->isFrameOwnerElement() || canScrollInDirection(element, direction))
? ElementTraversal::nextSkippingChildren(element, container)
- : ElementTraversal::next(element, container)) {
+ : ElementTraversal::next(*element, container)) {
if (element == focusedElement)
continue;
« no previous file with comments | « Source/core/inspector/InspectorDOMAgent.cpp ('k') | Source/core/page/TouchDisambiguation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698