OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2007 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 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
725 } | 725 } |
726 | 726 |
727 template <typename Strategy> | 727 template <typename Strategy> |
728 PositionTemplate<Strategy> LastEditablePositionBeforePositionInRootAlgorithm( | 728 PositionTemplate<Strategy> LastEditablePositionBeforePositionInRootAlgorithm( |
729 const PositionTemplate<Strategy>& position, | 729 const PositionTemplate<Strategy>& position, |
730 Node& highest_root) { | 730 Node& highest_root) { |
731 DCHECK(!NeedsLayoutTreeUpdate(highest_root)) | 731 DCHECK(!NeedsLayoutTreeUpdate(highest_root)) |
732 << position << ' ' << highest_root; | 732 << position << ' ' << highest_root; |
733 // When position falls after highestRoot, the result is easy to compute. | 733 // When position falls after highestRoot, the result is easy to compute. |
734 if (position.CompareTo( | 734 if (position.CompareTo( |
735 PositionTemplate<Strategy>::LastPositionInNode(&highest_root)) == 1) | 735 PositionTemplate<Strategy>::LastPositionInNode(highest_root)) == 1) |
736 return PositionTemplate<Strategy>::LastPositionInNode(&highest_root); | 736 return PositionTemplate<Strategy>::LastPositionInNode(highest_root); |
737 | 737 |
738 PositionTemplate<Strategy> editable_position = position; | 738 PositionTemplate<Strategy> editable_position = position; |
739 | 739 |
740 if (position.AnchorNode()->GetTreeScope() != highest_root.GetTreeScope()) { | 740 if (position.AnchorNode()->GetTreeScope() != highest_root.GetTreeScope()) { |
741 Node* shadow_ancestor = highest_root.GetTreeScope().AncestorInThisScope( | 741 Node* shadow_ancestor = highest_root.GetTreeScope().AncestorInThisScope( |
742 editable_position.AnchorNode()); | 742 editable_position.AnchorNode()); |
743 if (!shadow_ancestor) | 743 if (!shadow_ancestor) |
744 return PositionTemplate<Strategy>(); | 744 return PositionTemplate<Strategy>(); |
745 | 745 |
746 editable_position = PositionTemplate<Strategy>::FirstPositionInOrBeforeNode( | 746 editable_position = PositionTemplate<Strategy>::FirstPositionInOrBeforeNode( |
(...skipping 1432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2179 return InputType::kDeleteSoftLineBackward; | 2179 return InputType::kDeleteSoftLineBackward; |
2180 if (granularity == kParagraphBoundary) | 2180 if (granularity == kParagraphBoundary) |
2181 return InputType::kDeleteHardLineBackward; | 2181 return InputType::kDeleteHardLineBackward; |
2182 return InputType::kDeleteContentBackward; | 2182 return InputType::kDeleteContentBackward; |
2183 default: | 2183 default: |
2184 return InputType::kNone; | 2184 return InputType::kNone; |
2185 } | 2185 } |
2186 } | 2186 } |
2187 | 2187 |
2188 } // namespace blink | 2188 } // namespace blink |
OLD | NEW |