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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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) | 171 void FrameSelection::moveTo(const VisiblePosition &base, const VisiblePosition &
extent, EUserTriggered userTriggered) |
172 { | 172 { |
173 const bool selectionHasDirection = true; | 173 const bool selectionHasDirection = true; |
174 SetSelectionOptions options = CloseTyping | ClearTypingStyle | userTriggered
; | 174 SetSelectionOptions options = CloseTyping | ClearTypingStyle | userTriggered
; |
175 setSelection(VisibleSelection(base, extent, selectionHasDirection), options)
; | 175 setSelection(VisibleSelection(base, extent, selectionHasDirection), options)
; |
176 } | 176 } |
177 | 177 |
178 void FrameSelection::moveTo(const Position &pos, TextAffinity affinity, EUserTri
ggered userTriggered) | 178 void FrameSelection::moveTo(const Position &pos, TextAffinity affinity) |
179 { | 179 { |
180 SetSelectionOptions options = CloseTyping | ClearTypingStyle | userTriggered
; | 180 SetSelectionOptions options = CloseTyping | ClearTypingStyle; |
181 setSelection(VisibleSelection(pos, affinity, selection().isDirectional()), o
ptions); | 181 setSelection(VisibleSelection(pos, affinity, selection().isDirectional()), o
ptions); |
182 } | 182 } |
183 | 183 |
184 template <typename Strategy> | 184 template <typename Strategy> |
185 static void adjustEndpointsAtBidiBoundary(VisiblePositionTemplate<Strategy>& vis
ibleBase, VisiblePositionTemplate<Strategy>& visibleExtent) | 185 static void adjustEndpointsAtBidiBoundary(VisiblePositionTemplate<Strategy>& vis
ibleBase, VisiblePositionTemplate<Strategy>& visibleExtent) |
186 { | 186 { |
187 RenderedPosition base(visibleBase); | 187 RenderedPosition base(visibleBase); |
188 RenderedPosition extent(visibleExtent); | 188 RenderedPosition extent(visibleExtent); |
189 | 189 |
190 if (base.isNull() || extent.isNull() || base.isEquivalent(extent)) | 190 if (base.isNull() || extent.isNull() || base.isEquivalent(extent)) |
(...skipping 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1361 | 1361 |
1362 void showTree(const blink::FrameSelection* sel) | 1362 void showTree(const blink::FrameSelection* sel) |
1363 { | 1363 { |
1364 if (sel) | 1364 if (sel) |
1365 sel->showTreeForThis(); | 1365 sel->showTreeForThis(); |
1366 else | 1366 else |
1367 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); | 1367 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); |
1368 } | 1368 } |
1369 | 1369 |
1370 #endif | 1370 #endif |
OLD | NEW |