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

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

Issue 2149893003: Rename Node::inShadowIncludingDocument() to Node::isConnected() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed Created 4 years, 5 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
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,
184 // and so deleteInsignificantText could remove it. Save the position before the node in case that happens. 184 // and so deleteInsignificantText could remove it. Save the position before the node in case that happens.
185 DCHECK(startPosition.computeContainerNode()) << startPosition; 185 DCHECK(startPosition.computeContainerNode()) << startPosition;
186 Position positionBeforeStartNode(Position::inParentBeforeNode(*startPosition .computeContainerNode())); 186 Position positionBeforeStartNode(Position::inParentBeforeNode(*startPosition .computeContainerNode()));
187 deleteInsignificantText(startPosition, mostForwardCaretPosition(startPositio n)); 187 deleteInsignificantText(startPosition, mostForwardCaretPosition(startPositio n));
188 if (!startPosition.inShadowIncludingDocument()) 188 if (!startPosition.isConnected())
189 startPosition = positionBeforeStartNode; 189 startPosition = positionBeforeStartNode;
190 if (!isVisuallyEquivalentCandidate(startPosition)) 190 if (!isVisuallyEquivalentCandidate(startPosition))
191 startPosition = mostForwardCaretPosition(startPosition); 191 startPosition = mostForwardCaretPosition(startPosition);
192 192
193 startPosition = positionAvoidingSpecialElementBoundary(startPosition, editin gState); 193 startPosition = positionAvoidingSpecialElementBoundary(startPosition, editin gState);
194 if (editingState->isAborted()) 194 if (editingState->isAborted())
195 return; 195 return;
196 196
197 Position endPosition; 197 Position endPosition;
198 198
(...skipping 86 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