Commit 5c3391fb authored by tkent@chromium.org's avatar tkent@chromium.org

Fix a bug of sequential focus navigation with <select multiple>, and so on.

<select multiple>, <select size=2-or-greater>, and <input
type=date/datetime-local/month/time/week> had a bug that they prevented
sequential focus navigation even if they were not focusabble.

Change nextNodeWithGreaterTabIndex() so that it uses adjustedTabIndex().

BUG=425937
TEST=automated

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

git-svn-id: svn://svn.chromium.org/blink/trunk@184877 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent b3fc2dac
......@@ -21,6 +21,10 @@ function prepareDOMTree(parent)
createDOM('div', {'id': 'host-A', 'tabindex': -1},
createShadowRoot(
createDOM('input', {'id': 'input-1', 'tabindex': 1}),
createDOM('div', {'tabindex': 2, 'style': 'visibility:hidden;'},
createShadowRoot()),
createDOM('input', {'tabindex': 3, 'type': 'date', 'disabled': ''}),
createDOM('select', {'tabindex': 4, 'multiple': '', 'disabled': ''}),
createDOM('div', {'id': 'nested-host', 'tabindex': 30},
createShadowRoot(
createDOM('input', {'tabindex': -1}),
......
......@@ -546,7 +546,8 @@ static Node* nextNodeWithGreaterTabIndex(Node* start, int tabIndex)
int winningTabIndex = std::numeric_limits<short>::max() + 1;
Node* winner = nullptr;
for (Node& node : NodeTraversal::startsAt(start)) {
if (shouldVisit(&node) && node.tabIndex() > tabIndex && node.tabIndex() < winningTabIndex) {
int currentTabIndex = adjustedTabIndex(&node);
if (shouldVisit(&node) && currentTabIndex > tabIndex && currentTabIndex < winningTabIndex) {
winner = &node;
winningTabIndex = node.tabIndex();
}
......
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