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

Side by Side Diff: Source/core/editing/CompositeEditCommand.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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2007, 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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 361
362 void CompositeEditCommand::appendNode(PassRefPtrWillBeRawPtr<Node> node, PassRef PtrWillBeRawPtr<ContainerNode> parent) 362 void CompositeEditCommand::appendNode(PassRefPtrWillBeRawPtr<Node> node, PassRef PtrWillBeRawPtr<ContainerNode> parent)
363 { 363 {
364 ASSERT(canHaveChildrenForEditing(parent.get())); 364 ASSERT(canHaveChildrenForEditing(parent.get()));
365 applyCommandToComposite(AppendNodeCommand::create(parent, node)); 365 applyCommandToComposite(AppendNodeCommand::create(parent, node));
366 } 366 }
367 367
368 void CompositeEditCommand::removeChildrenInRange(PassRefPtrWillBeRawPtr<Node> no de, unsigned from, unsigned to) 368 void CompositeEditCommand::removeChildrenInRange(PassRefPtrWillBeRawPtr<Node> no de, unsigned from, unsigned to)
369 { 369 {
370 WillBeHeapVector<RefPtrWillBeMember<Node> > children; 370 WillBeHeapVector<RefPtrWillBeMember<Node> > children;
371 Node* child = node->traverseToChildAt(from); 371 Node* child = NodeTraversal::childAt(*node, from);
372 for (unsigned i = from; child && i < to; i++, child = child->nextSibling()) 372 for (unsigned i = from; child && i < to; i++, child = child->nextSibling())
373 children.append(child); 373 children.append(child);
374 374
375 size_t size = children.size(); 375 size_t size = children.size();
376 for (size_t i = 0; i < size; ++i) 376 for (size_t i = 0; i < size; ++i)
377 removeNode(children[i].release()); 377 removeNode(children[i].release());
378 } 378 }
379 379
380 void CompositeEditCommand::removeNode(PassRefPtrWillBeRawPtr<Node> node, ShouldA ssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable) 380 void CompositeEditCommand::removeNode(PassRefPtrWillBeRawPtr<Node> node, ShouldA ssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable)
381 { 381 {
(...skipping 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after
1499 } 1499 }
1500 1500
1501 void CompositeEditCommand::trace(Visitor* visitor) 1501 void CompositeEditCommand::trace(Visitor* visitor)
1502 { 1502 {
1503 visitor->trace(m_commands); 1503 visitor->trace(m_commands);
1504 visitor->trace(m_composition); 1504 visitor->trace(m_composition);
1505 EditCommand::trace(visitor); 1505 EditCommand::trace(visitor);
1506 } 1506 }
1507 1507
1508 } // namespace blink 1508 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/editing/BreakBlockquoteCommand.cpp ('k') | Source/core/editing/DeleteSelectionCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698