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

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

Issue 1997563002: Get rid of a redundant function alias positionBeforeNode() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-05-19T22:35:34 rebase Created 4 years, 7 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) 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2008 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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 } 224 }
225 } 225 }
226 VisiblePosition startOfParagraphToMove = startOfParagraph(visibleStartOfPara graph); 226 VisiblePosition startOfParagraphToMove = startOfParagraph(visibleStartOfPara graph);
227 VisiblePosition endOfParagraphToMove = endOfParagraph(visibleEndOfParagraph) ; 227 VisiblePosition endOfParagraphToMove = endOfParagraph(visibleEndOfParagraph) ;
228 if (startOfParagraphToMove.isNull() || endOfParagraphToMove.isNull()) 228 if (startOfParagraphToMove.isNull() || endOfParagraphToMove.isNull())
229 return; 229 return;
230 HTMLBRElement* placeholder = HTMLBRElement::create(document()); 230 HTMLBRElement* placeholder = HTMLBRElement::create(document());
231 insertNodeBefore(placeholder, splitBlockquoteNode, editingState); 231 insertNodeBefore(placeholder, splitBlockquoteNode, editingState);
232 if (editingState->isAborted()) 232 if (editingState->isAborted())
233 return; 233 return;
234 moveParagraph(startOfParagraphToMove, endOfParagraphToMove, createVisiblePos ition(positionBeforeNode(placeholder)), editingState, true); 234 moveParagraph(startOfParagraphToMove, endOfParagraphToMove, createVisiblePos ition(Position::beforeNode(placeholder)), editingState, true);
235 } 235 }
236 236
237 // FIXME: We should merge this function with ApplyBlockElementCommand::formatSel ection 237 // FIXME: We should merge this function with ApplyBlockElementCommand::formatSel ection
238 void IndentOutdentCommand::outdentRegion(const VisiblePosition& startOfSelection , const VisiblePosition& endOfSelection, EditingState* editingState) 238 void IndentOutdentCommand::outdentRegion(const VisiblePosition& startOfSelection , const VisiblePosition& endOfSelection, EditingState* editingState)
239 { 239 {
240 VisiblePosition endOfCurrentParagraph = endOfParagraph(startOfSelection); 240 VisiblePosition endOfCurrentParagraph = endOfParagraph(startOfSelection);
241 VisiblePosition endOfLastParagraph = endOfParagraph(endOfSelection); 241 VisiblePosition endOfLastParagraph = endOfParagraph(endOfSelection);
242 242
243 if (endOfCurrentParagraph.deepEquivalent() == endOfLastParagraph.deepEquival ent()) { 243 if (endOfCurrentParagraph.deepEquivalent() == endOfLastParagraph.deepEquival ent()) {
244 outdentParagraph(editingState); 244 outdentParagraph(editingState);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 bool indentingAsListItemResult = tryIndentingAsListItem(start, end, editingS tate); 286 bool indentingAsListItemResult = tryIndentingAsListItem(start, end, editingS tate);
287 if (editingState->isAborted()) 287 if (editingState->isAborted())
288 return; 288 return;
289 if (indentingAsListItemResult) 289 if (indentingAsListItemResult)
290 blockquoteForNextIndent = nullptr; 290 blockquoteForNextIndent = nullptr;
291 else 291 else
292 indentIntoBlockquote(start, end, blockquoteForNextIndent, editingState); 292 indentIntoBlockquote(start, end, blockquoteForNextIndent, editingState);
293 } 293 }
294 294
295 } // namespace blink 295 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698