| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 bool atStart() const; | 67 bool atStart() const; |
| 68 bool atEnd() const; | 68 bool atEnd() const; |
| 69 bool atStartOfNode() const; | 69 bool atStartOfNode() const; |
| 70 bool atEndOfNode() const; | 70 bool atEndOfNode() const; |
| 71 | 71 |
| 72 private: | 72 private: |
| 73 PositionIteratorAlgorithm(Node* anchorNode, int offsetInAnchorNode); | 73 PositionIteratorAlgorithm(Node* anchorNode, int offsetInAnchorNode); |
| 74 | 74 |
| 75 bool isValid() const { return !m_anchorNode || m_domTreeVersion == m_anchorN
ode->document().domTreeVersion(); } | 75 bool isValid() const { return !m_anchorNode || m_domTreeVersion == m_anchorN
ode->document().domTreeVersion(); } |
| 76 | 76 |
| 77 RawPtrWillBeMember<Node> m_anchorNode; | 77 Member<Node> m_anchorNode; |
| 78 RawPtrWillBeMember<Node> m_nodeAfterPositionInAnchor; // If this is non-null
, Strategy::parent(*m_nodeAfterPositionInAnchor) == m_anchorNode; | 78 Member<Node> m_nodeAfterPositionInAnchor; // If this is non-null, Strategy::
parent(*m_nodeAfterPositionInAnchor) == m_anchorNode; |
| 79 int m_offsetInAnchor; | 79 int m_offsetInAnchor; |
| 80 size_t m_depthToAnchorNode; | 80 size_t m_depthToAnchorNode; |
| 81 // If |m_nodeAfterPositionInAnchor| is not null, | 81 // If |m_nodeAfterPositionInAnchor| is not null, |
| 82 // m_offsetsInAnchorNode[m_depthToAnchorNode] == | 82 // m_offsetsInAnchorNode[m_depthToAnchorNode] == |
| 83 // Strategy::index(m_nodeAfterPositionInAnchor). | 83 // Strategy::index(m_nodeAfterPositionInAnchor). |
| 84 Vector<int> m_offsetsInAnchorNode; | 84 Vector<int> m_offsetsInAnchorNode; |
| 85 uint64_t m_domTreeVersion; | 85 uint64_t m_domTreeVersion; |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 extern template class PositionIteratorAlgorithm<EditingStrategy>; | 88 extern template class PositionIteratorAlgorithm<EditingStrategy>; |
| 89 extern template class PositionIteratorAlgorithm<EditingInFlatTreeStrategy>; | 89 extern template class PositionIteratorAlgorithm<EditingInFlatTreeStrategy>; |
| 90 | 90 |
| 91 using PositionIterator = PositionIteratorAlgorithm<EditingStrategy>; | 91 using PositionIterator = PositionIteratorAlgorithm<EditingStrategy>; |
| 92 using PositionIteratorInFlatTree = PositionIteratorAlgorithm<EditingInFlatTreeSt
rategy>; | 92 using PositionIteratorInFlatTree = PositionIteratorAlgorithm<EditingInFlatTreeSt
rategy>; |
| 93 | 93 |
| 94 } // namespace blink | 94 } // namespace blink |
| 95 | 95 |
| 96 #endif // PositionIterator_h | 96 #endif // PositionIterator_h |
| OLD | NEW |