| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 bool movingBackwardsMovedPositionToStartOfCurrentWord = positionAfterCur
rentWord.deepEquivalent() == previousWordPosition(nextWordPosition(originalPosit
ion)).deepEquivalent(); | 168 bool movingBackwardsMovedPositionToStartOfCurrentWord = positionAfterCur
rentWord.deepEquivalent() == previousWordPosition(nextWordPosition(originalPosit
ion)).deepEquivalent(); |
| 169 if (movingBackwardsMovedPositionToStartOfCurrentWord) | 169 if (movingBackwardsMovedPositionToStartOfCurrentWord) |
| 170 positionAfterCurrentWord = positionAfterSpacingAndFollowingWord; | 170 positionAfterCurrentWord = positionAfterSpacingAndFollowingWord; |
| 171 } | 171 } |
| 172 return positionAfterCurrentWord; | 172 return positionAfterCurrentWord; |
| 173 } | 173 } |
| 174 | 174 |
| 175 static void adjustPositionForUserSelectAll(VisiblePosition& pos, bool isForward) | 175 static void adjustPositionForUserSelectAll(VisiblePosition& pos, bool isForward) |
| 176 { | 176 { |
| 177 if (Node* rootUserSelectAll = EditingStrategy::rootUserSelectAllForNode(pos.
deepEquivalent().anchorNode())) | 177 if (Node* rootUserSelectAll = EditingStrategy::rootUserSelectAllForNode(pos.
deepEquivalent().anchorNode())) |
| 178 pos = createVisiblePosition(isForward ? mostForwardCaretPosition(Positio
n::afterNode(rootUserSelectAll), CanCrossEditingBoundary) : mostBackwardCaretPos
ition(positionBeforeNode(rootUserSelectAll), CanCrossEditingBoundary)); | 178 pos = createVisiblePosition(isForward ? mostForwardCaretPosition(Positio
n::afterNode(rootUserSelectAll), CanCrossEditingBoundary) : mostBackwardCaretPos
ition(Position::beforeNode(rootUserSelectAll), CanCrossEditingBoundary)); |
| 179 } | 179 } |
| 180 | 180 |
| 181 VisiblePosition SelectionModifier::modifyExtendingRight(TextGranularity granular
ity) | 181 VisiblePosition SelectionModifier::modifyExtendingRight(TextGranularity granular
ity) |
| 182 { | 182 { |
| 183 VisiblePosition pos = createVisiblePosition(m_selection.extent(), m_selectio
n.affinity()); | 183 VisiblePosition pos = createVisiblePosition(m_selection.extent(), m_selectio
n.affinity()); |
| 184 | 184 |
| 185 // The difference between modifyExtendingRight and modifyExtendingForward is
: | 185 // The difference between modifyExtendingRight and modifyExtendingForward is
: |
| 186 // modifyExtendingForward always extends forward logically. | 186 // modifyExtendingForward always extends forward logically. |
| 187 // modifyExtendingRight behaves the same as modifyExtendingForward except fo
r extending character or word, | 187 // modifyExtendingRight behaves the same as modifyExtendingForward except fo
r extending character or word, |
| 188 // it extends forward logically if the enclosing block is LTR direction, | 188 // it extends forward logically if the enclosing block is LTR direction, |
| (...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 761 return x; | 761 return x; |
| 762 } | 762 } |
| 763 | 763 |
| 764 DEFINE_TRACE(SelectionModifier) | 764 DEFINE_TRACE(SelectionModifier) |
| 765 { | 765 { |
| 766 visitor->trace(m_frame); | 766 visitor->trace(m_frame); |
| 767 visitor->trace(m_selection); | 767 visitor->trace(m_selection); |
| 768 } | 768 } |
| 769 | 769 |
| 770 } // namespace blink | 770 } // namespace blink |
| OLD | NEW |