| 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 13 matching lines...) Expand all Loading... |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #include "config.h" | 26 #include "config.h" |
| 27 #include "core/editing/InsertNodeBeforeCommand.h" | 27 #include "core/editing/InsertNodeBeforeCommand.h" |
| 28 | 28 |
| 29 #include "bindings/v8/ExceptionStatePlaceholder.h" | 29 #include "bindings/v8/ExceptionStatePlaceholder.h" |
| 30 #include "core/dom/Document.h" | 30 #include "core/dom/Document.h" |
| 31 | 31 |
| 32 namespace WebCore { | 32 namespace WebCore { |
| 33 | 33 |
| 34 InsertNodeBeforeCommand::InsertNodeBeforeCommand(PassRefPtr<Node> insertChild, P
assRefPtr<Node> refChild, | 34 InsertNodeBeforeCommand::InsertNodeBeforeCommand(PassRefPtrWillBeRawPtr<Node> in
sertChild, PassRefPtrWillBeRawPtr<Node> refChild, |
| 35 ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable) | 35 ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable) |
| 36 : SimpleEditCommand(refChild->document()) | 36 : SimpleEditCommand(refChild->document()) |
| 37 , m_insertChild(insertChild) | 37 , m_insertChild(insertChild) |
| 38 , m_refChild(refChild) | 38 , m_refChild(refChild) |
| 39 , m_shouldAssumeContentIsAlwaysEditable(shouldAssumeContentIsAlwaysEditable) | 39 , m_shouldAssumeContentIsAlwaysEditable(shouldAssumeContentIsAlwaysEditable) |
| 40 { | 40 { |
| 41 ASSERT(m_insertChild); | 41 ASSERT(m_insertChild); |
| 42 ASSERT(!m_insertChild->parentNode()); | 42 ASSERT(!m_insertChild->parentNode()); |
| 43 ASSERT(m_refChild); | 43 ASSERT(m_refChild); |
| 44 ASSERT(m_refChild->parentNode()); | 44 ASSERT(m_refChild->parentNode()); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 57 } | 57 } |
| 58 | 58 |
| 59 void InsertNodeBeforeCommand::doUnapply() | 59 void InsertNodeBeforeCommand::doUnapply() |
| 60 { | 60 { |
| 61 if (!m_insertChild->isContentEditable(Node::UserSelectAllIsAlwaysNonEditable
)) | 61 if (!m_insertChild->isContentEditable(Node::UserSelectAllIsAlwaysNonEditable
)) |
| 62 return; | 62 return; |
| 63 | 63 |
| 64 m_insertChild->remove(IGNORE_EXCEPTION); | 64 m_insertChild->remove(IGNORE_EXCEPTION); |
| 65 } | 65 } |
| 66 | 66 |
| 67 void InsertNodeBeforeCommand::trace(Visitor* visitor) |
| 68 { |
| 69 visitor->trace(m_insertChild); |
| 70 visitor->trace(m_refChild); |
| 71 SimpleEditCommand::trace(visitor); |
| 67 } | 72 } |
| 73 |
| 74 } |
| OLD | NEW |