OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |