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

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

Issue 1312213008: Move member function rootEditableElement() out from VisiblePosition class (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-31T17:55:42 Include VisiblePosition.h Created 5 years, 3 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
« no previous file with comments | « Source/core/editing/VisiblePosition.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2010 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 172
173 // Save and restore endOfSelection and startOfLastParagraph when necessary 173 // Save and restore endOfSelection and startOfLastParagraph when necessary
174 // since moveParagraph and movePragraphWithClones can remove nod es. 174 // since moveParagraph and movePragraphWithClones can remove nod es.
175 if (!doApplyForSingleParagraph(forceListCreation, listTag, *curr entSelection)) 175 if (!doApplyForSingleParagraph(forceListCreation, listTag, *curr entSelection))
176 break; 176 break;
177 if (endOfSelection.isNull() || endOfSelection.isOrphan() || star tOfLastParagraph.isNull() || startOfLastParagraph.isOrphan()) { 177 if (endOfSelection.isNull() || endOfSelection.isOrphan() || star tOfLastParagraph.isNull() || startOfLastParagraph.isOrphan()) {
178 endOfSelection = visiblePositionForIndex(indexForEndOfSelect ion, scopeForEndOfSelection.get()); 178 endOfSelection = visiblePositionForIndex(indexForEndOfSelect ion, scopeForEndOfSelection.get());
179 // If endOfSelection is null, then some contents have been d eleted from the document. 179 // If endOfSelection is null, then some contents have been d eleted from the document.
180 // This should never happen and if it did, exit early immedi ately because we've lost the loop invariant. 180 // This should never happen and if it did, exit early immedi ately because we've lost the loop invariant.
181 ASSERT(endOfSelection.isNotNull()); 181 ASSERT(endOfSelection.isNotNull());
182 if (endOfSelection.isNull() || !endOfSelection.rootEditableE lement()) 182 if (endOfSelection.isNull() || !rootEditableElementOf(endOfS election))
183 return; 183 return;
184 startOfLastParagraph = startOfParagraph(endOfSelection, CanS kipOverEditingBoundary); 184 startOfLastParagraph = startOfParagraph(endOfSelection, CanS kipOverEditingBoundary);
185 } 185 }
186 186
187 startOfCurrentParagraph = startOfNextParagraph(endingSelection() .visibleStart()); 187 startOfCurrentParagraph = startOfNextParagraph(endingSelection() .visibleStart());
188 } 188 }
189 setEndingSelection(endOfSelection); 189 setEndingSelection(endOfSelection);
190 } 190 }
191 doApplyForSingleParagraph(forceListCreation, listTag, *currentSelection) ; 191 doApplyForSingleParagraph(forceListCreation, listTag, *currentSelection) ;
192 // Fetch the end of the selection, for the reason mentioned above. 192 // Fetch the end of the selection, for the reason mentioned above.
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 return listElement; 427 return listElement;
428 } 428 }
429 429
430 DEFINE_TRACE(InsertListCommand) 430 DEFINE_TRACE(InsertListCommand)
431 { 431 {
432 visitor->trace(m_listElement); 432 visitor->trace(m_listElement);
433 CompositeEditCommand::trace(visitor); 433 CompositeEditCommand::trace(visitor);
434 } 434 }
435 435
436 } 436 }
OLDNEW
« no previous file with comments | « Source/core/editing/VisiblePosition.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698