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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 // These should only be used for PositionIsOffsetInAnchor positions, unless | 138 // These should only be used for PositionIsOffsetInAnchor positions, unless |
139 // the position is a legacy editing position. | 139 // the position is a legacy editing position. |
140 void moveToPosition(PassRefPtr<Node> anchorNode, int offset); | 140 void moveToPosition(PassRefPtr<Node> anchorNode, int offset); |
141 void moveToOffset(int offset); | 141 void moveToOffset(int offset); |
142 | 142 |
143 bool isNull() const { return !m_anchorNode; } | 143 bool isNull() const { return !m_anchorNode; } |
144 bool isNotNull() const { return m_anchorNode; } | 144 bool isNotNull() const { return m_anchorNode; } |
145 bool isOrphan() const { return m_anchorNode && !m_anchorNode->inDocument();
} | 145 bool isOrphan() const { return m_anchorNode && !m_anchorNode->inDocument();
} |
146 | 146 |
147 Element* element() const; | 147 Element* element() const; |
148 PassRefPtr<CSSComputedStyleDeclaration> computedStyle() const; | 148 PassRefPtrWillBeRawPtr<CSSComputedStyleDeclaration> computedStyle() const; |
149 | 149 |
150 // Move up or down the DOM by one position. | 150 // Move up or down the DOM by one position. |
151 // Offsets are computed using render text for nodes that have renderers - bu
t note that even when | 151 // Offsets are computed using render text for nodes that have renderers - bu
t note that even when |
152 // using composed characters, the result may be inside a single user-visible
character if a ligature is formed. | 152 // using composed characters, the result may be inside a single user-visible
character if a ligature is formed. |
153 Position previous(PositionMoveType = CodePoint) const; | 153 Position previous(PositionMoveType = CodePoint) const; |
154 Position next(PositionMoveType = CodePoint) const; | 154 Position next(PositionMoveType = CodePoint) const; |
155 static int uncheckedPreviousOffset(const Node*, int current); | 155 static int uncheckedPreviousOffset(const Node*, int current); |
156 static int uncheckedPreviousOffsetForBackwardDeletion(const Node*, int curre
nt); | 156 static int uncheckedPreviousOffsetForBackwardDeletion(const Node*, int curre
nt); |
157 static int uncheckedNextOffset(const Node*, int current); | 157 static int uncheckedNextOffset(const Node*, int current); |
158 | 158 |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 | 340 |
341 } // namespace WebCore | 341 } // namespace WebCore |
342 | 342 |
343 #ifndef NDEBUG | 343 #ifndef NDEBUG |
344 // Outside the WebCore namespace for ease of invocation from gdb. | 344 // Outside the WebCore namespace for ease of invocation from gdb. |
345 void showTree(const WebCore::Position&); | 345 void showTree(const WebCore::Position&); |
346 void showTree(const WebCore::Position*); | 346 void showTree(const WebCore::Position*); |
347 #endif | 347 #endif |
348 | 348 |
349 #endif // Position_h | 349 #endif // Position_h |
OLD | NEW |