Chromium Code Reviews| 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 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 611 editablePosition.anchorNode() != &highestRoot && | 611 editablePosition.anchorNode() != &highestRoot && |
| 612 !editablePosition.anchorNode()->isDescendantOf(&highestRoot)) | 612 !editablePosition.anchorNode()->isDescendantOf(&highestRoot)) |
| 613 return PositionTemplate<Strategy>(); | 613 return PositionTemplate<Strategy>(); |
| 614 | 614 |
| 615 // If |editablePosition| has the non-editable child skipped, get the next | 615 // If |editablePosition| has the non-editable child skipped, get the next |
| 616 // sibling position. If not, we can't get the next paragraph in | 616 // sibling position. If not, we can't get the next paragraph in |
| 617 // InsertListCommand::doApply's while loop. See http://crbug.com/571420 | 617 // InsertListCommand::doApply's while loop. See http://crbug.com/571420 |
| 618 if (nonEditableNode && | 618 if (nonEditableNode && |
| 619 nonEditableNode->isDescendantOf(editablePosition.anchorNode())) | 619 nonEditableNode->isDescendantOf(editablePosition.anchorNode())) |
| 620 editablePosition = nextVisuallyDistinctCandidate(editablePosition); | 620 editablePosition = nextVisuallyDistinctCandidate(editablePosition); |
| 621 | |
| 622 // if |editablePosition| is not editable, return the last editable position. | |
| 623 // See http://crbug.com/669229. | |
| 624 if (!isEditablePosition(editablePosition)) | |
|
yosin_UTC9
2016/12/07 05:07:15
I think we should revise implementation of this fu
| |
| 625 return PositionTemplate<Strategy>(&highestRoot, 1); | |
| 626 | |
| 621 return editablePosition; | 627 return editablePosition; |
| 622 } | 628 } |
| 623 | 629 |
| 624 Position firstEditablePositionAfterPositionInRoot(const Position& position, | 630 Position firstEditablePositionAfterPositionInRoot(const Position& position, |
| 625 Node& highestRoot) { | 631 Node& highestRoot) { |
| 626 return firstEditablePositionAfterPositionInRootAlgorithm<EditingStrategy>( | 632 return firstEditablePositionAfterPositionInRootAlgorithm<EditingStrategy>( |
| 627 position, highestRoot); | 633 position, highestRoot); |
| 628 } | 634 } |
| 629 | 635 |
| 630 PositionInFlatTree firstEditablePositionAfterPositionInRoot( | 636 PositionInFlatTree firstEditablePositionAfterPositionInRoot( |
| (...skipping 1511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2142 return InputType::DeleteWordBackward; | 2148 return InputType::DeleteWordBackward; |
| 2143 if (granularity == LineBoundary) | 2149 if (granularity == LineBoundary) |
| 2144 return InputType::DeleteLineBackward; | 2150 return InputType::DeleteLineBackward; |
| 2145 return InputType::DeleteContentBackward; | 2151 return InputType::DeleteContentBackward; |
| 2146 default: | 2152 default: |
| 2147 return InputType::None; | 2153 return InputType::None; |
| 2148 } | 2154 } |
| 2149 } | 2155 } |
| 2150 | 2156 |
| 2151 } // namespace blink | 2157 } // namespace blink |
| OLD | NEW |