OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 if (visibleSelection<Strategy>().base() == newSelection.base()) | 255 if (visibleSelection<Strategy>().base() == newSelection.base()) |
256 newSelection.setBase(originalBase); | 256 newSelection.setBase(originalBase); |
257 setOriginalBase(VisiblePositionTemplate<Strategy>()); | 257 setOriginalBase(VisiblePositionTemplate<Strategy>()); |
258 } | 258 } |
259 | 259 |
260 // Adjusting base and extent will make newSelection always directional | 260 // Adjusting base and extent will make newSelection always directional |
261 newSelection.setIsDirectional(isDirectional); | 261 newSelection.setIsDirectional(isDirectional); |
262 if (visibleSelection<Strategy>() == newSelection) | 262 if (visibleSelection<Strategy>() == newSelection) |
263 return; | 263 return; |
264 | 264 |
265 setSelection(newSelection, granularity); | 265 const SetSelectionOptions options = CloseTyping | ClearTypingStyle; |
| 266 setSelection(newSelection, options, CursorAlignOnScroll::IfNeeded, granulari
ty); |
266 } | 267 } |
267 | 268 |
268 void FrameSelection::setNonDirectionalSelectionIfNeeded(const VisibleSelection&
passedNewSelection, TextGranularity granularity, EndPointsAdjustmentMode endpoin
tsAdjustmentMode) | 269 void FrameSelection::setNonDirectionalSelectionIfNeeded(const VisibleSelection&
passedNewSelection, TextGranularity granularity, EndPointsAdjustmentMode endpoin
tsAdjustmentMode) |
269 { | 270 { |
270 setNonDirectionalSelectionIfNeededAlgorithm<EditingStrategy>(passedNewSelect
ion, granularity, endpointsAdjustmentMode); | 271 setNonDirectionalSelectionIfNeededAlgorithm<EditingStrategy>(passedNewSelect
ion, granularity, endpointsAdjustmentMode); |
271 } | 272 } |
272 | 273 |
273 void FrameSelection::setNonDirectionalSelectionIfNeeded(const VisibleSelectionIn
FlatTree& passedNewSelection, TextGranularity granularity, EndPointsAdjustmentMo
de endpointsAdjustmentMode) | 274 void FrameSelection::setNonDirectionalSelectionIfNeeded(const VisibleSelectionIn
FlatTree& passedNewSelection, TextGranularity granularity, EndPointsAdjustmentMo
de endpointsAdjustmentMode) |
274 { | 275 { |
275 setNonDirectionalSelectionIfNeededAlgorithm<EditingInFlatTreeStrategy>(passe
dNewSelection, granularity, endpointsAdjustmentMode); | 276 setNonDirectionalSelectionIfNeededAlgorithm<EditingInFlatTreeStrategy>(passe
dNewSelection, granularity, endpointsAdjustmentMode); |
(...skipping 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1361 | 1362 |
1362 void showTree(const blink::FrameSelection* sel) | 1363 void showTree(const blink::FrameSelection* sel) |
1363 { | 1364 { |
1364 if (sel) | 1365 if (sel) |
1365 sel->showTreeForThis(); | 1366 sel->showTreeForThis(); |
1366 else | 1367 else |
1367 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); | 1368 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); |
1368 } | 1369 } |
1369 | 1370 |
1370 #endif | 1371 #endif |
OLD | NEW |