| 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 | |
| 218 // TODO(yosin): We should use |operator==()| instead of | 208 // TODO(yosin): We should use |operator==()| instead of |
| 219 // |equalSelectionsInDOMTree()|. | 209 // |equalSelectionsInDOMTree()|. |
| 220 bool equalSelectionsInDOMTree(const VisibleSelection&, const VisibleSelection&); | 210 bool equalSelectionsInDOMTree(const VisibleSelection&, const VisibleSelection&); |
| 221 | 211 |
| 222 // We don't yet support multi-range selections, so we only ever have one range | 212 // We don't yet support multi-range selections, so we only ever have one range |
| 223 // to return. | 213 // to return. |
| 224 CORE_EXPORT EphemeralRange firstEphemeralRangeOf(const VisibleSelection&); | 214 CORE_EXPORT EphemeralRange firstEphemeralRangeOf(const VisibleSelection&); |
| 225 | 215 |
| 226 // TODO(sof): move more firstRangeOf() uses to be over EphemeralRange instead. | 216 // TODO(sof): move more firstRangeOf() uses to be over EphemeralRange instead. |
| 227 CORE_EXPORT PassRefPtrWillBeRawPtr<Range> firstRangeOf(const VisibleSelection&); | 217 CORE_EXPORT PassRefPtrWillBeRawPtr<Range> firstRangeOf(const VisibleSelection&); |
| 228 | 218 |
| 229 } // namespace blink | 219 } // namespace blink |
| 230 | 220 |
| 231 #ifndef NDEBUG | 221 #ifndef NDEBUG |
| 232 // Outside the WebCore namespace for ease of invocation from gdb. | 222 // Outside the WebCore namespace for ease of invocation from gdb. |
| 233 void showTree(const blink::VisibleSelection&); | 223 void showTree(const blink::VisibleSelection&); |
| 234 void showTree(const blink::VisibleSelection*); | 224 void showTree(const blink::VisibleSelection*); |
| 235 void showTree(const blink::VisibleSelectionInComposedTree&); | 225 void showTree(const blink::VisibleSelectionInComposedTree&); |
| 236 void showTree(const blink::VisibleSelectionInComposedTree*); | 226 void showTree(const blink::VisibleSelectionInComposedTree*); |
| 237 #endif | 227 #endif |
| 238 | 228 |
| 239 #endif // VisibleSelection_h | 229 #endif // VisibleSelection_h |
| OLD | NEW |