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 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 WillBeHeapVector<RefPtrWillBeMember<Node>> children; | 386 WillBeHeapVector<RefPtrWillBeMember<Node>> children; |
387 Node* child = NodeTraversal::childAt(*node, from); | 387 Node* child = NodeTraversal::childAt(*node, from); |
388 for (unsigned i = from; child && i < to; i++, child = child->nextSibling()) | 388 for (unsigned i = from; child && i < to; i++, child = child->nextSibling()) |
389 children.append(child); | 389 children.append(child); |
390 | 390 |
391 size_t size = children.size(); | 391 size_t size = children.size(); |
392 for (size_t i = 0; i < size; ++i) | 392 for (size_t i = 0; i < size; ++i) |
393 removeNode(children[i].release()); | 393 removeNode(children[i].release()); |
394 } | 394 } |
395 | 395 |
396 void CompositeEditCommand::removeNode(PassRefPtrWillBeRawPtr<Node> node, ShouldA
ssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable) | 396 void CompositeEditCommand::removeNode(PassRefPtrWillBeRawPtr<Node> node, Editing
State* editingState, ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAl
waysEditable) |
397 { | 397 { |
398 if (!node || !node->nonShadowBoundaryParentNode()) | 398 if (!node || !node->nonShadowBoundaryParentNode()) |
399 return; | 399 return; |
400 applyCommandToComposite(RemoveNodeCommand::create(node, shouldAssumeContentI
sAlwaysEditable)); | 400 ASSERT_IN_EDITING_COMMAND(node->document().frame()); |
| 401 applyCommandToComposite(RemoveNodeCommand::create(node, shouldAssumeContentI
sAlwaysEditable), editingState); |
401 } | 402 } |
402 | 403 |
403 void CompositeEditCommand::removeNodePreservingChildren(PassRefPtrWillBeRawPtr<N
ode> node, EditingState* editingState, ShouldAssumeContentIsAlwaysEditable shoul
dAssumeContentIsAlwaysEditable) | 404 void CompositeEditCommand::removeNodePreservingChildren(PassRefPtrWillBeRawPtr<N
ode> node, EditingState* editingState, ShouldAssumeContentIsAlwaysEditable shoul
dAssumeContentIsAlwaysEditable) |
404 { | 405 { |
405 ASSERT_IN_EDITING_COMMAND(node->document().frame()); | 406 ASSERT_IN_EDITING_COMMAND(node->document().frame()); |
406 applyCommandToComposite(RemoveNodePreservingChildrenCommand::create(node, sh
ouldAssumeContentIsAlwaysEditable)); | 407 applyCommandToComposite(RemoveNodePreservingChildrenCommand::create(node, sh
ouldAssumeContentIsAlwaysEditable)); |
407 } | 408 } |
408 | 409 |
409 void CompositeEditCommand::removeNodeAndPruneAncestors(PassRefPtrWillBeRawPtr<No
de> node, Node* excludeNode) | 410 void CompositeEditCommand::removeNodeAndPruneAncestors(PassRefPtrWillBeRawPtr<No
de> node, Node* excludeNode) |
410 { | 411 { |
(...skipping 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1518 } | 1519 } |
1519 | 1520 |
1520 DEFINE_TRACE(CompositeEditCommand) | 1521 DEFINE_TRACE(CompositeEditCommand) |
1521 { | 1522 { |
1522 visitor->trace(m_commands); | 1523 visitor->trace(m_commands); |
1523 visitor->trace(m_composition); | 1524 visitor->trace(m_composition); |
1524 EditCommand::trace(visitor); | 1525 EditCommand::trace(visitor); |
1525 } | 1526 } |
1526 | 1527 |
1527 } // namespace blink | 1528 } // namespace blink |
OLD | NEW |