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

Side by Side Diff: third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommand.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 * Copyright (C) 2010 Google Inc. All rights reserved. 3 * Copyright (C) 2010 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 Position start = mostForwardCaretPosition(startOfSelection.deepEquivalent()) ; 114 Position start = mostForwardCaretPosition(startOfSelection.deepEquivalent()) ;
115 if (isAtUnsplittableElement(start)) { 115 if (isAtUnsplittableElement(start)) {
116 HTMLElement* blockquote = createBlockElement(); 116 HTMLElement* blockquote = createBlockElement();
117 insertNodeAt(blockquote, start, editingState); 117 insertNodeAt(blockquote, start, editingState);
118 if (editingState->isAborted()) 118 if (editingState->isAborted())
119 return; 119 return;
120 HTMLBRElement* placeholder = HTMLBRElement::create(document()); 120 HTMLBRElement* placeholder = HTMLBRElement::create(document());
121 appendNode(placeholder, blockquote, editingState); 121 appendNode(placeholder, blockquote, editingState);
122 if (editingState->isAborted()) 122 if (editingState->isAborted())
123 return; 123 return;
124 setEndingSelection(VisibleSelection(positionBeforeNode(placeholder), Tex tAffinity::Downstream, endingSelection().isDirectional())); 124 setEndingSelection(VisibleSelection(Position::beforeNode(placeholder), T extAffinity::Downstream, endingSelection().isDirectional()));
125 return; 125 return;
126 } 126 }
127 127
128 HTMLElement* blockquoteForNextIndent = nullptr; 128 HTMLElement* blockquoteForNextIndent = nullptr;
129 VisiblePosition endOfCurrentParagraph = endOfParagraph(startOfSelection); 129 VisiblePosition endOfCurrentParagraph = endOfParagraph(startOfSelection);
130 VisiblePosition endOfLastParagraph = endOfParagraph(endOfSelection); 130 VisiblePosition endOfLastParagraph = endOfParagraph(endOfSelection);
131 VisiblePosition endAfterSelection = endOfParagraph(nextPositionOf(endOfLastP aragraph)); 131 VisiblePosition endAfterSelection = endOfParagraph(nextPositionOf(endOfLastP aragraph));
132 m_endOfLastParagraph = endOfLastParagraph.deepEquivalent(); 132 m_endOfLastParagraph = endOfLastParagraph.deepEquivalent();
133 133
134 bool atEnd = false; 134 bool atEnd = false;
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 return element; 301 return element;
302 } 302 }
303 303
304 DEFINE_TRACE(ApplyBlockElementCommand) 304 DEFINE_TRACE(ApplyBlockElementCommand)
305 { 305 {
306 visitor->trace(m_endOfLastParagraph); 306 visitor->trace(m_endOfLastParagraph);
307 CompositeEditCommand::trace(visitor); 307 CompositeEditCommand::trace(visitor);
308 } 308 }
309 309
310 } // namespace blink 310 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698