blob: 76b3022af60c45fbb168608f8257ca655cd37e83 [file] [log] [blame]
mjs84e724c2005-05-24 07:21:47 +00001/*
darin@apple.com48ac3c42008-06-14 08:46:51 +00002 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved.
mjs84e724c2005-05-24 07:21:47 +00003 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 *
mjs@apple.com92047332014-03-15 04:08:27 +000013 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
mjs84e724c2005-05-24 07:21:47 +000014 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
mjs@apple.com92047332014-03-15 04:08:27 +000016 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
mjs84e724c2005-05-24 07:21:47 +000017 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
eseidel8eddecf2007-01-16 00:49:43 +000026#ifndef SplitElementCommand_h
27#define SplitElementCommand_h
mjs84e724c2005-05-24 07:21:47 +000028
darina68e0432006-02-14 21:40:54 +000029#include "EditCommand.h"
mjs84e724c2005-05-24 07:21:47 +000030
darinb9481ed2006-03-20 02:57:59 +000031namespace WebCore {
mjs84e724c2005-05-24 07:21:47 +000032
darin@apple.com48ac3c42008-06-14 08:46:51 +000033class SplitElementCommand : public SimpleEditCommand {
mjs84e724c2005-05-24 07:21:47 +000034public:
akling@apple.comad2beb52014-12-25 07:50:20 +000035 static Ref<SplitElementCommand> create(PassRefPtr<Element> element, PassRefPtr<Node> splitPointChild)
darin@apple.com48ac3c42008-06-14 08:46:51 +000036 {
akling@apple.comad2beb52014-12-25 07:50:20 +000037 return adoptRef(*new SplitElementCommand(element, splitPointChild));
darin@apple.com48ac3c42008-06-14 08:46:51 +000038 }
39
40private:
41 SplitElementCommand(PassRefPtr<Element>, PassRefPtr<Node> splitPointChild);
darind7d82ce2006-01-13 10:07:39 +000042
commit-queue@webkit.org2dfe6cb2014-01-16 19:42:50 +000043 virtual void doApply() override;
44 virtual void doUnapply() override;
45 virtual void doReapply() override;
adele@apple.comc89463a2009-10-29 23:37:17 +000046 void executeApply();
mjs84e724c2005-05-24 07:21:47 +000047
rniwa@webkit.org3045bc32011-12-10 21:35:06 +000048#ifndef NDEBUG
commit-queue@webkit.org2dfe6cb2014-01-16 19:42:50 +000049 virtual void getNodesInCommand(HashSet<Node*>&) override;
rniwa@webkit.org3045bc32011-12-10 21:35:06 +000050#endif
51
darinf4b05b22006-07-10 05:20:17 +000052 RefPtr<Element> m_element1;
53 RefPtr<Element> m_element2;
54 RefPtr<Node> m_atChild;
mjs84e724c2005-05-24 07:21:47 +000055};
56
darinb9481ed2006-03-20 02:57:59 +000057} // namespace WebCore
mjs84e724c2005-05-24 07:21:47 +000058
eseidel8eddecf2007-01-16 00:49:43 +000059#endif // SplitElementCommand_h