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 15 matching lines...) Expand all Loading... |
26 #include "config.h" | 26 #include "config.h" |
27 #include "core/editing/MergeIdenticalElementsCommand.h" | 27 #include "core/editing/MergeIdenticalElementsCommand.h" |
28 | 28 |
29 #include "bindings/v8/ExceptionState.h" | 29 #include "bindings/v8/ExceptionState.h" |
30 #include "bindings/v8/ExceptionStatePlaceholder.h" | 30 #include "bindings/v8/ExceptionStatePlaceholder.h" |
31 #include "core/dom/Element.h" | 31 #include "core/dom/Element.h" |
32 | 32 |
33 namespace WebCore { | 33 namespace WebCore { |
34 | 34 |
35 MergeIdenticalElementsCommand::MergeIdenticalElementsCommand(PassRefPtr<Element>
first, PassRefPtr<Element> second) | 35 MergeIdenticalElementsCommand::MergeIdenticalElementsCommand(PassRefPtr<Element>
first, PassRefPtr<Element> second) |
36 : SimpleEditCommand(&first->document()) | 36 : SimpleEditCommand(first->document()) |
37 , m_element1(first) | 37 , m_element1(first) |
38 , m_element2(second) | 38 , m_element2(second) |
39 { | 39 { |
40 ASSERT(m_element1); | 40 ASSERT(m_element1); |
41 ASSERT(m_element2); | 41 ASSERT(m_element2); |
42 ASSERT(m_element1->nextSibling() == m_element2); | 42 ASSERT(m_element1->nextSibling() == m_element2); |
43 } | 43 } |
44 | 44 |
45 void MergeIdenticalElementsCommand::doApply() | 45 void MergeIdenticalElementsCommand::doApply() |
46 { | 46 { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 | 88 |
89 #ifndef NDEBUG | 89 #ifndef NDEBUG |
90 void MergeIdenticalElementsCommand::getNodesInCommand(HashSet<Node*>& nodes) | 90 void MergeIdenticalElementsCommand::getNodesInCommand(HashSet<Node*>& nodes) |
91 { | 91 { |
92 addNodeAndDescendants(m_element1.get(), nodes); | 92 addNodeAndDescendants(m_element1.get(), nodes); |
93 addNodeAndDescendants(m_element2.get(), nodes); | 93 addNodeAndDescendants(m_element2.get(), nodes); |
94 } | 94 } |
95 #endif | 95 #endif |
96 | 96 |
97 } // namespace WebCore | 97 } // namespace WebCore |
OLD | NEW |