Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1160)

Side by Side Diff: third_party/WebKit/Source/core/editing/EditingUtilities.cpp

Issue 2541153004: Keep caret show around non-editable element under editable element
Patch Set: add test case Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/editing/selection/move-cursor-over-uneditable-in-contenteditable.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/editing/selection/move-cursor-over-uneditable-in-contenteditable.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698