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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 if (!m_element1 || !hasEditableStyle(*m_element1) || | 78 if (!m_element1 || !hasEditableStyle(*m_element1) || |
79 !hasEditableStyle(*m_element2)) | 79 !hasEditableStyle(*m_element2)) |
80 return; | 80 return; |
81 | 81 |
82 NodeVector children; | 82 NodeVector children; |
83 getChildNodes(*m_element1, children); | 83 getChildNodes(*m_element1, children); |
84 | 84 |
85 Node* refChild = m_element2->firstChild(); | 85 Node* refChild = m_element2->firstChild(); |
86 | 86 |
87 for (const auto& child : children) | 87 for (const auto& child : children) |
88 m_element2->insertBefore(child, refChild, IGNORE_EXCEPTION); | 88 m_element2->insertBefore(child, refChild, IGNORE_EXCEPTION_FOR_TESTING); |
89 | 89 |
90 // Recover the id attribute of the original element. | 90 // Recover the id attribute of the original element. |
91 const AtomicString& id = m_element1->getAttribute(HTMLNames::idAttr); | 91 const AtomicString& id = m_element1->getAttribute(HTMLNames::idAttr); |
92 if (!id.isNull()) | 92 if (!id.isNull()) |
93 m_element2->setAttribute(HTMLNames::idAttr, id); | 93 m_element2->setAttribute(HTMLNames::idAttr, id); |
94 | 94 |
95 m_element1->remove(IGNORE_EXCEPTION); | 95 m_element1->remove(IGNORE_EXCEPTION_FOR_TESTING); |
96 } | 96 } |
97 | 97 |
98 void SplitElementCommand::doReapply() { | 98 void SplitElementCommand::doReapply() { |
99 if (!m_element1) | 99 if (!m_element1) |
100 return; | 100 return; |
101 | 101 |
102 executeApply(); | 102 executeApply(); |
103 } | 103 } |
104 | 104 |
105 DEFINE_TRACE(SplitElementCommand) { | 105 DEFINE_TRACE(SplitElementCommand) { |
106 visitor->trace(m_element1); | 106 visitor->trace(m_element1); |
107 visitor->trace(m_element2); | 107 visitor->trace(m_element2); |
108 visitor->trace(m_atChild); | 108 visitor->trace(m_atChild); |
109 SimpleEditCommand::trace(visitor); | 109 SimpleEditCommand::trace(visitor); |
110 } | 110 } |
111 | 111 |
112 } // namespace blink | 112 } // namespace blink |
OLD | NEW |