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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 // These should only be used for PositionIsOffsetInAnchor positions, unless | 159 // These should only be used for PositionIsOffsetInAnchor positions, unless |
160 // the position is a legacy editing position. | 160 // the position is a legacy editing position. |
161 void moveToPosition(PassRefPtrWillBeRawPtr<Node> anchorNode, int offset); | 161 void moveToPosition(PassRefPtrWillBeRawPtr<Node> anchorNode, int offset); |
162 void moveToOffset(int offset); | 162 void moveToOffset(int offset); |
163 | 163 |
164 bool isNull() const { return !m_anchorNode; } | 164 bool isNull() const { return !m_anchorNode; } |
165 bool isNotNull() const { return m_anchorNode; } | 165 bool isNotNull() const { return m_anchorNode; } |
166 bool isOrphan() const { return m_anchorNode && !m_anchorNode->inDocument();
} | 166 bool isOrphan() const { return m_anchorNode && !m_anchorNode->inDocument();
} |
167 | 167 |
168 Element* element() const; | 168 Element* element() const; |
169 PassRefPtrWillBeRawPtr<CSSComputedStyleDeclaration> computedStyle() const; | 169 PassRefPtrWillBeRawPtr<CSSComputedStyleDeclaration> ensureComputedStyle() co
nst; |
170 | 170 |
171 // Move up or down the DOM by one position. | 171 // Move up or down the DOM by one position. |
172 // Offsets are computed using render text for nodes that have renderers - bu
t note that even when | 172 // Offsets are computed using render text for nodes that have renderers - bu
t note that even when |
173 // using composed characters, the result may be inside a single user-visible
character if a ligature is formed. | 173 // using composed characters, the result may be inside a single user-visible
character if a ligature is formed. |
174 Position previous(PositionMoveType = CodePoint) const; | 174 Position previous(PositionMoveType = CodePoint) const; |
175 Position next(PositionMoveType = CodePoint) const; | 175 Position next(PositionMoveType = CodePoint) const; |
176 static int uncheckedPreviousOffset(const Node*, int current); | 176 static int uncheckedPreviousOffset(const Node*, int current); |
177 static int uncheckedPreviousOffsetForBackwardDeletion(const Node*, int curre
nt); | 177 static int uncheckedPreviousOffsetForBackwardDeletion(const Node*, int curre
nt); |
178 static int uncheckedNextOffset(const Node*, int current); | 178 static int uncheckedNextOffset(const Node*, int current); |
179 | 179 |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 | 333 |
334 } // namespace blink | 334 } // namespace blink |
335 | 335 |
336 #ifndef NDEBUG | 336 #ifndef NDEBUG |
337 // Outside the WebCore namespace for ease of invocation from gdb. | 337 // Outside the WebCore namespace for ease of invocation from gdb. |
338 void showTree(const blink::Position&); | 338 void showTree(const blink::Position&); |
339 void showTree(const blink::Position*); | 339 void showTree(const blink::Position*); |
340 #endif | 340 #endif |
341 | 341 |
342 #endif // Position_h | 342 #endif // Position_h |
OLD | NEW |