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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 Node* computeNodeBeforePosition() const; | 120 Node* computeNodeBeforePosition() const; |
121 Node* computeNodeAfterPosition() const; | 121 Node* computeNodeAfterPosition() const; |
122 | 122 |
123 Node* anchorNode() const { return m_anchorNode.get(); } | 123 Node* anchorNode() const { return m_anchorNode.get(); } |
124 | 124 |
125 // FIXME: Callers should be moved off of node(), node() is not always the co
ntainer for this position. | 125 // FIXME: Callers should be moved off of node(), node() is not always the co
ntainer for this position. |
126 // For nodes which editingIgnoresContent(node()) returns true, positions lik
e [ignoredNode, 0] | 126 // For nodes which editingIgnoresContent(node()) returns true, positions lik
e [ignoredNode, 0] |
127 // will be treated as before ignoredNode (thus node() is really after the po
sition, not containing it). | 127 // will be treated as before ignoredNode (thus node() is really after the po
sition, not containing it). |
128 Node* deprecatedNode() const { return m_anchorNode.get(); } | 128 Node* deprecatedNode() const { return m_anchorNode.get(); } |
129 | 129 |
130 Document* document() const { return m_anchorNode ? m_anchorNode->document()
: 0; } | 130 Document* document() const { return m_anchorNode ? &m_anchorNode->document()
: 0; } |
131 Element* rootEditableElement() const | 131 Element* rootEditableElement() const |
132 { | 132 { |
133 Node* container = containerNode(); | 133 Node* container = containerNode(); |
134 return container ? container->rootEditableElement() : 0; | 134 return container ? container->rootEditableElement() : 0; |
135 } | 135 } |
136 | 136 |
137 // These should only be used for PositionIsOffsetInAnchor positions, unless | 137 // These should only be used for PositionIsOffsetInAnchor positions, unless |
138 // the position is a legacy editing position. | 138 // the position is a legacy editing position. |
139 void moveToPosition(PassRefPtr<Node> anchorNode, int offset); | 139 void moveToPosition(PassRefPtr<Node> anchorNode, int offset); |
140 void moveToOffset(int offset); | 140 void moveToOffset(int offset); |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 | 339 |
340 } // namespace WebCore | 340 } // namespace WebCore |
341 | 341 |
342 #ifndef NDEBUG | 342 #ifndef NDEBUG |
343 // Outside the WebCore namespace for ease of invocation from gdb. | 343 // Outside the WebCore namespace for ease of invocation from gdb. |
344 void showTree(const WebCore::Position&); | 344 void showTree(const WebCore::Position&); |
345 void showTree(const WebCore::Position*); | 345 void showTree(const WebCore::Position*); |
346 #endif | 346 #endif |
347 | 347 |
348 #endif // Position_h | 348 #endif // Position_h |
OLD | NEW |