OLD | NEW |
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 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1202 return nullptr; | 1202 return nullptr; |
1203 | 1203 |
1204 nextMatch->firstNode()->layoutObject()->scrollRectToVisible(LayoutRect(nextM
atch->boundingBox()), | 1204 nextMatch->firstNode()->layoutObject()->scrollRectToVisible(LayoutRect(nextM
atch->boundingBox()), |
1205 ScrollAlignment::alignCenterIfNeeded, ScrollAlignment::alignCenterIfNeed
ed, UserScroll); | 1205 ScrollAlignment::alignCenterIfNeeded, ScrollAlignment::alignCenterIfNeed
ed, UserScroll); |
1206 | 1206 |
1207 return nextMatch.release(); | 1207 return nextMatch.release(); |
1208 } | 1208 } |
1209 | 1209 |
1210 PassRefPtrWillBeRawPtr<Range> Editor::findStringAndScrollToVisible(const String&
target, Range* range, FindOptions options) | 1210 PassRefPtrWillBeRawPtr<Range> Editor::findStringAndScrollToVisible(const String&
target, Range* range, FindOptions options) |
1211 { | 1211 { |
1212 if (RuntimeEnabledFeatures::selectionForComposedTreeEnabled()) | 1212 if (RuntimeEnabledFeatures::selectionForFlatTreeEnabled()) |
1213 return findStringAndScrollToVisibleAlgorithm<EditingInComposedTreeStrate
gy>(*this, target, EphemeralRangeInComposedTree(range), options); | 1213 return findStringAndScrollToVisibleAlgorithm<EditingInFlatTreeStrategy>(
*this, target, EphemeralRangeInFlatTree(range), options); |
1214 return findStringAndScrollToVisibleAlgorithm<EditingStrategy>(*this, target,
EphemeralRange(range), options); | 1214 return findStringAndScrollToVisibleAlgorithm<EditingStrategy>(*this, target,
EphemeralRange(range), options); |
1215 } | 1215 } |
1216 | 1216 |
1217 // TODO(yosin) We should return |EphemeralRange| rather than |Range|. We use | 1217 // TODO(yosin) We should return |EphemeralRange| rather than |Range|. We use |
1218 // |Range| object for checking whether start and end position crossing shadow | 1218 // |Range| object for checking whether start and end position crossing shadow |
1219 // boundaries, however we can do it without |Range| object. | 1219 // boundaries, however we can do it without |Range| object. |
1220 template <typename Strategy> | 1220 template <typename Strategy> |
1221 static PassRefPtrWillBeRawPtr<Range> findStringBetweenPositions(const String& ta
rget, const EphemeralRangeTemplate<Strategy>& referenceRange, FindOptions option
s) | 1221 static PassRefPtrWillBeRawPtr<Range> findStringBetweenPositions(const String& ta
rget, const EphemeralRangeTemplate<Strategy>& referenceRange, FindOptions option
s) |
1222 { | 1222 { |
1223 EphemeralRangeTemplate<Strategy> searchRange(referenceRange); | 1223 EphemeralRangeTemplate<Strategy> searchRange(referenceRange); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1296 return findStringBetweenPositions(target, documentRange, options); | 1296 return findStringBetweenPositions(target, documentRange, options); |
1297 | 1297 |
1298 return resultRange.release(); | 1298 return resultRange.release(); |
1299 } | 1299 } |
1300 | 1300 |
1301 PassRefPtrWillBeRawPtr<Range> Editor::findRangeOfString(const String& target, co
nst EphemeralRange& reference, FindOptions options) | 1301 PassRefPtrWillBeRawPtr<Range> Editor::findRangeOfString(const String& target, co
nst EphemeralRange& reference, FindOptions options) |
1302 { | 1302 { |
1303 return findRangeOfStringAlgorithm<EditingStrategy>(*frame().document(), targ
et, reference, options); | 1303 return findRangeOfStringAlgorithm<EditingStrategy>(*frame().document(), targ
et, reference, options); |
1304 } | 1304 } |
1305 | 1305 |
1306 PassRefPtrWillBeRawPtr<Range> Editor::findRangeOfString(const String& target, co
nst EphemeralRangeInComposedTree& reference, FindOptions options) | 1306 PassRefPtrWillBeRawPtr<Range> Editor::findRangeOfString(const String& target, co
nst EphemeralRangeInFlatTree& reference, FindOptions options) |
1307 { | 1307 { |
1308 return findRangeOfStringAlgorithm<EditingInComposedTreeStrategy>(*frame().do
cument(), target, reference, options); | 1308 return findRangeOfStringAlgorithm<EditingInFlatTreeStrategy>(*frame().docume
nt(), target, reference, options); |
1309 } | 1309 } |
1310 | 1310 |
1311 void Editor::setMarkedTextMatchesAreHighlighted(bool flag) | 1311 void Editor::setMarkedTextMatchesAreHighlighted(bool flag) |
1312 { | 1312 { |
1313 if (flag == m_areMarkedTextMatchesHighlighted) | 1313 if (flag == m_areMarkedTextMatchesHighlighted) |
1314 return; | 1314 return; |
1315 | 1315 |
1316 m_areMarkedTextMatchesHighlighted = flag; | 1316 m_areMarkedTextMatchesHighlighted = flag; |
1317 frame().document()->markers().repaintMarkers(DocumentMarker::TextMatch); | 1317 frame().document()->markers().repaintMarkers(DocumentMarker::TextMatch); |
1318 } | 1318 } |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1379 } | 1379 } |
1380 | 1380 |
1381 DEFINE_TRACE(Editor) | 1381 DEFINE_TRACE(Editor) |
1382 { | 1382 { |
1383 visitor->trace(m_frame); | 1383 visitor->trace(m_frame); |
1384 visitor->trace(m_lastEditCommand); | 1384 visitor->trace(m_lastEditCommand); |
1385 visitor->trace(m_mark); | 1385 visitor->trace(m_mark); |
1386 } | 1386 } |
1387 | 1387 |
1388 } // namespace blink | 1388 } // namespace blink |
OLD | NEW |