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

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

Issue 2366693005: Mark paragraph-related functions deprecated in VisibleUnits (Closed)
Patch Set: Add output for DCHECK Created 4 years, 2 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
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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 163
164 Position placeholder; 164 Position placeholder;
165 // We want to remove preserved newlines and brs that will collapse (and thus become unnecessary) when content 165 // We want to remove preserved newlines and brs that will collapse (and thus become unnecessary) when content
166 // is inserted just before them. 166 // is inserted just before them.
167 // FIXME: We shouldn't really have to do this, but removing placeholders is a workaround for 9661. 167 // FIXME: We shouldn't really have to do this, but removing placeholders is a workaround for 9661.
168 // If the caret is just before a placeholder, downstream will normalize the caret to it. 168 // If the caret is just before a placeholder, downstream will normalize the caret to it.
169 Position downstream(mostForwardCaretPosition(startPosition)); 169 Position downstream(mostForwardCaretPosition(startPosition));
170 if (lineBreakExistsAtPosition(downstream)) { 170 if (lineBreakExistsAtPosition(downstream)) {
171 // FIXME: This doesn't handle placeholders at the end of anonymous block s. 171 // FIXME: This doesn't handle placeholders at the end of anonymous block s.
172 VisiblePosition caret = createVisiblePositionDeprecated(startPosition); 172 VisiblePosition caret = createVisiblePositionDeprecated(startPosition);
173 if (isEndOfBlock(caret) && isStartOfParagraph(caret)) 173 if (isEndOfBlock(caret) && isStartOfParagraphDeprecated(caret))
174 placeholder = downstream; 174 placeholder = downstream;
175 // Don't remove the placeholder yet, otherwise the block we're inserting into would collapse before 175 // Don't remove the placeholder yet, otherwise the block we're inserting into would collapse before
176 // we get a chance to insert into it. We check for a placeholder now, t hough, because doing so requires 176 // we get a chance to insert into it. We check for a placeholder now, t hough, because doing so requires
177 // the creation of a VisiblePosition, and if we did that post-insertion it would force a layout. 177 // the creation of a VisiblePosition, and if we did that post-insertion it would force a layout.
178 } 178 }
179 179
180 // Insert the character at the leftmost candidate. 180 // Insert the character at the leftmost candidate.
181 startPosition = mostBackwardCaretPosition(startPosition); 181 startPosition = mostBackwardCaretPosition(startPosition);
182 182
183 // It is possible for the node that contains startPosition to contain only u nrendered whitespace, 183 // It is possible for the node that contains startPosition to contain only u nrendered whitespace,
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 } 285 }
286 } 286 }
287 if (editingState->isAborted()) 287 if (editingState->isAborted())
288 return Position(); 288 return Position();
289 289
290 // return the position following the new tab 290 // return the position following the new tab
291 return Position::lastPositionInNode(spanElement); 291 return Position::lastPositionInNode(spanElement);
292 } 292 }
293 293
294 } // namespace blink 294 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698