| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 { | 54 { |
| 55 if (m_nodeAfterPositionInAnchor) { | 55 if (m_nodeAfterPositionInAnchor) { |
| 56 ASSERT(Strategy::parent(*m_nodeAfterPositionInAnchor) == m_anchorNode); | 56 ASSERT(Strategy::parent(*m_nodeAfterPositionInAnchor) == m_anchorNode); |
| 57 // FIXME: This check is inadaquete because any ancestor could be ignored
by editing | 57 // FIXME: This check is inadaquete because any ancestor could be ignored
by editing |
| 58 if (Strategy::editingIgnoresContent(Strategy::parent(*m_nodeAfterPositio
nInAnchor))) | 58 if (Strategy::editingIgnoresContent(Strategy::parent(*m_nodeAfterPositio
nInAnchor))) |
| 59 return PositionAlgorithm<Strategy>::beforeNode(m_anchorNode); | 59 return PositionAlgorithm<Strategy>::beforeNode(m_anchorNode); |
| 60 return PositionAlgorithm<Strategy>::inParentBeforeNode(*m_nodeAfterPosit
ionInAnchor); | 60 return PositionAlgorithm<Strategy>::inParentBeforeNode(*m_nodeAfterPosit
ionInAnchor); |
| 61 } | 61 } |
| 62 if (Strategy::hasChildren(*m_anchorNode)) | 62 if (Strategy::hasChildren(*m_anchorNode)) |
| 63 return PositionAlgorithm<Strategy>::lastPositionInOrAfterNode(m_anchorNo
de); | 63 return PositionAlgorithm<Strategy>::lastPositionInOrAfterNode(m_anchorNo
de); |
| 64 return PositionAlgorithm<Strategy>::createLegacyEditingPosition(m_anchorNode
, m_offsetInAnchor); | 64 return PositionAlgorithm<Strategy>::editingPositionOf(m_anchorNode, m_offset
InAnchor); |
| 65 } | 65 } |
| 66 | 66 |
| 67 template <typename Strategy> | 67 template <typename Strategy> |
| 68 PositionAlgorithm<Strategy> PositionIteratorAlgorithm<Strategy>::computePosition
() const | 68 PositionAlgorithm<Strategy> PositionIteratorAlgorithm<Strategy>::computePosition
() const |
| 69 { | 69 { |
| 70 if (m_nodeAfterPositionInAnchor) { | 70 if (m_nodeAfterPositionInAnchor) { |
| 71 ASSERT(Strategy::parent(*m_nodeAfterPositionInAnchor) == m_anchorNode); | 71 ASSERT(Strategy::parent(*m_nodeAfterPositionInAnchor) == m_anchorNode); |
| 72 return PositionAlgorithm<Strategy>::inParentBeforeNode(*m_nodeAfterPosit
ionInAnchor); | 72 return PositionAlgorithm<Strategy>::inParentBeforeNode(*m_nodeAfterPosit
ionInAnchor); |
| 73 } | 73 } |
| 74 if (Strategy::hasChildren(*m_anchorNode)) | 74 if (Strategy::hasChildren(*m_anchorNode)) |
| (...skipping 97 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 |