| 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 // Returns a node as past last as same as |Range::pastLastNode()|. This | 160 // Returns a node as past last as same as |Range::pastLastNode()|. This |
| 161 // function is supposed to used in HTML serialization and plain text | 161 // function is supposed to used in HTML serialization and plain text |
| 162 // iterator. This position must be a |PositionAnchorType::OffsetInAhcor| to | 162 // iterator. This position must be a |PositionAnchorType::OffsetInAhcor| to |
| 163 // behave as |Range| boundary point. | 163 // behave as |Range| boundary point. |
| 164 Node* nodeAsRangePastLastNode() const; | 164 Node* nodeAsRangePastLastNode() const; |
| 165 | 165 |
| 166 Node* commonAncestorContainer(const PositionAlgorithm<Strategy>&) const; | 166 Node* commonAncestorContainer(const PositionAlgorithm<Strategy>&) const; |
| 167 | 167 |
| 168 Node* anchorNode() const { return m_anchorNode.get(); } | 168 Node* anchorNode() const { return m_anchorNode.get(); } |
| 169 | 169 |
| 170 // FIXME: Callers should be moved off of node(), node() is not always the co
ntainer for this position. | |
| 171 // For nodes which editingIgnoresContent(node()) returns true, positions lik
e [ignoredNode, 0] | |
| 172 // will be treated as before ignoredNode (thus node() is really after the po
sition, not containing it). | |
| 173 Node* deprecatedNode() const { return m_anchorNode.get(); } | |
| 174 | |
| 175 Document* document() const { return m_anchorNode ? &m_anchorNode->document()
: 0; } | 170 Document* document() const { return m_anchorNode ? &m_anchorNode->document()
: 0; } |
| 176 bool inDocument() const { return m_anchorNode && m_anchorNode->inDocument();
} | 171 bool inDocument() const { return m_anchorNode && m_anchorNode->inDocument();
} |
| 177 Element* rootEditableElement() const | 172 Element* rootEditableElement() const |
| 178 { | 173 { |
| 179 Node* container = containerNode(); | 174 Node* container = containerNode(); |
| 180 return container ? container->rootEditableElement() : 0; | 175 return container ? container->rootEditableElement() : 0; |
| 181 } | 176 } |
| 182 | 177 |
| 183 // These should only be used for PositionAnchorType::OffsetInAnchor | 178 // These should only be used for PositionAnchorType::OffsetInAnchor |
| 184 // positions, unless the position is a legacy editing position. | 179 // positions, unless the position is a legacy editing position. |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 | 480 |
| 486 } // namespace blink | 481 } // namespace blink |
| 487 | 482 |
| 488 #ifndef NDEBUG | 483 #ifndef NDEBUG |
| 489 // Outside the WebCore namespace for ease of invocation from gdb. | 484 // Outside the WebCore namespace for ease of invocation from gdb. |
| 490 void showTree(const blink::Position&); | 485 void showTree(const blink::Position&); |
| 491 void showTree(const blink::Position*); | 486 void showTree(const blink::Position*); |
| 492 #endif | 487 #endif |
| 493 | 488 |
| 494 #endif // Position_h | 489 #endif // Position_h |
| OLD | NEW |