Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(522)

Side by Side Diff: third_party/WebKit/Source/core/editing/commands/SplitElementCommand.cpp

Issue 1679253002: Editing: Add EditingState* argument to EditCommand::doApply. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 used for more than one element 64 // Delete id attribute from the second element because the same id cannot be used for more than one element
65 m_element2->removeAttribute(HTMLNames::idAttr); 65 m_element2->removeAttribute(HTMLNames::idAttr);
66 66
67 for (const auto& child : children) 67 for (const auto& child : children)
68 m_element1->appendChild(child, exceptionState); 68 m_element1->appendChild(child, exceptionState);
69 } 69 }
70 70
71 void SplitElementCommand::doApply() 71 void SplitElementCommand::doApply(EditingState*)
72 { 72 {
73 m_element1 = m_element2->cloneElementWithoutChildren(); 73 m_element1 = m_element2->cloneElementWithoutChildren();
74 74
75 executeApply(); 75 executeApply();
76 } 76 }
77 77
78 void SplitElementCommand::doUnapply() 78 void SplitElementCommand::doUnapply()
79 { 79 {
80 if (!m_element1 || !m_element1->hasEditableStyle() || !m_element2->hasEditab leStyle()) 80 if (!m_element1 || !m_element1->hasEditableStyle() || !m_element2->hasEditab leStyle())
81 return; 81 return;
(...skipping 24 matching lines...) Expand all
106 106
107 DEFINE_TRACE(SplitElementCommand) 107 DEFINE_TRACE(SplitElementCommand)
108 { 108 {
109 visitor->trace(m_element1); 109 visitor->trace(m_element1);
110 visitor->trace(m_element2); 110 visitor->trace(m_element2);
111 visitor->trace(m_atChild); 111 visitor->trace(m_atChild);
112 SimpleEditCommand::trace(visitor); 112 SimpleEditCommand::trace(visitor);
113 } 113 }
114 114
115 } // namespace blink 115 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698