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

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

Issue 1868473002: Use PositionMoveType::GraphemeBoundary (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove PositionMoveType::CodePoint Created 4 years, 8 months 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/Source/core/editing/commands/BreakBlockquoteCommand.cpp ('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) 2005 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2005 Apple Computer, 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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 startPosition = positionAvoidingSpecialElementBoundary(startPosition, editin gState); 188 startPosition = positionAvoidingSpecialElementBoundary(startPosition, editin gState);
189 if (editingState->isAborted()) 189 if (editingState->isAborted())
190 return; 190 return;
191 191
192 Position endPosition; 192 Position endPosition;
193 193
194 if (m_text == "\t" && isRichlyEditablePosition(startPosition)) { 194 if (m_text == "\t" && isRichlyEditablePosition(startPosition)) {
195 endPosition = insertTab(startPosition, editingState); 195 endPosition = insertTab(startPosition, editingState);
196 if (editingState->isAborted()) 196 if (editingState->isAborted())
197 return; 197 return;
198 // TODO(yosin) We should use |PositionMoveType::CodePoint| for 198 startPosition = previousPositionOf(endPosition, PositionMoveType::Graphe meCluster);
199 // |previousPositionOf()|.
200 startPosition = previousPositionOf(endPosition, PositionMoveType::CodePo int);
201 if (placeholder.isNotNull()) 199 if (placeholder.isNotNull())
202 removePlaceholderAt(placeholder); 200 removePlaceholderAt(placeholder);
203 } else { 201 } else {
204 // Make sure the document is set up to receive m_text 202 // Make sure the document is set up to receive m_text
205 startPosition = positionInsideTextNode(startPosition, editingState); 203 startPosition = positionInsideTextNode(startPosition, editingState);
206 if (editingState->isAborted()) 204 if (editingState->isAborted())
207 return; 205 return;
208 ASSERT(startPosition.isOffsetInAnchor()); 206 ASSERT(startPosition.isOffsetInAnchor());
209 ASSERT(startPosition.computeContainerNode()); 207 ASSERT(startPosition.computeContainerNode());
210 ASSERT(startPosition.computeContainerNode()->isTextNode()); 208 ASSERT(startPosition.computeContainerNode()->isTextNode());
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 } 280 }
283 } 281 }
284 if (editingState->isAborted()) 282 if (editingState->isAborted())
285 return Position(); 283 return Position();
286 284
287 // return the position following the new tab 285 // return the position following the new tab
288 return lastPositionInNode(spanElement.get()); 286 return lastPositionInNode(spanElement.get());
289 } 287 }
290 288
291 } // namespace blink 289 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/commands/BreakBlockquoteCommand.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698