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

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

Issue 425223005: Move Node/ContainerNode's traverseToChildAt() to NodeTraversal (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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
« no previous file with comments | « Source/core/editing/DeleteSelectionCommand.cpp ('k') | Source/core/editing/TextIterator.cpp » ('j') | 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) 2005, 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2005, 2006 Apple Computer, 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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 insertNodeBefore(listChildToInsert.get(), listChild); 276 insertNodeBefore(listChildToInsert.get(), listChild);
277 } else { 277 } else {
278 refNode = startBlock.get(); 278 refNode = startBlock.get();
279 } 279 }
280 } else if (isFirstInBlock && nestNewBlock) { 280 } else if (isFirstInBlock && nestNewBlock) {
281 // startBlock should always have children, otherwise isLastInBlock w ould be true and it's handled above. 281 // startBlock should always have children, otherwise isLastInBlock w ould be true and it's handled above.
282 ASSERT(startBlock->hasChildren()); 282 ASSERT(startBlock->hasChildren());
283 refNode = startBlock->firstChild(); 283 refNode = startBlock->firstChild();
284 } 284 }
285 else if (insertionPosition.deprecatedNode() == startBlock && nestNewBloc k) { 285 else if (insertionPosition.deprecatedNode() == startBlock && nestNewBloc k) {
286 refNode = startBlock->traverseToChildAt(insertionPosition.deprecated EditingOffset()); 286 refNode = NodeTraversal::childAt(*startBlock, insertionPosition.depr ecatedEditingOffset());
287 ASSERT(refNode); // must be true or we'd be in the end of block case 287 ASSERT(refNode); // must be true or we'd be in the end of block case
288 } else 288 } else
289 refNode = insertionPosition.deprecatedNode(); 289 refNode = insertionPosition.deprecatedNode();
290 290
291 // find ending selection position easily before inserting the paragraph 291 // find ending selection position easily before inserting the paragraph
292 insertionPosition = insertionPosition.downstream(); 292 insertionPosition = insertionPosition.downstream();
293 293
294 if (refNode) 294 if (refNode)
295 insertNodeBefore(blockToInsert, refNode); 295 insertNodeBefore(blockToInsert, refNode);
296 296
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 } 429 }
430 430
431 void InsertParagraphSeparatorCommand::trace(Visitor *visitor) 431 void InsertParagraphSeparatorCommand::trace(Visitor *visitor)
432 { 432 {
433 visitor->trace(m_style); 433 visitor->trace(m_style);
434 CompositeEditCommand::trace(visitor); 434 CompositeEditCommand::trace(visitor);
435 } 435 }
436 436
437 437
438 } // namespace blink 438 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/editing/DeleteSelectionCommand.cpp ('k') | Source/core/editing/TextIterator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698