| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 TrackExceptionState exceptionState; | 55 TrackExceptionState 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 |
| 64 // Delete id attribute from the second element because the same id cannot be u
sed for more than one element | 64 // Delete id attribute from the second element because the same id cannot be |
| 65 // used for more than one element |
| 65 m_element2->removeAttribute(HTMLNames::idAttr); | 66 m_element2->removeAttribute(HTMLNames::idAttr); |
| 66 | 67 |
| 67 for (const auto& child : children) | 68 for (const auto& child : children) |
| 68 m_element1->appendChild(child, exceptionState); | 69 m_element1->appendChild(child, exceptionState); |
| 69 } | 70 } |
| 70 | 71 |
| 71 void SplitElementCommand::doApply(EditingState*) { | 72 void SplitElementCommand::doApply(EditingState*) { |
| 72 m_element1 = m_element2->cloneElementWithoutChildren(); | 73 m_element1 = m_element2->cloneElementWithoutChildren(); |
| 73 | 74 |
| 74 executeApply(); | 75 executeApply(); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 103 } | 104 } |
| 104 | 105 |
| 105 DEFINE_TRACE(SplitElementCommand) { | 106 DEFINE_TRACE(SplitElementCommand) { |
| 106 visitor->trace(m_element1); | 107 visitor->trace(m_element1); |
| 107 visitor->trace(m_element2); | 108 visitor->trace(m_element2); |
| 108 visitor->trace(m_atChild); | 109 visitor->trace(m_atChild); |
| 109 SimpleEditCommand::trace(visitor); | 110 SimpleEditCommand::trace(visitor); |
| 110 } | 111 } |
| 111 | 112 |
| 112 } // namespace blink | 113 } // namespace blink |
| OLD | NEW |