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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
115 bool isNonOrphanedCaretOrRange() const { | 115 bool isNonOrphanedCaretOrRange() const { |
116 return !isNone() && !start().isOrphan() && !end().isOrphan(); | 116 return !isNone() && !start().isOrphan() && !end().isOrphan(); |
117 } | 117 } |
118 | 118 |
119 bool isBaseFirst() const { return m_baseIsFirst; } | 119 bool isBaseFirst() const { return m_baseIsFirst; } |
120 bool isDirectional() const { return m_isDirectional; } | 120 bool isDirectional() const { return m_isDirectional; } |
121 void setIsDirectional(bool isDirectional) { m_isDirectional = isDirectional; } | 121 void setIsDirectional(bool isDirectional) { m_isDirectional = isDirectional; } |
122 | 122 |
123 void appendTrailingWhitespace(); | 123 void appendTrailingWhitespace(); |
124 | 124 |
125 bool isHandleVisible() const { return m_isHandleVisible; } | |
126 | |
125 // TODO(yosin) Most callers probably don't want these functions, but | 127 // TODO(yosin) Most callers probably don't want these functions, but |
126 // are using them for historical reasons. |toNormalizedEphemeralRange()| | 128 // are using them for historical reasons. |toNormalizedEphemeralRange()| |
127 // contracts the range around text, and moves the caret most backward | 129 // contracts the range around text, and moves the caret most backward |
128 // visually equivalent position before returning the range/positions. | 130 // visually equivalent position before returning the range/positions. |
129 EphemeralRangeTemplate<Strategy> toNormalizedEphemeralRange() const; | 131 EphemeralRangeTemplate<Strategy> toNormalizedEphemeralRange() const; |
130 | 132 |
131 Element* rootEditableElement() const; | 133 Element* rootEditableElement() const; |
132 bool isContentEditable() const; | 134 bool isContentEditable() const; |
133 bool hasEditableStyle() const; | 135 bool hasEditableStyle() const; |
134 bool isContentRichlyEditable() const; | 136 bool isContentRichlyEditable() const; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
186 // Non-directional ignores m_baseIsFirst and selection always extends on shift | 188 // Non-directional ignores m_baseIsFirst and selection always extends on shift |
187 // + arrow key. | 189 // + arrow key. |
188 bool m_isDirectional : 1; | 190 bool m_isDirectional : 1; |
189 | 191 |
190 TextGranularity m_granularity; | 192 TextGranularity m_granularity; |
191 // |updateIfNeeded()| uses |m_hasTrailingWhitespace| for word granularity. | 193 // |updateIfNeeded()| uses |m_hasTrailingWhitespace| for word granularity. |
192 // |m_hasTrailingWhitespace| is set by |appendTrailingWhitespace()|. | 194 // |m_hasTrailingWhitespace| is set by |appendTrailingWhitespace()|. |
193 // TODO(yosin): Once we unify start/end and base/extent, we should get rid | 195 // TODO(yosin): Once we unify start/end and base/extent, we should get rid |
194 // of |m_hasTrailingWhitespace|. | 196 // of |m_hasTrailingWhitespace|. |
195 bool m_hasTrailingWhitespace : 1; | 197 bool m_hasTrailingWhitespace : 1; |
198 | |
199 bool m_isHandleVisible : 1; // True if handle should be visible. | |
yosin_UTC9
2017/01/25 03:49:08
Please don't add |m_isHandleVisible| to |VisibleSe
Changwan Ryu
2017/02/08 00:40:33
Done.
| |
196 }; | 200 }; |
197 | 201 |
198 extern template class CORE_EXTERN_TEMPLATE_EXPORT | 202 extern template class CORE_EXTERN_TEMPLATE_EXPORT |
199 VisibleSelectionTemplate<EditingStrategy>; | 203 VisibleSelectionTemplate<EditingStrategy>; |
200 extern template class CORE_EXTERN_TEMPLATE_EXPORT | 204 extern template class CORE_EXTERN_TEMPLATE_EXPORT |
201 VisibleSelectionTemplate<EditingInFlatTreeStrategy>; | 205 VisibleSelectionTemplate<EditingInFlatTreeStrategy>; |
202 | 206 |
203 using VisibleSelection = VisibleSelectionTemplate<EditingStrategy>; | 207 using VisibleSelection = VisibleSelectionTemplate<EditingStrategy>; |
204 using VisibleSelectionInFlatTree = | 208 using VisibleSelectionInFlatTree = |
205 VisibleSelectionTemplate<EditingInFlatTreeStrategy>; | 209 VisibleSelectionTemplate<EditingInFlatTreeStrategy>; |
(...skipping 17 matching lines...) Expand all Loading... | |
223 | 227 |
224 #ifndef NDEBUG | 228 #ifndef NDEBUG |
225 // Outside the WebCore namespace for ease of invocation from gdb. | 229 // Outside the WebCore namespace for ease of invocation from gdb. |
226 void showTree(const blink::VisibleSelection&); | 230 void showTree(const blink::VisibleSelection&); |
227 void showTree(const blink::VisibleSelection*); | 231 void showTree(const blink::VisibleSelection*); |
228 void showTree(const blink::VisibleSelectionInFlatTree&); | 232 void showTree(const blink::VisibleSelectionInFlatTree&); |
229 void showTree(const blink::VisibleSelectionInFlatTree*); | 233 void showTree(const blink::VisibleSelectionInFlatTree*); |
230 #endif | 234 #endif |
231 | 235 |
232 #endif // VisibleSelection_h | 236 #endif // VisibleSelection_h |
OLD | NEW |