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

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

Issue 23819007: Have Node::document() return a reference instead of a pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master 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, 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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 if (listChild && listChild->hasTagName(liTag)) 371 if (listChild && listChild->hasTagName(liTag))
372 insertionPos = positionInParentBeforeNode(listChild); 372 insertionPos = positionInParentBeforeNode(listChild);
373 373
374 insertNodeAt(listElement, insertionPos); 374 insertNodeAt(listElement, insertionPos);
375 375
376 // We inserted the list at the start of the content we're about to move 376 // We inserted the list at the start of the content we're about to move
377 // Update the start of content, so we don't try to move the list into it self. bug 19066 377 // Update the start of content, so we don't try to move the list into it self. bug 19066
378 // Layout is necessary since start's node's inline renderers may have be en destroyed by the insertion 378 // Layout is necessary since start's node's inline renderers may have be en destroyed by the insertion
379 // The end of the content may have changed after the insertion and layou t so update it as well. 379 // The end of the content may have changed after the insertion and layou t so update it as well.
380 if (insertionPos == start.deepEquivalent()) { 380 if (insertionPos == start.deepEquivalent()) {
381 listElement->document()->updateLayoutIgnorePendingStylesheets(); 381 listElement->document().updateLayoutIgnorePendingStylesheets();
382 start = startOfParagraph(originalStart, CanSkipOverEditingBoundary); 382 start = startOfParagraph(originalStart, CanSkipOverEditingBoundary);
383 end = endOfParagraph(start, CanSkipOverEditingBoundary); 383 end = endOfParagraph(start, CanSkipOverEditingBoundary);
384 } 384 }
385 } 385 }
386 386
387 moveParagraph(start, end, positionBeforeNode(placeholder.get()), true); 387 moveParagraph(start, end, positionBeforeNode(placeholder.get()), true);
388 388
389 if (listElement) 389 if (listElement)
390 return mergeWithNeighboringLists(listElement); 390 return mergeWithNeighboringLists(listElement);
391 391
392 if (canMergeLists(previousList, nextList)) 392 if (canMergeLists(previousList, nextList))
393 mergeIdenticalElements(previousList, nextList); 393 mergeIdenticalElements(previousList, nextList);
394 394
395 return listElement; 395 return listElement;
396 } 396 }
397 397
398 } 398 }
OLDNEW
« no previous file with comments | « Source/core/editing/InsertIntoTextNodeCommand.cpp ('k') | Source/core/editing/InsertNodeBeforeCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698