| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 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 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 RemoveNodeCommand::RemoveNodeCommand(PassRefPtrWillBeRawPtr<Node> node, ShouldAs
sumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable) | 34 RemoveNodeCommand::RemoveNodeCommand(PassRefPtrWillBeRawPtr<Node> node, ShouldAs
sumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable) |
| 35 : SimpleEditCommand(node->document()) | 35 : SimpleEditCommand(node->document()) |
| 36 , m_node(node) | 36 , m_node(node) |
| 37 , m_shouldAssumeContentIsAlwaysEditable(shouldAssumeContentIsAlwaysEditable) | 37 , m_shouldAssumeContentIsAlwaysEditable(shouldAssumeContentIsAlwaysEditable) |
| 38 { | 38 { |
| 39 ASSERT(m_node); | 39 ASSERT(m_node); |
| 40 ASSERT(m_node->parentNode()); | 40 ASSERT(m_node->parentNode()); |
| 41 } | 41 } |
| 42 | 42 |
| 43 void RemoveNodeCommand::doApply() | 43 void RemoveNodeCommand::doApply(EditingState*) |
| 44 { | 44 { |
| 45 ContainerNode* parent = m_node->parentNode(); | 45 ContainerNode* parent = m_node->parentNode(); |
| 46 if (!parent || (m_shouldAssumeContentIsAlwaysEditable == DoNotAssumeContentI
sAlwaysEditable | 46 if (!parent || (m_shouldAssumeContentIsAlwaysEditable == DoNotAssumeContentI
sAlwaysEditable |
| 47 && !parent->isContentEditable(Node::UserSelectAllIsAlwaysNonEditable) &&
parent->inActiveDocument())) | 47 && !parent->isContentEditable(Node::UserSelectAllIsAlwaysNonEditable) &&
parent->inActiveDocument())) |
| 48 return; | 48 return; |
| 49 ASSERT(parent->isContentEditable(Node::UserSelectAllIsAlwaysNonEditable) ||
!parent->inActiveDocument()); | 49 ASSERT(parent->isContentEditable(Node::UserSelectAllIsAlwaysNonEditable) ||
!parent->inActiveDocument()); |
| 50 | 50 |
| 51 m_parent = parent; | 51 m_parent = parent; |
| 52 m_refChild = m_node->nextSibling(); | 52 m_refChild = m_node->nextSibling(); |
| 53 | 53 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 66 | 66 |
| 67 DEFINE_TRACE(RemoveNodeCommand) | 67 DEFINE_TRACE(RemoveNodeCommand) |
| 68 { | 68 { |
| 69 visitor->trace(m_node); | 69 visitor->trace(m_node); |
| 70 visitor->trace(m_parent); | 70 visitor->trace(m_parent); |
| 71 visitor->trace(m_refChild); | 71 visitor->trace(m_refChild); |
| 72 SimpleEditCommand::trace(visitor); | 72 SimpleEditCommand::trace(visitor); |
| 73 } | 73 } |
| 74 | 74 |
| 75 } // namespace blink | 75 } // namespace blink |
| OLD | NEW |