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 19 matching lines...) Expand all Loading... |
30 | 30 |
31 template <typename Strategy> | 31 template <typename Strategy> |
32 PositionIteratorAlgorithm<Strategy>::PositionIteratorAlgorithm(Node* anchorNode,
int offsetInAnchor) | 32 PositionIteratorAlgorithm<Strategy>::PositionIteratorAlgorithm(Node* anchorNode,
int offsetInAnchor) |
33 : m_anchorNode(anchorNode) | 33 : m_anchorNode(anchorNode) |
34 , m_nodeAfterPositionInAnchor(Strategy::childAt(*anchorNode, offsetInAnchor)
) | 34 , m_nodeAfterPositionInAnchor(Strategy::childAt(*anchorNode, offsetInAnchor)
) |
35 , m_offsetInAnchor(m_nodeAfterPositionInAnchor ? 0 : offsetInAnchor) | 35 , m_offsetInAnchor(m_nodeAfterPositionInAnchor ? 0 : offsetInAnchor) |
36 { | 36 { |
37 } | 37 } |
38 template <typename Strategy> | 38 template <typename Strategy> |
39 PositionIteratorAlgorithm<Strategy>::PositionIteratorAlgorithm(const PositionAlg
orithm<Strategy>& pos) | 39 PositionIteratorAlgorithm<Strategy>::PositionIteratorAlgorithm(const PositionAlg
orithm<Strategy>& pos) |
40 : PositionIteratorAlgorithm(pos.anchorNode(), pos.deprecatedEditingOffset()) | 40 : PositionIteratorAlgorithm(pos.anchorNode(), pos.computeEditingOffset()) |
41 { | 41 { |
42 } | 42 } |
43 | 43 |
44 template <typename Strategy> | 44 template <typename Strategy> |
45 PositionIteratorAlgorithm<Strategy>::PositionIteratorAlgorithm() | 45 PositionIteratorAlgorithm<Strategy>::PositionIteratorAlgorithm() |
46 : m_anchorNode(nullptr) | 46 : m_anchorNode(nullptr) |
47 , m_nodeAfterPositionInAnchor(nullptr) | 47 , m_nodeAfterPositionInAnchor(nullptr) |
48 , m_offsetInAnchor(0) | 48 , m_offsetInAnchor(0) |
49 { | 49 { |
50 } | 50 } |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 return true; | 172 return true; |
173 if (m_nodeAfterPositionInAnchor) | 173 if (m_nodeAfterPositionInAnchor) |
174 return false; | 174 return false; |
175 return Strategy::hasChildren(*m_anchorNode) || m_offsetInAnchor >= Strategy:
:lastOffsetForEditing(m_anchorNode); | 175 return Strategy::hasChildren(*m_anchorNode) || m_offsetInAnchor >= Strategy:
:lastOffsetForEditing(m_anchorNode); |
176 } | 176 } |
177 | 177 |
178 template class PositionIteratorAlgorithm<EditingStrategy>; | 178 template class PositionIteratorAlgorithm<EditingStrategy>; |
179 template class PositionIteratorAlgorithm<EditingInComposedTreeStrategy>; | 179 template class PositionIteratorAlgorithm<EditingInComposedTreeStrategy>; |
180 | 180 |
181 } // namespace blink | 181 } // namespace blink |
OLD | NEW |