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

Side by Side Diff: Source/core/editing/ModifySelectionListLevel.cpp

Issue 23548010: Have htmlediting create functions take a Document reference in argument (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 | Annotate | Revision Log
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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 } else { 183 } else {
184 // create a sublist for the preceding element and move nodes there 184 // create a sublist for the preceding element and move nodes there
185 RefPtr<Element> newParent; 185 RefPtr<Element> newParent;
186 switch (m_listType) { 186 switch (m_listType) {
187 case InheritedListType: 187 case InheritedListType:
188 newParent = startListChild->parentElement(); 188 newParent = startListChild->parentElement();
189 if (newParent) 189 if (newParent)
190 newParent = newParent->cloneElementWithoutChildren(); 190 newParent = newParent->cloneElementWithoutChildren();
191 break; 191 break;
192 case OrderedList: 192 case OrderedList:
193 newParent = createOrderedListElement(&document()); 193 newParent = createOrderedListElement(document());
194 break; 194 break;
195 case UnorderedList: 195 case UnorderedList:
196 newParent = createUnorderedListElement(&document()); 196 newParent = createUnorderedListElement(document());
197 break; 197 break;
198 } 198 }
199 insertNodeBefore(newParent, startListChild); 199 insertNodeBefore(newParent, startListChild);
200 appendSiblingNodeRange(startListChild, endListChild, newParent.get()); 200 appendSiblingNodeRange(startListChild, endListChild, newParent.get());
201 m_listElement = newParent.release(); 201 m_listElement = newParent.release();
202 } 202 }
203 } 203 }
204 204
205 bool IncreaseSelectionListLevelCommand::canIncreaseSelectionListLevel(Document& document) 205 bool IncreaseSelectionListLevelCommand::canIncreaseSelectionListLevel(Document& document)
206 { 206 {
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 return canDecreaseListLevel(document.frame()->selection()->selection(), star tListChild, endListChild); 284 return canDecreaseListLevel(document.frame()->selection()->selection(), star tListChild, endListChild);
285 } 285 }
286 286
287 void DecreaseSelectionListLevelCommand::decreaseSelectionListLevel(Document& doc ument) 287 void DecreaseSelectionListLevelCommand::decreaseSelectionListLevel(Document& doc ument)
288 { 288 {
289 ASSERT(document.frame()); 289 ASSERT(document.frame());
290 applyCommand(create(document)); 290 applyCommand(create(document));
291 } 291 }
292 292
293 } 293 }
OLDNEW
« no previous file with comments | « Source/core/editing/InsertTextCommand.cpp ('k') | Source/core/editing/ReplaceNodeWithSpanCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698