Commit a29f9f1e authored by tkent@chromium.org's avatar tkent@chromium.org

Improve consistency of nextNodeWithGreaterTabIndex() and previousNodeWithLowerTabIndex().

* nextNodeWithGreaterTabIndex:
  Set |currentTabIndex| to |winningTabIndex|
  They are same in the |if| block.  However |currentTabIndex| looks better.

* previousNodeWithLowerTabIndex:
  Remove isNonKeyboardFocusableShadowHost() check.  It's redandunt because
  shouldVisit() contains it.

BUG=
TEST=none; no behavior changes

Review URL: https://codereview.chromium.org/700313002

git-svn-id: svn://svn.chromium.org/blink/trunk@184889 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 15fc1f42
...@@ -549,7 +549,7 @@ static Node* nextNodeWithGreaterTabIndex(Node* start, int tabIndex) ...@@ -549,7 +549,7 @@ static Node* nextNodeWithGreaterTabIndex(Node* start, int tabIndex)
int currentTabIndex = adjustedTabIndex(&node); int currentTabIndex = adjustedTabIndex(&node);
if (shouldVisit(&node) && currentTabIndex > tabIndex && currentTabIndex < winningTabIndex) { if (shouldVisit(&node) && currentTabIndex > tabIndex && currentTabIndex < winningTabIndex) {
winner = &node; winner = &node;
winningTabIndex = node.tabIndex(); winningTabIndex = currentTabIndex;
} }
} }
...@@ -563,7 +563,7 @@ static Node* previousNodeWithLowerTabIndex(Node* start, int tabIndex) ...@@ -563,7 +563,7 @@ static Node* previousNodeWithLowerTabIndex(Node* start, int tabIndex)
Node* winner = nullptr; Node* winner = nullptr;
for (Node* node = start; node; node = NodeTraversal::previous(*node)) { for (Node* node = start; node; node = NodeTraversal::previous(*node)) {
int currentTabIndex = adjustedTabIndex(node); int currentTabIndex = adjustedTabIndex(node);
if ((shouldVisit(node) || isNonKeyboardFocusableShadowHost(node)) && currentTabIndex < tabIndex && currentTabIndex > winningTabIndex) { if (shouldVisit(node) && currentTabIndex < tabIndex && currentTabIndex > winningTabIndex) {
winner = node; winner = node;
winningTabIndex = currentTabIndex; winningTabIndex = currentTabIndex;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment