| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 DCHECK_EQ(m_atChild->parentNode(), m_element2); | 43 DCHECK_EQ(m_atChild->parentNode(), m_element2); |
| 44 } | 44 } |
| 45 | 45 |
| 46 void SplitElementCommand::executeApply() { | 46 void SplitElementCommand::executeApply() { |
| 47 if (m_atChild->parentNode() != m_element2) | 47 if (m_atChild->parentNode() != m_element2) |
| 48 return; | 48 return; |
| 49 | 49 |
| 50 HeapVector<Member<Node>> children; | 50 HeapVector<Member<Node>> children; |
| 51 for (Node* node = m_element2->firstChild(); node != m_atChild; | 51 for (Node* node = m_element2->firstChild(); node != m_atChild; |
| 52 node = node->nextSibling()) | 52 node = node->nextSibling()) |
| 53 children.append(node); | 53 children.push_back(node); |
| 54 | 54 |
| 55 DummyExceptionStateForTesting exceptionState; | 55 DummyExceptionStateForTesting exceptionState; |
| 56 | 56 |
| 57 ContainerNode* parent = m_element2->parentNode(); | 57 ContainerNode* parent = m_element2->parentNode(); |
| 58 if (!parent || !hasEditableStyle(*parent)) | 58 if (!parent || !hasEditableStyle(*parent)) |
| 59 return; | 59 return; |
| 60 parent->insertBefore(m_element1.get(), m_element2.get(), exceptionState); | 60 parent->insertBefore(m_element1.get(), m_element2.get(), exceptionState); |
| 61 if (exceptionState.hadException()) | 61 if (exceptionState.hadException()) |
| 62 return; | 62 return; |
| 63 | 63 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 } | 104 } |
| 105 | 105 |
| 106 DEFINE_TRACE(SplitElementCommand) { | 106 DEFINE_TRACE(SplitElementCommand) { |
| 107 visitor->trace(m_element1); | 107 visitor->trace(m_element1); |
| 108 visitor->trace(m_element2); | 108 visitor->trace(m_element2); |
| 109 visitor->trace(m_atChild); | 109 visitor->trace(m_atChild); |
| 110 SimpleEditCommand::trace(visitor); | 110 SimpleEditCommand::trace(visitor); |
| 111 } | 111 } |
| 112 | 112 |
| 113 } // namespace blink | 113 } // namespace blink |
| OLD | NEW |