OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2008 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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 | 153 |
154 // These can be either inside or just before/after the node, depending on | 154 // These can be either inside or just before/after the node, depending on |
155 // if the node is ignored by editing or not. | 155 // if the node is ignored by editing or not. |
156 // FIXME: These should go away. They only make sense for legacy positions. | 156 // FIXME: These should go away. They only make sense for legacy positions. |
157 bool atFirstEditingPositionForNode() const; | 157 bool atFirstEditingPositionForNode() const; |
158 bool atLastEditingPositionForNode() const; | 158 bool atLastEditingPositionForNode() const; |
159 | 159 |
160 bool atStartOfTree() const; | 160 bool atStartOfTree() const; |
161 bool atEndOfTree() const; | 161 bool atEndOfTree() const; |
162 | 162 |
163 // These return useful visually equivalent positions. | |
164 // FIXME: We should use mostForwardCaretPosition and mostBackwardPosition. | |
165 PositionAlgorithm<Strategy> upstream(EditingBoundaryCrossingRule = CannotCro
ssEditingBoundary) const; | |
166 PositionAlgorithm<Strategy> downstream(EditingBoundaryCrossingRule = CannotC
rossEditingBoundary) const; | |
167 | |
168 static PositionAlgorithm<Strategy> beforeNode(Node* anchorNode); | 163 static PositionAlgorithm<Strategy> beforeNode(Node* anchorNode); |
169 static PositionAlgorithm<Strategy> afterNode(Node* anchorNode); | 164 static PositionAlgorithm<Strategy> afterNode(Node* anchorNode); |
170 static PositionAlgorithm<Strategy> inParentBeforeNode(const Node& anchorNode
); | 165 static PositionAlgorithm<Strategy> inParentBeforeNode(const Node& anchorNode
); |
171 static PositionAlgorithm<Strategy> inParentAfterNode(const Node& anchorNode)
; | 166 static PositionAlgorithm<Strategy> inParentAfterNode(const Node& anchorNode)
; |
172 static int lastOffsetInNode(Node* anchorNode); | 167 static int lastOffsetInNode(Node* anchorNode); |
173 static PositionAlgorithm<Strategy> firstPositionInNode(Node* anchorNode); | 168 static PositionAlgorithm<Strategy> firstPositionInNode(Node* anchorNode); |
174 static PositionAlgorithm<Strategy> lastPositionInNode(Node* anchorNode); | 169 static PositionAlgorithm<Strategy> lastPositionInNode(Node* anchorNode); |
175 static int minOffsetForNode(Node* anchorNode, int offset); | 170 static int minOffsetForNode(Node* anchorNode, int offset); |
176 static bool offsetIsBeforeLastNodeOffset(int offset, Node* anchorNode); | 171 static bool offsetIsBeforeLastNodeOffset(int offset, Node* anchorNode); |
177 static PositionAlgorithm<Strategy> firstPositionInOrBeforeNode(Node* anchorN
ode); | 172 static PositionAlgorithm<Strategy> firstPositionInOrBeforeNode(Node* anchorN
ode); |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 | 413 |
419 } // namespace blink | 414 } // namespace blink |
420 | 415 |
421 #ifndef NDEBUG | 416 #ifndef NDEBUG |
422 // Outside the WebCore namespace for ease of invocation from gdb. | 417 // Outside the WebCore namespace for ease of invocation from gdb. |
423 void showTree(const blink::Position&); | 418 void showTree(const blink::Position&); |
424 void showTree(const blink::Position*); | 419 void showTree(const blink::Position*); |
425 #endif | 420 #endif |
426 | 421 |
427 #endif // Position_h | 422 #endif // Position_h |
OLD | NEW |