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

Side by Side Diff: third_party/WebKit/Source/core/editing/Editor.cpp

Issue 1810293002: Set sequential focus navigation starting point on scrollIntoView() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use testRunner.findString() for testing findText. Created 4 years, 9 months 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
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 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after
1191 frame().selection().revealSelection(); 1191 frame().selection().revealSelection();
1192 return true; 1192 return true;
1193 } 1193 }
1194 1194
1195 PassRefPtrWillBeRawPtr<Range> Editor::findStringAndScrollToVisible(const String& target, Range* previousMatch, FindOptions options) 1195 PassRefPtrWillBeRawPtr<Range> Editor::findStringAndScrollToVisible(const String& target, Range* previousMatch, FindOptions options)
1196 { 1196 {
1197 RefPtrWillBeRawPtr<Range> nextMatch = findRangeOfString(target, EphemeralRan geInFlatTree(previousMatch), options); 1197 RefPtrWillBeRawPtr<Range> nextMatch = findRangeOfString(target, EphemeralRan geInFlatTree(previousMatch), options);
1198 if (!nextMatch) 1198 if (!nextMatch)
1199 return nullptr; 1199 return nullptr;
1200 1200
1201 nextMatch->firstNode()->layoutObject()->scrollRectToVisible(LayoutRect(nextM atch->boundingBox()), 1201 Node* firstNode = nextMatch->firstNode();
1202 firstNode->layoutObject()->scrollRectToVisible(LayoutRect(nextMatch->boundin gBox()),
1202 ScrollAlignment::alignCenterIfNeeded, ScrollAlignment::alignCenterIfNeed ed, UserScroll); 1203 ScrollAlignment::alignCenterIfNeeded, ScrollAlignment::alignCenterIfNeed ed, UserScroll);
1204 firstNode->document().setSequentialFocusNavigationStartingPoint(firstNode);
1203 1205
1204 return nextMatch.release(); 1206 return nextMatch.release();
1205 } 1207 }
1206 1208
1207 // TODO(yosin) We should return |EphemeralRange| rather than |Range|. We use 1209 // TODO(yosin) We should return |EphemeralRange| rather than |Range|. We use
1208 // |Range| object for checking whether start and end position crossing shadow 1210 // |Range| object for checking whether start and end position crossing shadow
1209 // boundaries, however we can do it without |Range| object. 1211 // boundaries, however we can do it without |Range| object.
1210 template <typename Strategy> 1212 template <typename Strategy>
1211 static PassRefPtrWillBeRawPtr<Range> findStringBetweenPositions(const String& ta rget, const EphemeralRangeTemplate<Strategy>& referenceRange, FindOptions option s) 1213 static PassRefPtrWillBeRawPtr<Range> findStringBetweenPositions(const String& ta rget, const EphemeralRangeTemplate<Strategy>& referenceRange, FindOptions option s)
1212 { 1214 {
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
1369 } 1371 }
1370 1372
1371 DEFINE_TRACE(Editor) 1373 DEFINE_TRACE(Editor)
1372 { 1374 {
1373 visitor->trace(m_frame); 1375 visitor->trace(m_frame);
1374 visitor->trace(m_lastEditCommand); 1376 visitor->trace(m_lastEditCommand);
1375 visitor->trace(m_mark); 1377 visitor->trace(m_mark);
1376 } 1378 }
1377 1379
1378 } // namespace blink 1380 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698