| 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 // function is supposed to used in HTML serialization and plain text | 130 // function is supposed to used in HTML serialization and plain text |
| 131 // iterator. This position must be a |PositionAnchorType::OffsetInAhcor| to | 131 // iterator. This position must be a |PositionAnchorType::OffsetInAhcor| to |
| 132 // behave as |Range| boundary point. | 132 // behave as |Range| boundary point. |
| 133 Node* nodeAsRangePastLastNode() const; | 133 Node* nodeAsRangePastLastNode() const; |
| 134 | 134 |
| 135 Node* commonAncestorContainer(const PositionTemplate<Strategy>&) const; | 135 Node* commonAncestorContainer(const PositionTemplate<Strategy>&) const; |
| 136 | 136 |
| 137 Node* anchorNode() const { return m_anchorNode.get(); } | 137 Node* anchorNode() const { return m_anchorNode.get(); } |
| 138 | 138 |
| 139 Document* document() const { return m_anchorNode ? &m_anchorNode->document()
: 0; } | 139 Document* document() const { return m_anchorNode ? &m_anchorNode->document()
: 0; } |
| 140 bool inShadowIncludingDocument() const { return m_anchorNode && m_anchorNode
->inShadowIncludingDocument(); } | 140 bool isConnected() const { return m_anchorNode && m_anchorNode->isConnected(
); } |
| 141 | 141 |
| 142 bool isNull() const { return !m_anchorNode; } | 142 bool isNull() const { return !m_anchorNode; } |
| 143 bool isNotNull() const { return m_anchorNode; } | 143 bool isNotNull() const { return m_anchorNode; } |
| 144 bool isOrphan() const { return m_anchorNode && !m_anchorNode->inShadowInclud
ingDocument(); } | 144 bool isOrphan() const { return m_anchorNode && !m_anchorNode->isConnected();
} |
| 145 | 145 |
| 146 // Note: Comparison of positions require both parameters are non-null. You | 146 // Note: Comparison of positions require both parameters are non-null. You |
| 147 // should check null-position before comparing them. | 147 // should check null-position before comparing them. |
| 148 // TODO(yosin): We should use |Position::operator<()| instead of | 148 // TODO(yosin): We should use |Position::operator<()| instead of |
| 149 // |Position::comapreTo()| to utilize |DHCECK_XX()|. | 149 // |Position::comapreTo()| to utilize |DHCECK_XX()|. |
| 150 int compareTo(const PositionTemplate<Strategy>&) const; | 150 int compareTo(const PositionTemplate<Strategy>&) const; |
| 151 bool operator<(const PositionTemplate<Strategy>&) const; | 151 bool operator<(const PositionTemplate<Strategy>&) const; |
| 152 bool operator<=(const PositionTemplate<Strategy>&) const; | 152 bool operator<=(const PositionTemplate<Strategy>&) const; |
| 153 bool operator>(const PositionTemplate<Strategy>&) const; | 153 bool operator>(const PositionTemplate<Strategy>&) const; |
| 154 bool operator>=(const PositionTemplate<Strategy>&) const; | 154 bool operator>=(const PositionTemplate<Strategy>&) const; |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 | 257 |
| 258 } // namespace blink | 258 } // namespace blink |
| 259 | 259 |
| 260 #ifndef NDEBUG | 260 #ifndef NDEBUG |
| 261 // Outside the WebCore namespace for ease of invocation from gdb. | 261 // Outside the WebCore namespace for ease of invocation from gdb. |
| 262 void showTree(const blink::Position&); | 262 void showTree(const blink::Position&); |
| 263 void showTree(const blink::Position*); | 263 void showTree(const blink::Position*); |
| 264 #endif | 264 #endif |
| 265 | 265 |
| 266 #endif // Position_h | 266 #endif // Position_h |
| OLD | NEW |