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

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

Issue 69003004: Have NodeTraversal::previous*() take a reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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/html/forms/RadioInputType.cpp ('k') | Source/core/rendering/RenderCounter.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 f0df193b3b447370976138bf8de40fda8397a6e2..4a64def6ea13d2007dc1493a6a6f5885033fe30c 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;
}
@@ -495,7 +495,7 @@ static Node* previousNodeWithLowerTabIndex(Node* start, int tabIndex)
// Search is inclusive of start
int winningTabIndex = 0;
Node* winner = 0;
- for (Node* node = start; node; node = NodeTraversal::previous(node)) {
+ for (Node* node = start; node; node = NodeTraversal::previous(*node)) {
int currentTabIndex = adjustedTabIndex(node);
if ((shouldVisit(node) || isNonKeyboardFocusableShadowHost(node)) && currentTabIndex < tabIndex && currentTabIndex > winningTabIndex) {
winner = node;
@@ -549,7 +549,7 @@ Node* FocusController::previousFocusableNode(FocusNavigationScope scope, Node* s
Node* startingNode;
int startingTabIndex;
if (start) {
- startingNode = NodeTraversal::previous(start);
+ startingNode = NodeTraversal::previous(*start);
startingTabIndex = adjustedTabIndex(start);
} else {
startingNode = last;
@@ -558,7 +558,7 @@ Node* FocusController::previousFocusableNode(FocusNavigationScope scope, Node* s
// However, if a node is excluded from the normal tabbing cycle, the previous focusable node is determined by tree order
if (startingTabIndex < 0) {
- for (Node* node = startingNode; node; node = NodeTraversal::previous(node)) {
+ for (Node* node = startingNode; node; node = NodeTraversal::previous(*node)) {
if (shouldVisit(node) && adjustedTabIndex(node) >= 0)
return node;
}
« no previous file with comments | « Source/core/html/forms/RadioInputType.cpp ('k') | Source/core/rendering/RenderCounter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698