Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008 Nuanti Ltd. | 3 * Copyright (C) 2008 Nuanti Ltd. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 539 } | 539 } |
| 540 return nullptr; | 540 return nullptr; |
| 541 } | 541 } |
| 542 | 542 |
| 543 static Node* nextNodeWithGreaterTabIndex(Node* start, int tabIndex) | 543 static Node* nextNodeWithGreaterTabIndex(Node* start, int tabIndex) |
| 544 { | 544 { |
| 545 // Search is inclusive of start | 545 // Search is inclusive of start |
| 546 int winningTabIndex = std::numeric_limits<short>::max() + 1; | 546 int winningTabIndex = std::numeric_limits<short>::max() + 1; |
| 547 Node* winner = nullptr; | 547 Node* winner = nullptr; |
| 548 for (Node& node : NodeTraversal::startsAt(start)) { | 548 for (Node& node : NodeTraversal::startsAt(start)) { |
| 549 if (shouldVisit(&node) && node.tabIndex() > tabIndex && node.tabIndex() < winningTabIndex) { | 549 int currentTabIndex = adjustedTabIndex(&node); |
| 550 if (shouldVisit(&node) && currentTabIndex > tabIndex && currentTabIndex < winningTabIndex) { | |
| 550 winner = &node; | 551 winner = &node; |
| 551 winningTabIndex = node.tabIndex(); | 552 winningTabIndex = node.tabIndex(); |
|
kochi
2014/11/05 17:33:48
Why this isn't currentTabIndex?
tkent
2014/11/05 23:24:00
I think |currentTabIndex| and |node.tabIndex()| ar
| |
| 552 } | 553 } |
| 553 } | 554 } |
| 554 | 555 |
| 555 return winner; | 556 return winner; |
| 556 } | 557 } |
| 557 | 558 |
| 558 static Node* previousNodeWithLowerTabIndex(Node* start, int tabIndex) | 559 static Node* previousNodeWithLowerTabIndex(Node* start, int tabIndex) |
| 559 { | 560 { |
| 560 // Search is inclusive of start | 561 // Search is inclusive of start |
| 561 int winningTabIndex = 0; | 562 int winningTabIndex = 0; |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 927 return consumed; | 928 return consumed; |
| 928 } | 929 } |
| 929 | 930 |
| 930 void FocusController::trace(Visitor* visitor) | 931 void FocusController::trace(Visitor* visitor) |
| 931 { | 932 { |
| 932 visitor->trace(m_page); | 933 visitor->trace(m_page); |
| 933 visitor->trace(m_focusedFrame); | 934 visitor->trace(m_focusedFrame); |
| 934 } | 935 } |
| 935 | 936 |
| 936 } // namespace blink | 937 } // namespace blink |
| OLD | NEW |