Chromium Code Reviews| 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 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 353 // Mutation events (bug 22634) from the text node insertion may have rem oved the refChild | 353 // Mutation events (bug 22634) from the text node insertion may have rem oved the refChild |
| 354 if (!refChild->inDocument()) | 354 if (!refChild->inDocument()) |
| 355 return; | 355 return; |
| 356 insertNodeBefore(insertChild, refChild); | 356 insertNodeBefore(insertChild, refChild); |
| 357 } else | 357 } else |
| 358 insertNodeAfter(insertChild, refChild); | 358 insertNodeAfter(insertChild, refChild); |
| 359 } | 359 } |
| 360 | 360 |
| 361 void CompositeEditCommand::appendNode(PassRefPtrWillBeRawPtr<Node> node, PassRef PtrWillBeRawPtr<ContainerNode> parent) | 361 void CompositeEditCommand::appendNode(PassRefPtrWillBeRawPtr<Node> node, PassRef PtrWillBeRawPtr<ContainerNode> parent) |
| 362 { | 362 { |
| 363 ASSERT(canHaveChildrenForEditing(parent.get())); | 363 // The useFallbackContent() is not set for cloned <object> nodes. |
| 364 ASSERT(canHaveChildrenForEditing(parent.get()) | |
| 365 || (parent->isElementNode() && toElement(parent.get())->tagQName() == ob jectTag)); | |
|
yosin_UTC9
2014/11/20 01:26:41
Could you add a comment why we check OBJECT elemen
| |
| 364 applyCommandToComposite(AppendNodeCommand::create(parent, node)); | 366 applyCommandToComposite(AppendNodeCommand::create(parent, node)); |
| 365 } | 367 } |
| 366 | 368 |
| 367 void CompositeEditCommand::removeChildrenInRange(PassRefPtrWillBeRawPtr<Node> no de, unsigned from, unsigned to) | 369 void CompositeEditCommand::removeChildrenInRange(PassRefPtrWillBeRawPtr<Node> no de, unsigned from, unsigned to) |
| 368 { | 370 { |
| 369 WillBeHeapVector<RefPtrWillBeMember<Node>> children; | 371 WillBeHeapVector<RefPtrWillBeMember<Node>> children; |
| 370 Node* child = NodeTraversal::childAt(*node, from); | 372 Node* child = NodeTraversal::childAt(*node, from); |
| 371 for (unsigned i = from; child && i < to; i++, child = child->nextSibling()) | 373 for (unsigned i = from; child && i < to; i++, child = child->nextSibling()) |
| 372 children.append(child); | 374 children.append(child); |
| 373 | 375 |
| (...skipping 1119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1493 } | 1495 } |
| 1494 | 1496 |
| 1495 void CompositeEditCommand::trace(Visitor* visitor) | 1497 void CompositeEditCommand::trace(Visitor* visitor) |
| 1496 { | 1498 { |
| 1497 visitor->trace(m_commands); | 1499 visitor->trace(m_commands); |
| 1498 visitor->trace(m_composition); | 1500 visitor->trace(m_composition); |
| 1499 EditCommand::trace(visitor); | 1501 EditCommand::trace(visitor); |
| 1500 } | 1502 } |
| 1501 | 1503 |
| 1502 } // namespace blink | 1504 } // namespace blink |
| OLD | NEW |