| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 return m_offset; | 115 return m_offset; |
| 116 return offsetForPositionAfterAnchor(); | 116 return offsetForPositionAfterAnchor(); |
| 117 } | 117 } |
| 118 | 118 |
| 119 // These are convenience methods which are smart about whether the position
is neighbor anchored or parent anchored | 119 // These are convenience methods which are smart about whether the position
is neighbor anchored or parent anchored |
| 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 RenderObject* renderer() const; |
| 126 int offsetInRenderer() const; |
| 127 |
| 125 // FIXME: Callers should be moved off of node(), node() is not always the co
ntainer for this position. | 128 // 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] | 129 // 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). | 130 // 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(); } | 131 Node* deprecatedNode() const { return m_anchorNode.get(); } |
| 129 | 132 |
| 130 Document* document() const { return m_anchorNode ? m_anchorNode->document()
: 0; } | 133 Document* document() const { return m_anchorNode ? m_anchorNode->document()
: 0; } |
| 131 Element* rootEditableElement() const | 134 Element* rootEditableElement() const |
| 132 { | 135 { |
| 133 Node* container = containerNode(); | 136 Node* container = containerNode(); |
| 134 return container ? container->rootEditableElement() : 0; | 137 return container ? container->rootEditableElement() : 0; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 bool isRenderedCharacter() const; | 185 bool isRenderedCharacter() const; |
| 183 bool rendersInDifferentPosition(const Position&) const; | 186 bool rendersInDifferentPosition(const Position&) const; |
| 184 | 187 |
| 185 void getInlineBoxAndOffset(EAffinity, InlineBox*&, int& caretOffset) const; | 188 void getInlineBoxAndOffset(EAffinity, InlineBox*&, int& caretOffset) const; |
| 186 void getInlineBoxAndOffset(EAffinity, TextDirection primaryDirection, Inline
Box*&, int& caretOffset) const; | 189 void getInlineBoxAndOffset(EAffinity, TextDirection primaryDirection, Inline
Box*&, int& caretOffset) const; |
| 187 | 190 |
| 188 TextDirection primaryDirection() const; | 191 TextDirection primaryDirection() const; |
| 189 | 192 |
| 190 static bool hasRenderedNonAnonymousDescendantsWithHeight(RenderObject*); | 193 static bool hasRenderedNonAnonymousDescendantsWithHeight(RenderObject*); |
| 191 static bool nodeIsUserSelectNone(Node*); | 194 static bool nodeIsUserSelectNone(Node*); |
| 195 static bool rendererIsUserSelectNone(RenderObject*); |
| 192 #if ENABLE(USERSELECT_ALL) | 196 #if ENABLE(USERSELECT_ALL) |
| 193 static bool nodeIsUserSelectAll(const Node*); | 197 static bool nodeIsUserSelectAll(const Node*); |
| 194 static Node* rootUserSelectAllForNode(Node*); | 198 static Node* rootUserSelectAllForNode(Node*); |
| 195 #endif | 199 #endif |
| 196 static ContainerNode* findParent(const Node*); | 200 static ContainerNode* findParent(const Node*); |
| 197 | 201 |
| 198 void debugPosition(const char* msg = "") const; | 202 void debugPosition(const char* msg = "") const; |
| 199 | 203 |
| 200 #ifndef NDEBUG | 204 #ifndef NDEBUG |
| 201 void formatForDebugger(char* buffer, unsigned length) const; | 205 void formatForDebugger(char* buffer, unsigned length) const; |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 | 344 |
| 341 } // namespace WebCore | 345 } // namespace WebCore |
| 342 | 346 |
| 343 #ifndef NDEBUG | 347 #ifndef NDEBUG |
| 344 // Outside the WebCore namespace for ease of invocation from gdb. | 348 // Outside the WebCore namespace for ease of invocation from gdb. |
| 345 void showTree(const WebCore::Position&); | 349 void showTree(const WebCore::Position&); |
| 346 void showTree(const WebCore::Position*); | 350 void showTree(const WebCore::Position*); |
| 347 #endif | 351 #endif |
| 348 | 352 |
| 349 #endif // Position_h | 353 #endif // Position_h |
| OLD | NEW |