| 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 { | 161 { |
| 162 return visibleSelection<EditingInFlatTreeStrategy>(); | 162 return visibleSelection<EditingInFlatTreeStrategy>(); |
| 163 } | 163 } |
| 164 | 164 |
| 165 void FrameSelection::moveTo(const VisiblePosition &pos, EUserTriggered userTrigg
ered, CursorAlignOnScroll align) | 165 void FrameSelection::moveTo(const VisiblePosition &pos, EUserTriggered userTrigg
ered, CursorAlignOnScroll align) |
| 166 { | 166 { |
| 167 SetSelectionOptions options = CloseTyping | ClearTypingStyle | userTriggered
; | 167 SetSelectionOptions options = CloseTyping | ClearTypingStyle | userTriggered
; |
| 168 setSelection(VisibleSelection(pos, pos, selection().isDirectional()), option
s, align); | 168 setSelection(VisibleSelection(pos, pos, selection().isDirectional()), option
s, align); |
| 169 } | 169 } |
| 170 | 170 |
| 171 void FrameSelection::moveTo(const VisiblePosition &base, const VisiblePosition &
extent, EUserTriggered userTriggered) | |
| 172 { | |
| 173 const bool selectionHasDirection = true; | |
| 174 SetSelectionOptions options = CloseTyping | ClearTypingStyle | userTriggered
; | |
| 175 setSelection(VisibleSelection(base, extent, selectionHasDirection), options)
; | |
| 176 } | |
| 177 | |
| 178 void FrameSelection::moveTo(const Position &pos, TextAffinity affinity) | 171 void FrameSelection::moveTo(const Position &pos, TextAffinity affinity) |
| 179 { | 172 { |
| 180 SetSelectionOptions options = CloseTyping | ClearTypingStyle; | 173 SetSelectionOptions options = CloseTyping | ClearTypingStyle; |
| 181 setSelection(VisibleSelection(pos, affinity, selection().isDirectional()), o
ptions); | 174 setSelection(VisibleSelection(pos, affinity, selection().isDirectional()), o
ptions); |
| 182 } | 175 } |
| 183 | 176 |
| 184 template <typename Strategy> | 177 template <typename Strategy> |
| 185 static void adjustEndpointsAtBidiBoundary(VisiblePositionTemplate<Strategy>& vis
ibleBase, VisiblePositionTemplate<Strategy>& visibleExtent) | 178 static void adjustEndpointsAtBidiBoundary(VisiblePositionTemplate<Strategy>& vis
ibleBase, VisiblePositionTemplate<Strategy>& visibleExtent) |
| 186 { | 179 { |
| 187 RenderedPosition base(visibleBase); | 180 RenderedPosition base(visibleBase); |
| (...skipping 1196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1384 | 1377 |
| 1385 void showTree(const blink::FrameSelection* sel) | 1378 void showTree(const blink::FrameSelection* sel) |
| 1386 { | 1379 { |
| 1387 if (sel) | 1380 if (sel) |
| 1388 sel->showTreeForThis(); | 1381 sel->showTreeForThis(); |
| 1389 else | 1382 else |
| 1390 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); | 1383 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); |
| 1391 } | 1384 } |
| 1392 | 1385 |
| 1393 #endif | 1386 #endif |
| OLD | NEW |