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

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

Issue 1285233004: Get rid of a redundant argument DOWNSTREAM from VisiblePosition constructor call sites (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-19T12:36:19 Rebase Created 5 years, 4 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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 if (!typingStyle->isEmpty()) 224 if (!typingStyle->isEmpty())
225 applyStyle(typingStyle.get()); 225 applyStyle(typingStyle.get());
226 } 226 }
227 227
228 if (!m_selectInsertedText) 228 if (!m_selectInsertedText)
229 setEndingSelection(VisibleSelection(endingSelection().end(), endingSelec tion().affinity(), endingSelection().isDirectional())); 229 setEndingSelection(VisibleSelection(endingSelection().end(), endingSelec tion().affinity(), endingSelection().isDirectional()));
230 } 230 }
231 231
232 Position InsertTextCommand::insertTab(const Position& pos) 232 Position InsertTextCommand::insertTab(const Position& pos)
233 { 233 {
234 Position insertPos = VisiblePosition(pos, DOWNSTREAM).deepEquivalent(); 234 Position insertPos = VisiblePosition(pos).deepEquivalent();
235 if (insertPos.isNull()) 235 if (insertPos.isNull())
236 return pos; 236 return pos;
237 237
238 Node* node = insertPos.computeContainerNode(); 238 Node* node = insertPos.computeContainerNode();
239 unsigned offset = node->isTextNode() ? insertPos.offsetInContainerNode() : 0 ; 239 unsigned offset = node->isTextNode() ? insertPos.offsetInContainerNode() : 0 ;
240 240
241 // keep tabs coalesced in tab span 241 // keep tabs coalesced in tab span
242 if (isTabHTMLSpanElementTextNode(node)) { 242 if (isTabHTMLSpanElementTextNode(node)) {
243 RefPtrWillBeRawPtr<Text> textNode = toText(node); 243 RefPtrWillBeRawPtr<Text> textNode = toText(node);
244 insertTextIntoNode(textNode, offset, "\t"); 244 insertTextIntoNode(textNode, offset, "\t");
(...skipping 19 matching lines...) Expand all
264 splitTextNode(textNode, offset); 264 splitTextNode(textNode, offset);
265 insertNodeBefore(spanElement, textNode.release()); 265 insertNodeBefore(spanElement, textNode.release());
266 } 266 }
267 } 267 }
268 268
269 // return the position following the new tab 269 // return the position following the new tab
270 return lastPositionInNode(spanElement.get()); 270 return lastPositionInNode(spanElement.get());
271 } 271 }
272 272
273 } 273 }
OLDNEW
« no previous file with comments | « Source/core/editing/VisibleUnits.cpp ('k') | Source/core/editing/commands/ReplaceSelectionCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698