OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 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 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 bool movingBackwardsMovedPositionToStartOfCurrentWord = positionAfterCur
rentWord == previousWordPosition(nextWordPosition(originalPosition)); | 583 bool movingBackwardsMovedPositionToStartOfCurrentWord = positionAfterCur
rentWord == previousWordPosition(nextWordPosition(originalPosition)); |
584 if (movingBackwardsMovedPositionToStartOfCurrentWord) | 584 if (movingBackwardsMovedPositionToStartOfCurrentWord) |
585 positionAfterCurrentWord = positionAfterSpacingAndFollowingWord; | 585 positionAfterCurrentWord = positionAfterSpacingAndFollowingWord; |
586 } | 586 } |
587 return positionAfterCurrentWord; | 587 return positionAfterCurrentWord; |
588 } | 588 } |
589 | 589 |
590 static void adjustPositionForUserSelectAll(VisiblePosition& pos, bool isForward) | 590 static void adjustPositionForUserSelectAll(VisiblePosition& pos, bool isForward) |
591 { | 591 { |
592 if (Node* rootUserSelectAll = Position::rootUserSelectAllForNode(pos.deepEqu
ivalent().anchorNode())) | 592 if (Node* rootUserSelectAll = Position::rootUserSelectAllForNode(pos.deepEqu
ivalent().anchorNode())) |
593 pos = VisiblePosition(isForward ? positionAfterNode(*rootUserSelectAll).
downstream(CanCrossEditingBoundary) : positionBeforeNode(*rootUserSelectAll).ups
tream(CanCrossEditingBoundary)); | 593 pos = VisiblePosition(isForward ? positionAfterNode(rootUserSelectAll).d
ownstream(CanCrossEditingBoundary) : positionBeforeNode(rootUserSelectAll).upstr
eam(CanCrossEditingBoundary)); |
594 } | 594 } |
595 | 595 |
596 VisiblePosition FrameSelection::modifyExtendingRight(TextGranularity granularity
) | 596 VisiblePosition FrameSelection::modifyExtendingRight(TextGranularity granularity
) |
597 { | 597 { |
598 VisiblePosition pos(m_selection.extent(), m_selection.affinity()); | 598 VisiblePosition pos(m_selection.extent(), m_selection.affinity()); |
599 | 599 |
600 // The difference between modifyExtendingRight and modifyExtendingForward is
: | 600 // The difference between modifyExtendingRight and modifyExtendingForward is
: |
601 // modifyExtendingForward always extends forward logically. | 601 // modifyExtendingForward always extends forward logically. |
602 // modifyExtendingRight behaves the same as modifyExtendingForward except fo
r extending character or word, | 602 // modifyExtendingRight behaves the same as modifyExtendingForward except fo
r extending character or word, |
603 // it extends forward logically if the enclosing block is LTR direction, | 603 // it extends forward logically if the enclosing block is LTR direction, |
(...skipping 1226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1830 sel.showTreeForThis(); | 1830 sel.showTreeForThis(); |
1831 } | 1831 } |
1832 | 1832 |
1833 void showTree(const WebCore::FrameSelection* sel) | 1833 void showTree(const WebCore::FrameSelection* sel) |
1834 { | 1834 { |
1835 if (sel) | 1835 if (sel) |
1836 sel->showTreeForThis(); | 1836 sel->showTreeForThis(); |
1837 } | 1837 } |
1838 | 1838 |
1839 #endif | 1839 #endif |
OLD | NEW |