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 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
764 int i = startOfLastWordBoundaryContext(characters.data(), length); | 764 int i = startOfLastWordBoundaryContext(characters.data(), length); |
765 string.prepend(characters.data() + i, length - i); | 765 string.prepend(characters.data() + i, length - i); |
766 prefixLength += length - i; | 766 prefixLength += length - i; |
767 if (i > 0) | 767 if (i > 0) |
768 break; | 768 break; |
769 backwardsIterator.advance(); | 769 backwardsIterator.advance(); |
770 } | 770 } |
771 } | 771 } |
772 | 772 |
773 Position searchStart = Position::editingPositionOf(start.anchorNode(), start
.offsetInContainerNode()); | 773 Position searchStart = Position::editingPositionOf(start.anchorNode(), start
.offsetInContainerNode()); |
774 RangeBoundaryPoint searchEndPoint(boundary); | 774 Position searchEnd = Position::lastPositionInNode(boundary); |
775 searchEndPoint.setToEndOfNode(*boundary); | |
776 Position searchEnd = searchEndPoint.toPosition(); | |
777 TextIterator it(searchStart, searchEnd, TextIteratorEmitsCharactersBetweenAl
lVisiblePositions); | 775 TextIterator it(searchStart, searchEnd, TextIteratorEmitsCharactersBetweenAl
lVisiblePositions); |
778 const unsigned invalidOffset = static_cast<unsigned>(-1); | 776 const unsigned invalidOffset = static_cast<unsigned>(-1); |
779 unsigned next = invalidOffset; | 777 unsigned next = invalidOffset; |
780 bool needMoreContext = false; | 778 bool needMoreContext = false; |
781 while (!it.atEnd()) { | 779 while (!it.atEnd()) { |
782 // Keep asking the iterator for chunks until the search function | 780 // Keep asking the iterator for chunks until the search function |
783 // returns an end value not equal to the length of the string passed to
it. | 781 // returns an end value not equal to the length of the string passed to
it. |
784 bool inTextSecurityMode = it.node() && it.node()->layoutObject() && it.n
ode()->layoutObject()->style()->textSecurity() != TSNONE; | 782 bool inTextSecurityMode = it.node() && it.node()->layoutObject() && it.n
ode()->layoutObject()->style()->textSecurity() != TSNONE; |
785 if (!inTextSecurityMode) { | 783 if (!inTextSecurityMode) { |
786 it.text().appendTextTo(string); | 784 it.text().appendTextTo(string); |
(...skipping 2181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2968 return honorEditingBoundaryAtOrBefore(prev, visiblePosition.deepEquivale
nt()); | 2966 return honorEditingBoundaryAtOrBefore(prev, visiblePosition.deepEquivale
nt()); |
2969 case CanSkipOverEditingBoundary: | 2967 case CanSkipOverEditingBoundary: |
2970 return skipToStartOfEditingBoundary(prev, visiblePosition.deepEquivalent
()); | 2968 return skipToStartOfEditingBoundary(prev, visiblePosition.deepEquivalent
()); |
2971 } | 2969 } |
2972 | 2970 |
2973 ASSERT_NOT_REACHED(); | 2971 ASSERT_NOT_REACHED(); |
2974 return honorEditingBoundaryAtOrBefore(prev, visiblePosition.deepEquivalent()
); | 2972 return honorEditingBoundaryAtOrBefore(prev, visiblePosition.deepEquivalent()
); |
2975 } | 2973 } |
2976 | 2974 |
2977 } // namespace blink | 2975 } // namespace blink |
OLD | NEW |