| 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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 const SetSelectionOptions options = CloseTyping | ClearTypingStyle; | 265 const SetSelectionOptions options = CloseTyping | ClearTypingStyle; |
| 266 setSelection(newSelection, options, CursorAlignOnScroll::IfNeeded, granulari
ty); | 266 setSelection(newSelection, options, CursorAlignOnScroll::IfNeeded, granulari
ty); |
| 267 } | 267 } |
| 268 | 268 |
| 269 void FrameSelection::setNonDirectionalSelectionIfNeeded(const VisibleSelection&
passedNewSelection, TextGranularity granularity, EndPointsAdjustmentMode endpoin
tsAdjustmentMode) | |
| 270 { | |
| 271 setNonDirectionalSelectionIfNeededAlgorithm<EditingStrategy>(passedNewSelect
ion, granularity, endpointsAdjustmentMode); | |
| 272 } | |
| 273 | |
| 274 void FrameSelection::setNonDirectionalSelectionIfNeeded(const VisibleSelectionIn
FlatTree& passedNewSelection, TextGranularity granularity, EndPointsAdjustmentMo
de endpointsAdjustmentMode) | 269 void FrameSelection::setNonDirectionalSelectionIfNeeded(const VisibleSelectionIn
FlatTree& passedNewSelection, TextGranularity granularity, EndPointsAdjustmentMo
de endpointsAdjustmentMode) |
| 275 { | 270 { |
| 276 setNonDirectionalSelectionIfNeededAlgorithm<EditingInFlatTreeStrategy>(passe
dNewSelection, granularity, endpointsAdjustmentMode); | 271 setNonDirectionalSelectionIfNeededAlgorithm<EditingInFlatTreeStrategy>(passe
dNewSelection, granularity, endpointsAdjustmentMode); |
| 277 } | 272 } |
| 278 | 273 |
| 279 template <typename Strategy> | 274 template <typename Strategy> |
| 280 void FrameSelection::setSelectionAlgorithm(const VisibleSelectionTemplate<Strate
gy>& newSelection, SetSelectionOptions options, CursorAlignOnScroll align, TextG
ranularity granularity) | 275 void FrameSelection::setSelectionAlgorithm(const VisibleSelectionTemplate<Strate
gy>& newSelection, SetSelectionOptions options, CursorAlignOnScroll align, TextG
ranularity granularity) |
| 281 { | 276 { |
| 282 if (m_granularityStrategy && (options & FrameSelection::DoNotClearStrategy)
== 0) | 277 if (m_granularityStrategy && (options & FrameSelection::DoNotClearStrategy)
== 0) |
| 283 m_granularityStrategy->Clear(); | 278 m_granularityStrategy->Clear(); |
| (...skipping 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1369 | 1364 |
| 1370 void showTree(const blink::FrameSelection* sel) | 1365 void showTree(const blink::FrameSelection* sel) |
| 1371 { | 1366 { |
| 1372 if (sel) | 1367 if (sel) |
| 1373 sel->showTreeForThis(); | 1368 sel->showTreeForThis(); |
| 1374 else | 1369 else |
| 1375 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); | 1370 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); |
| 1376 } | 1371 } |
| 1377 | 1372 |
| 1378 #endif | 1373 #endif |
| OLD | NEW |