OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2004 Apple Computer, 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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 bool m_baseIsFirst : 1; // True if base is before the extent | 198 bool m_baseIsFirst : 1; // True if base is before the extent |
199 bool m_isDirectional : 1; // Non-directional ignores m_baseIsFirst and selec
tion always extends on shift + arrow key. | 199 bool m_isDirectional : 1; // Non-directional ignores m_baseIsFirst and selec
tion always extends on shift + arrow key. |
200 }; | 200 }; |
201 | 201 |
202 extern template class CORE_EXTERN_TEMPLATE_EXPORT VisibleSelectionTemplate<Editi
ngStrategy>; | 202 extern template class CORE_EXTERN_TEMPLATE_EXPORT VisibleSelectionTemplate<Editi
ngStrategy>; |
203 extern template class CORE_EXTERN_TEMPLATE_EXPORT VisibleSelectionTemplate<Editi
ngInComposedTreeStrategy>; | 203 extern template class CORE_EXTERN_TEMPLATE_EXPORT VisibleSelectionTemplate<Editi
ngInComposedTreeStrategy>; |
204 | 204 |
205 using VisibleSelection = VisibleSelectionTemplate<EditingStrategy>; | 205 using VisibleSelection = VisibleSelectionTemplate<EditingStrategy>; |
206 using VisibleSelectionInComposedTree = VisibleSelectionTemplate<EditingInCompose
dTreeStrategy>; | 206 using VisibleSelectionInComposedTree = VisibleSelectionTemplate<EditingInCompose
dTreeStrategy>; |
207 | 207 |
| 208 // TODO(yosin): We should move |SelectionAdjuster| to its own file. |
| 209 class SelectionAdjuster final { |
| 210 STATIC_ONLY(SelectionAdjuster); |
| 211 public: |
| 212 static void adjustSelectionInComposedTree(VisibleSelectionInComposedTree*, c
onst VisibleSelection&); |
| 213 static void adjustSelectionInDOMTree(VisibleSelection*, const VisibleSelecti
onInComposedTree&); |
| 214 static void adjustSelectionToAvoidCrossingShadowBoundaries(VisibleSelection*
); |
| 215 static void adjustSelectionToAvoidCrossingShadowBoundaries(VisibleSelectionI
nComposedTree*); |
| 216 }; |
| 217 |
208 // TODO(yosin): We should use |operator==()| instead of | 218 // TODO(yosin): We should use |operator==()| instead of |
209 // |equalSelectionsInDOMTree()|. | 219 // |equalSelectionsInDOMTree()|. |
210 bool equalSelectionsInDOMTree(const VisibleSelection&, const VisibleSelection&); | 220 bool equalSelectionsInDOMTree(const VisibleSelection&, const VisibleSelection&); |
211 | 221 |
212 // We don't yet support multi-range selections, so we only ever have one range | 222 // We don't yet support multi-range selections, so we only ever have one range |
213 // to return. | 223 // to return. |
214 CORE_EXPORT EphemeralRange firstEphemeralRangeOf(const VisibleSelection&); | 224 CORE_EXPORT EphemeralRange firstEphemeralRangeOf(const VisibleSelection&); |
215 | 225 |
216 // TODO(sof): move more firstRangeOf() uses to be over EphemeralRange instead. | 226 // TODO(sof): move more firstRangeOf() uses to be over EphemeralRange instead. |
217 CORE_EXPORT PassRefPtrWillBeRawPtr<Range> firstRangeOf(const VisibleSelection&); | 227 CORE_EXPORT PassRefPtrWillBeRawPtr<Range> firstRangeOf(const VisibleSelection&); |
218 | 228 |
219 } // namespace blink | 229 } // namespace blink |
220 | 230 |
221 #ifndef NDEBUG | 231 #ifndef NDEBUG |
222 // Outside the WebCore namespace for ease of invocation from gdb. | 232 // Outside the WebCore namespace for ease of invocation from gdb. |
223 void showTree(const blink::VisibleSelection&); | 233 void showTree(const blink::VisibleSelection&); |
224 void showTree(const blink::VisibleSelection*); | 234 void showTree(const blink::VisibleSelection*); |
225 void showTree(const blink::VisibleSelectionInComposedTree&); | 235 void showTree(const blink::VisibleSelectionInComposedTree&); |
226 void showTree(const blink::VisibleSelectionInComposedTree*); | 236 void showTree(const blink::VisibleSelectionInComposedTree*); |
227 #endif | 237 #endif |
228 | 238 |
229 #endif // VisibleSelection_h | 239 #endif // VisibleSelection_h |
OLD | NEW |