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

Side by Side Diff: third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.h

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, 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 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 10 matching lines...) Expand all
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 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. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #ifndef CompositeEditCommand_h 26 #ifndef CompositeEditCommand_h
27 #define CompositeEditCommand_h 27 #define CompositeEditCommand_h
28 28
29 #include "core/CSSPropertyNames.h" 29 #include "core/CSSPropertyNames.h"
30 #include "core/editing/commands/EditCommand.h" 30 #include "core/editing/commands/EditCommand.h"
31 #include "core/editing/commands/EditingState.h"
31 #include "core/editing/commands/UndoStep.h" 32 #include "core/editing/commands/UndoStep.h"
32 #include "wtf/Vector.h" 33 #include "wtf/Vector.h"
33 34
34 namespace blink { 35 namespace blink {
35 36
36 class EditingStyle; 37 class EditingStyle;
37 class Element; 38 class Element;
38 class HTMLBRElement; 39 class HTMLBRElement;
39 class HTMLElement; 40 class HTMLElement;
40 class HTMLSpanElement; 41 class HTMLSpanElement;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 89
89 DECLARE_VIRTUAL_TRACE(); 90 DECLARE_VIRTUAL_TRACE();
90 91
91 protected: 92 protected:
92 explicit CompositeEditCommand(Document&); 93 explicit CompositeEditCommand(Document&);
93 94
94 // 95 //
95 // sugary-sweet convenience functions to help create and apply edit commands in composite commands 96 // sugary-sweet convenience functions to help create and apply edit commands in composite commands
96 // 97 //
97 void appendNode(PassRefPtrWillBeRawPtr<Node>, PassRefPtrWillBeRawPtr<Contain erNode> parent); 98 void appendNode(PassRefPtrWillBeRawPtr<Node>, PassRefPtrWillBeRawPtr<Contain erNode> parent);
98 void applyCommandToComposite(PassRefPtrWillBeRawPtr<EditCommand>); 99 // TODO(tkent): EditingState argument should not be optional.
99 void applyCommandToComposite(PassRefPtrWillBeRawPtr<CompositeEditCommand>, c onst VisibleSelection&); 100 void applyCommandToComposite(PassRefPtrWillBeRawPtr<EditCommand>, EditingSta te* = ASSERT_NO_EDITING_ABORT);
101 void applyCommandToComposite(PassRefPtrWillBeRawPtr<CompositeEditCommand>, c onst VisibleSelection&, EditingState* = ASSERT_NO_EDITING_ABORT);
100 void applyStyle(const EditingStyle*, EditAction = EditActionChangeAttributes ); 102 void applyStyle(const EditingStyle*, EditAction = EditActionChangeAttributes );
101 void applyStyle(const EditingStyle*, const Position& start, const Position& end, EditAction = EditActionChangeAttributes); 103 void applyStyle(const EditingStyle*, const Position& start, const Position& end, EditAction = EditActionChangeAttributes);
102 void applyStyledElement(PassRefPtrWillBeRawPtr<Element>); 104 void applyStyledElement(PassRefPtrWillBeRawPtr<Element>);
103 void removeStyledElement(PassRefPtrWillBeRawPtr<Element>); 105 void removeStyledElement(PassRefPtrWillBeRawPtr<Element>);
104 void deleteSelection(bool smartDelete = false, bool mergeBlocksAfterDelete = true, bool expandForSpecialElements = true, bool sanitizeMarkup = true); 106 void deleteSelection(bool smartDelete = false, bool mergeBlocksAfterDelete = true, bool expandForSpecialElements = true, bool sanitizeMarkup = true);
105 void deleteSelection(const VisibleSelection&, bool smartDelete = false, bool mergeBlocksAfterDelete = true, bool expandForSpecialElements = true, bool sanit izeMarkup = true); 107 void deleteSelection(const VisibleSelection&, bool smartDelete = false, bool mergeBlocksAfterDelete = true, bool expandForSpecialElements = true, bool sanit izeMarkup = true);
106 virtual void deleteTextFromNode(PassRefPtrWillBeRawPtr<Text>, unsigned offse t, unsigned count); 108 virtual void deleteTextFromNode(PassRefPtrWillBeRawPtr<Text>, unsigned offse t, unsigned count);
107 bool isRemovableBlock(const Node*); 109 bool isRemovableBlock(const Node*);
108 void insertNodeAfter(PassRefPtrWillBeRawPtr<Node>, PassRefPtrWillBeRawPtr<No de> refChild); 110 void insertNodeAfter(PassRefPtrWillBeRawPtr<Node>, PassRefPtrWillBeRawPtr<No de> refChild);
109 void insertNodeAt(PassRefPtrWillBeRawPtr<Node>, const Position&); 111 void insertNodeAt(PassRefPtrWillBeRawPtr<Node>, const Position&);
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 bool isCompositeEditCommand() const final { return true; } 176 bool isCompositeEditCommand() const final { return true; }
175 177
176 RefPtrWillBeMember<EditCommandComposition> m_composition; 178 RefPtrWillBeMember<EditCommandComposition> m_composition;
177 }; 179 };
178 180
179 DEFINE_TYPE_CASTS(CompositeEditCommand, EditCommand, command, command->isComposi teEditCommand(), command.isCompositeEditCommand()); 181 DEFINE_TYPE_CASTS(CompositeEditCommand, EditCommand, command, command->isComposi teEditCommand(), command.isCompositeEditCommand());
180 182
181 } // namespace blink 183 } // namespace blink
182 184
183 #endif // CompositeEditCommand_h 185 #endif // CompositeEditCommand_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698