OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. |
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 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 // This containing editable block does not have a previous line. | 526 // This containing editable block does not have a previous line. |
527 // Need to move back to previous containing editable block in this root
editable | 527 // Need to move back to previous containing editable block in this root
editable |
528 // block and find the last root line box in that block. | 528 // block and find the last root line box in that block. |
529 Node* startBlock = enclosingNodeWithNonInlineRenderer(node); | 529 Node* startBlock = enclosingNodeWithNonInlineRenderer(node); |
530 Node* n = previousLeafWithSameEditability(node); | 530 Node* n = previousLeafWithSameEditability(node); |
531 while (n && startBlock == enclosingNodeWithNonInlineRenderer(n)) | 531 while (n && startBlock == enclosingNodeWithNonInlineRenderer(n)) |
532 n = previousLeafWithSameEditability(n); | 532 n = previousLeafWithSameEditability(n); |
533 while (n) { | 533 while (n) { |
534 if (highestEditableRoot(firstPositionInOrBeforeNode(n)) != highestRo
ot) | 534 if (highestEditableRoot(firstPositionInOrBeforeNode(n)) != highestRo
ot) |
535 break; | 535 break; |
536 Position pos = createLegacyEditingPosition(n, caretMinOffset(n)); | 536 Position pos = n->hasTagName(brTag) ? positionBeforeNode(n) : create
LegacyEditingPosition(n, caretMaxOffset(n)); |
537 if (pos.isCandidate()) { | 537 if (pos.isCandidate()) { |
538 pos.getInlineBoxAndOffset(DOWNSTREAM, box, ignoredCaretOffset); | 538 pos.getInlineBoxAndOffset(DOWNSTREAM, box, ignoredCaretOffset); |
539 if (box) { | 539 if (box) { |
540 // previous root line box found | 540 // previous root line box found |
541 root = box->root(); | 541 root = box->root(); |
542 break; | 542 break; |
543 } | 543 } |
544 | 544 |
545 return VisiblePosition(pos, DOWNSTREAM); | 545 return VisiblePosition(pos, DOWNSTREAM); |
546 } | 546 } |
(...skipping 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1632 VisiblePosition rightWordPosition(const VisiblePosition& visiblePosition) | 1632 VisiblePosition rightWordPosition(const VisiblePosition& visiblePosition) |
1633 { | 1633 { |
1634 if (visiblePosition.isNull()) | 1634 if (visiblePosition.isNull()) |
1635 return VisiblePosition(); | 1635 return VisiblePosition(); |
1636 | 1636 |
1637 VisiblePosition rightWordBreak = rightWordPositionIgnoringEditingBoundary(vi
siblePosition); | 1637 VisiblePosition rightWordBreak = rightWordPositionIgnoringEditingBoundary(vi
siblePosition); |
1638 return visiblePosition.honorEditingBoundaryAtOrBefore(rightWordBreak); | 1638 return visiblePosition.honorEditingBoundaryAtOrBefore(rightWordBreak); |
1639 } | 1639 } |
1640 | 1640 |
1641 } | 1641 } |
OLD | NEW |