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 2534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2545 computeInlineBoxPosition(position.position(), position.affinity()); | 2545 computeInlineBoxPosition(position.position(), position.affinity()); |
2546 | 2546 |
2547 if (boxPosition.inlineBox) | 2547 if (boxPosition.inlineBox) |
2548 layoutObject = LineLayoutAPIShim::layoutObjectFrom( | 2548 layoutObject = LineLayoutAPIShim::layoutObjectFrom( |
2549 boxPosition.inlineBox->getLineLayoutItem()); | 2549 boxPosition.inlineBox->getLineLayoutItem()); |
2550 | 2550 |
2551 return layoutObject->localCaretRect(boxPosition.inlineBox, | 2551 return layoutObject->localCaretRect(boxPosition.inlineBox, |
2552 boxPosition.offsetInBox); | 2552 boxPosition.offsetInBox); |
2553 } | 2553 } |
2554 | 2554 |
2555 // This function was added because the caret rect that will be calcaulated by | 2555 // This function was added because the caret rect that is calculated by |
2556 // using the line top value instead of the selection top. | 2556 // using the line top value instead of the selection top. |
2557 template <typename Strategy> | 2557 template <typename Strategy> |
2558 LayoutRect localSelectionRectOfPositionTemplate( | 2558 LayoutRect localSelectionRectOfPositionTemplate( |
2559 const PositionWithAffinityTemplate<Strategy>& position, | 2559 const PositionWithAffinityTemplate<Strategy>& position, |
2560 LayoutObject*& layoutObject) { | 2560 LayoutObject*& layoutObject) { |
2561 LayoutRect rect = localCaretRectOfPositionTemplate(position, layoutObject); | 2561 LayoutRect rect = localCaretRectOfPositionTemplate(position, layoutObject); |
2562 | 2562 |
2563 if (rect.isEmpty()) | 2563 if (rect.isEmpty()) |
2564 return rect; | 2564 return rect; |
2565 | 2565 |
(...skipping 1335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3901 | 3901 |
3902 VisiblePositionInFlatTree previousPositionOf( | 3902 VisiblePositionInFlatTree previousPositionOf( |
3903 const VisiblePositionInFlatTree& visiblePosition, | 3903 const VisiblePositionInFlatTree& visiblePosition, |
3904 EditingBoundaryCrossingRule rule) { | 3904 EditingBoundaryCrossingRule rule) { |
3905 DCHECK(visiblePosition.isValid()) << visiblePosition; | 3905 DCHECK(visiblePosition.isValid()) << visiblePosition; |
3906 return previousPositionOfAlgorithm<EditingInFlatTreeStrategy>( | 3906 return previousPositionOfAlgorithm<EditingInFlatTreeStrategy>( |
3907 visiblePosition.deepEquivalent(), rule); | 3907 visiblePosition.deepEquivalent(), rule); |
3908 } | 3908 } |
3909 | 3909 |
3910 } // namespace blink | 3910 } // namespace blink |
OLD | NEW |