| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 return; | 48 return; |
| 49 | 49 |
| 50 m_atChild = m_element2->firstChild(); | 50 m_atChild = m_element2->firstChild(); |
| 51 | 51 |
| 52 Vector<RefPtr<Node> > children; | 52 Vector<RefPtr<Node> > children; |
| 53 for (Node* child = m_element1->firstChild(); child; child = child->nextSibli
ng()) | 53 for (Node* child = m_element1->firstChild(); child; child = child->nextSibli
ng()) |
| 54 children.append(child); | 54 children.append(child); |
| 55 | 55 |
| 56 size_t size = children.size(); | 56 size_t size = children.size(); |
| 57 for (size_t i = 0; i < size; ++i) | 57 for (size_t i = 0; i < size; ++i) |
| 58 m_element2->insertBefore(children[i].release(), m_atChild.get(), IGNORE_
EXCEPTION_STATE); | 58 m_element2->insertBefore(children[i].release(), m_atChild.get(), IGNORE_
EXCEPTION); |
| 59 | 59 |
| 60 m_element1->remove(IGNORE_EXCEPTION_STATE); | 60 m_element1->remove(IGNORE_EXCEPTION); |
| 61 } | 61 } |
| 62 | 62 |
| 63 void MergeIdenticalElementsCommand::doUnapply() | 63 void MergeIdenticalElementsCommand::doUnapply() |
| 64 { | 64 { |
| 65 ASSERT(m_element1); | 65 ASSERT(m_element1); |
| 66 ASSERT(m_element2); | 66 ASSERT(m_element2); |
| 67 | 67 |
| 68 RefPtr<Node> atChild = m_atChild.release(); | 68 RefPtr<Node> atChild = m_atChild.release(); |
| 69 | 69 |
| 70 ContainerNode* parent = m_element2->parentNode(); | 70 ContainerNode* parent = m_element2->parentNode(); |
| (...skipping 17 matching lines...) Expand all 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 |