OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights |
3 * reserved. | 3 * reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 3000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3011 | 3011 |
3012 PositionInFlatTree mostBackwardCaretPosition(const PositionInFlatTree& position, | 3012 PositionInFlatTree mostBackwardCaretPosition(const PositionInFlatTree& position, |
3013 EditingBoundaryCrossingRule rule) { | 3013 EditingBoundaryCrossingRule rule) { |
3014 return mostBackwardCaretPosition<EditingInFlatTreeStrategy>(position, rule); | 3014 return mostBackwardCaretPosition<EditingInFlatTreeStrategy>(position, rule); |
3015 } | 3015 } |
3016 | 3016 |
3017 template <typename Strategy> | 3017 template <typename Strategy> |
3018 PositionTemplate<Strategy> mostForwardCaretPosition( | 3018 PositionTemplate<Strategy> mostForwardCaretPosition( |
3019 const PositionTemplate<Strategy>& position, | 3019 const PositionTemplate<Strategy>& position, |
3020 EditingBoundaryCrossingRule rule) { | 3020 EditingBoundaryCrossingRule rule) { |
| 3021 DCHECK(!needsLayoutTreeUpdate(position)) << position; |
3021 TRACE_EVENT0("input", "VisibleUnits::mostForwardCaretPosition"); | 3022 TRACE_EVENT0("input", "VisibleUnits::mostForwardCaretPosition"); |
3022 | 3023 |
3023 Node* startNode = position.anchorNode(); | 3024 Node* startNode = position.anchorNode(); |
3024 if (!startNode) | 3025 if (!startNode) |
3025 return PositionTemplate<Strategy>(); | 3026 return PositionTemplate<Strategy>(); |
3026 | 3027 |
3027 // iterate forward from there, looking for a qualified position | 3028 // iterate forward from there, looking for a qualified position |
3028 Node* boundary = enclosingVisualBoundary<Strategy>(startNode); | 3029 Node* boundary = enclosingVisualBoundary<Strategy>(startNode); |
3029 // FIXME: PositionIterator should respect Before and After positions. | 3030 // FIXME: PositionIterator should respect Before and After positions. |
3030 PositionIteratorAlgorithm<Strategy> lastVisible( | 3031 PositionIteratorAlgorithm<Strategy> lastVisible( |
(...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3930 | 3931 |
3931 VisiblePositionInFlatTree previousPositionOf( | 3932 VisiblePositionInFlatTree previousPositionOf( |
3932 const VisiblePositionInFlatTree& visiblePosition, | 3933 const VisiblePositionInFlatTree& visiblePosition, |
3933 EditingBoundaryCrossingRule rule) { | 3934 EditingBoundaryCrossingRule rule) { |
3934 DCHECK(visiblePosition.isValid()) << visiblePosition; | 3935 DCHECK(visiblePosition.isValid()) << visiblePosition; |
3935 return previousPositionOfAlgorithm<EditingInFlatTreeStrategy>( | 3936 return previousPositionOfAlgorithm<EditingInFlatTreeStrategy>( |
3936 visiblePosition.deepEquivalent(), rule); | 3937 visiblePosition.deepEquivalent(), rule); |
3937 } | 3938 } |
3938 | 3939 |
3939 } // namespace blink | 3940 } // namespace blink |
OLD | NEW |