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

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

Issue 2432293002: Fix focus navigation for nested slot case (Closed)
Patch Set: More references Created 4 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 | « third_party/WebKit/Source/core/dom/shadow/SlotScopedTraversalTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/page/FocusController.cpp
diff --git a/third_party/WebKit/Source/core/page/FocusController.cpp b/third_party/WebKit/Source/core/page/FocusController.cpp
index 180f66033404f3c61646f90656a2bfed7c524918..923712914c47a0a149f0df898ff8ed6b9b38b66a 100644
--- a/third_party/WebKit/Source/core/page/FocusController.cpp
+++ b/third_party/WebKit/Source/core/page/FocusController.cpp
@@ -171,13 +171,7 @@ void ScopedFocusNavigation::moveToPrevious() {
void ScopedFocusNavigation::moveToFirst() {
if (m_rootSlot) {
if (!m_slotFallbackTraversal) {
- HeapVector<Member<Node>> assignedNodes = m_rootSlot->assignedNodes();
- for (auto assignedNode : assignedNodes) {
- if (assignedNode->isElementNode()) {
- m_current = toElement(assignedNode);
- break;
- }
- }
+ m_current = SlotScopedTraversal::firstAssignedToSlot(*m_rootSlot);
} else {
Element* first = ElementTraversal::firstChild(*m_rootSlot);
while (first &&
@@ -200,15 +194,7 @@ void ScopedFocusNavigation::moveToFirst() {
void ScopedFocusNavigation::moveToLast() {
if (m_rootSlot) {
if (!m_slotFallbackTraversal) {
- HeapVector<Member<Node>> assignedNodes = m_rootSlot->assignedNodes();
- for (auto assignedNode = assignedNodes.rbegin();
- assignedNode != assignedNodes.rend(); ++assignedNode) {
- if ((*assignedNode)->isElementNode()) {
- m_current =
- ElementTraversal::lastWithinOrSelf(*toElement(*assignedNode));
- break;
- }
- }
+ m_current = SlotScopedTraversal::lastAssignedToSlot(*m_rootSlot);
} else {
Element* last = ElementTraversal::lastWithin(*m_rootSlot);
while (last &&
« no previous file with comments | « third_party/WebKit/Source/core/dom/shadow/SlotScopedTraversalTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698