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

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

Issue 1695153002: Editing: Make the |EditingState*| argument of CompositeEditCommand::removeNode mandatory. (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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 void deleteSelection(EditingState* = ASSERT_NO_EDITING_ABORT, bool smartDele te = false, bool mergeBlocksAfterDelete = true, bool expandForSpecialElements = true, bool sanitizeMarkup = true); 107 void deleteSelection(EditingState* = ASSERT_NO_EDITING_ABORT, bool smartDele te = false, bool mergeBlocksAfterDelete = true, bool expandForSpecialElements = true, bool sanitizeMarkup = true);
108 void deleteSelection(const VisibleSelection&, EditingState*, bool smartDelet e = false, bool mergeBlocksAfterDelete = true, bool expandForSpecialElements = t rue, bool sanitizeMarkup = true); 108 void deleteSelection(const VisibleSelection&, EditingState*, bool smartDelet e = false, bool mergeBlocksAfterDelete = true, bool expandForSpecialElements = t rue, bool sanitizeMarkup = true);
109 virtual void deleteTextFromNode(PassRefPtrWillBeRawPtr<Text>, unsigned offse t, unsigned count); 109 virtual void deleteTextFromNode(PassRefPtrWillBeRawPtr<Text>, unsigned offse t, unsigned count);
110 bool isRemovableBlock(const Node*); 110 bool isRemovableBlock(const Node*);
111 void insertNodeAfter(PassRefPtrWillBeRawPtr<Node>, PassRefPtrWillBeRawPtr<No de> refChild); 111 void insertNodeAfter(PassRefPtrWillBeRawPtr<Node>, PassRefPtrWillBeRawPtr<No de> refChild);
112 void insertNodeAt(PassRefPtrWillBeRawPtr<Node>, const Position&, EditingStat e* = ASSERT_NO_EDITING_ABORT); 112 void insertNodeAt(PassRefPtrWillBeRawPtr<Node>, const Position&, EditingStat e* = ASSERT_NO_EDITING_ABORT);
113 void insertNodeAtTabSpanPosition(PassRefPtrWillBeRawPtr<Node>, const Positio n&); 113 void insertNodeAtTabSpanPosition(PassRefPtrWillBeRawPtr<Node>, const Positio n&);
114 void insertNodeBefore(PassRefPtrWillBeRawPtr<Node>, PassRefPtrWillBeRawPtr<N ode> refChild, EditingState* = ASSERT_NO_EDITING_ABORT, ShouldAssumeContentIsAlw aysEditable = DoNotAssumeContentIsAlwaysEditable); 114 void insertNodeBefore(PassRefPtrWillBeRawPtr<Node>, PassRefPtrWillBeRawPtr<N ode> refChild, EditingState* = ASSERT_NO_EDITING_ABORT, ShouldAssumeContentIsAlw aysEditable = DoNotAssumeContentIsAlwaysEditable);
115 void insertParagraphSeparator(bool useDefaultParagraphElement = false, bool pasteBlockqutoeIntoUnquotedArea = false); 115 void insertParagraphSeparator(bool useDefaultParagraphElement = false, bool pasteBlockqutoeIntoUnquotedArea = false);
116 void insertTextIntoNode(PassRefPtrWillBeRawPtr<Text>, unsigned offset, const String& text); 116 void insertTextIntoNode(PassRefPtrWillBeRawPtr<Text>, unsigned offset, const String& text);
117 void mergeIdenticalElements(PassRefPtrWillBeRawPtr<Element>, PassRefPtrWillB eRawPtr<Element>); 117 void mergeIdenticalElements(PassRefPtrWillBeRawPtr<Element>, PassRefPtrWillB eRawPtr<Element>, EditingState*);
118 void rebalanceWhitespace(); 118 void rebalanceWhitespace();
119 void rebalanceWhitespaceAt(const Position&); 119 void rebalanceWhitespaceAt(const Position&);
120 void rebalanceWhitespaceOnTextSubstring(PassRefPtrWillBeRawPtr<Text>, int st artOffset, int endOffset); 120 void rebalanceWhitespaceOnTextSubstring(PassRefPtrWillBeRawPtr<Text>, int st artOffset, int endOffset);
121 void prepareWhitespaceAtPositionForSplit(Position&); 121 void prepareWhitespaceAtPositionForSplit(Position&);
122 void replaceCollapsibleWhitespaceWithNonBreakingSpaceIfNeeded(const VisibleP osition&); 122 void replaceCollapsibleWhitespaceWithNonBreakingSpaceIfNeeded(const VisibleP osition&);
123 bool canRebalance(const Position&) const; 123 bool canRebalance(const Position&) const;
124 bool shouldRebalanceLeadingWhitespaceFor(const String&) const; 124 bool shouldRebalanceLeadingWhitespaceFor(const String&) const;
125 void removeCSSProperty(PassRefPtrWillBeRawPtr<Element>, CSSPropertyID); 125 void removeCSSProperty(PassRefPtrWillBeRawPtr<Element>, CSSPropertyID);
126 void removeElementAttribute(PassRefPtrWillBeRawPtr<Element>, const Qualified Name& attribute); 126 void removeElementAttribute(PassRefPtrWillBeRawPtr<Element>, const Qualified Name& attribute);
127 void removeChildrenInRange(PassRefPtrWillBeRawPtr<Node>, unsigned from, unsi gned to); 127 void removeChildrenInRange(PassRefPtrWillBeRawPtr<Node>, unsigned from, unsi gned to, EditingState*);
128 virtual void removeNode(PassRefPtrWillBeRawPtr<Node>, EditingState* = ASSERT _NO_EDITING_ABORT, ShouldAssumeContentIsAlwaysEditable = DoNotAssumeContentIsAlw aysEditable); 128 virtual void removeNode(PassRefPtrWillBeRawPtr<Node>, EditingState*, ShouldA ssumeContentIsAlwaysEditable = DoNotAssumeContentIsAlwaysEditable);
129 HTMLSpanElement* replaceElementWithSpanPreservingChildrenAndAttributes(PassR efPtrWillBeRawPtr<HTMLElement>); 129 HTMLSpanElement* replaceElementWithSpanPreservingChildrenAndAttributes(PassR efPtrWillBeRawPtr<HTMLElement>);
130 void removeNodePreservingChildren(PassRefPtrWillBeRawPtr<Node>, EditingState * = ASSERT_NO_EDITING_ABORT, ShouldAssumeContentIsAlwaysEditable = DoNotAssumeCo ntentIsAlwaysEditable); 130 void removeNodePreservingChildren(PassRefPtrWillBeRawPtr<Node>, EditingState * = ASSERT_NO_EDITING_ABORT, ShouldAssumeContentIsAlwaysEditable = DoNotAssumeCo ntentIsAlwaysEditable);
131 void removeNodeAndPruneAncestors(PassRefPtrWillBeRawPtr<Node>, Node* exclude Node = nullptr); 131 void removeNodeAndPruneAncestors(PassRefPtrWillBeRawPtr<Node>, EditingState* , Node* excludeNode = nullptr);
132 void moveRemainingSiblingsToNewParent(Node*, Node* pastLastNodeToMove, PassR efPtrWillBeRawPtr<Element> prpNewParent); 132 void moveRemainingSiblingsToNewParent(Node*, Node* pastLastNodeToMove, PassR efPtrWillBeRawPtr<Element> prpNewParent, EditingState*);
133 void updatePositionForNodeRemovalPreservingChildren(Position&, Node&); 133 void updatePositionForNodeRemovalPreservingChildren(Position&, Node&);
134 void prune(PassRefPtrWillBeRawPtr<Node>, Node* excludeNode = nullptr); 134 void prune(PassRefPtrWillBeRawPtr<Node>, EditingState*, Node* excludeNode = nullptr);
135 void replaceTextInNode(PassRefPtrWillBeRawPtr<Text>, unsigned offset, unsign ed count, const String& replacementText); 135 void replaceTextInNode(PassRefPtrWillBeRawPtr<Text>, unsigned offset, unsign ed count, const String& replacementText);
136 Position replaceSelectedTextInNode(const String&); 136 Position replaceSelectedTextInNode(const String&);
137 void replaceTextInNodePreservingMarkers(PassRefPtrWillBeRawPtr<Text>, unsign ed offset, unsigned count, const String& replacementText); 137 void replaceTextInNodePreservingMarkers(PassRefPtrWillBeRawPtr<Text>, unsign ed offset, unsigned count, const String& replacementText);
138 Position positionOutsideTabSpan(const Position&); 138 Position positionOutsideTabSpan(const Position&);
139 void setNodeAttribute(PassRefPtrWillBeRawPtr<Element>, const QualifiedName& attribute, const AtomicString& value); 139 void setNodeAttribute(PassRefPtrWillBeRawPtr<Element>, const QualifiedName& attribute, const AtomicString& value);
140 void splitElement(PassRefPtrWillBeRawPtr<Element>, PassRefPtrWillBeRawPtr<No de> atChild); 140 void splitElement(PassRefPtrWillBeRawPtr<Element>, PassRefPtrWillBeRawPtr<No de> atChild);
141 void splitTextNode(PassRefPtrWillBeRawPtr<Text>, unsigned offset); 141 void splitTextNode(PassRefPtrWillBeRawPtr<Text>, unsigned offset);
142 void splitTextNodeContainingElement(PassRefPtrWillBeRawPtr<Text>, unsigned o ffset); 142 void splitTextNodeContainingElement(PassRefPtrWillBeRawPtr<Text>, unsigned o ffset);
143 void wrapContentsInDummySpan(PassRefPtrWillBeRawPtr<Element>); 143 void wrapContentsInDummySpan(PassRefPtrWillBeRawPtr<Element>);
144 144
(...skipping 10 matching lines...) Expand all
155 155
156 PassRefPtrWillBeRawPtr<HTMLElement> moveParagraphContentsToNewBlockIfNecessa ry(const Position&, EditingState*); 156 PassRefPtrWillBeRawPtr<HTMLElement> moveParagraphContentsToNewBlockIfNecessa ry(const Position&, EditingState*);
157 157
158 void pushAnchorElementDown(Element*, EditingState*); 158 void pushAnchorElementDown(Element*, EditingState*);
159 159
160 // FIXME: preserveSelection and preserveStyle should be enums 160 // FIXME: preserveSelection and preserveStyle should be enums
161 void moveParagraph(const VisiblePosition&, const VisiblePosition&, const Vis iblePosition&, EditingState* = ASSERT_NO_EDITING_ABORT, bool preserveSelection = false, bool preserveStyle = true, Node* constrainingAncestor = nullptr); 161 void moveParagraph(const VisiblePosition&, const VisiblePosition&, const Vis iblePosition&, EditingState* = ASSERT_NO_EDITING_ABORT, bool preserveSelection = false, bool preserveStyle = true, Node* constrainingAncestor = nullptr);
162 void moveParagraphs(const VisiblePosition&, const VisiblePosition&, const Vi siblePosition&, EditingState*, bool preserveSelection = false, bool preserveStyl e = true, Node* constrainingAncestor = nullptr); 162 void moveParagraphs(const VisiblePosition&, const VisiblePosition&, const Vi siblePosition&, EditingState*, bool preserveSelection = false, bool preserveStyl e = true, Node* constrainingAncestor = nullptr);
163 void moveParagraphWithClones(const VisiblePosition& startOfParagraphToMove, const VisiblePosition& endOfParagraphToMove, HTMLElement* blockElement, Node* ou terNode, EditingState* = ASSERT_NO_EDITING_ABORT); 163 void moveParagraphWithClones(const VisiblePosition& startOfParagraphToMove, const VisiblePosition& endOfParagraphToMove, HTMLElement* blockElement, Node* ou terNode, EditingState* = ASSERT_NO_EDITING_ABORT);
164 void cloneParagraphUnderNewElement(const Position& start, const Position& en d, Node* outerNode, Element* blockElement, EditingState*); 164 void cloneParagraphUnderNewElement(const Position& start, const Position& en d, Node* outerNode, Element* blockElement, EditingState*);
165 void cleanupAfterDeletion(VisiblePosition destination = VisiblePosition()); 165 void cleanupAfterDeletion(EditingState*, VisiblePosition destination = Visib lePosition());
166 166
167 bool breakOutOfEmptyListItem(); 167 bool breakOutOfEmptyListItem(EditingState*);
168 bool breakOutOfEmptyMailBlockquotedParagraph(); 168 bool breakOutOfEmptyMailBlockquotedParagraph(EditingState*);
169 169
170 Position positionAvoidingSpecialElementBoundary(const Position&, EditingStat e*); 170 Position positionAvoidingSpecialElementBoundary(const Position&, EditingStat e*);
171 171
172 PassRefPtrWillBeRawPtr<Node> splitTreeToNode(Node*, Node*, bool splitAncesto r = false); 172 PassRefPtrWillBeRawPtr<Node> splitTreeToNode(Node*, Node*, bool splitAncesto r = false);
173 173
174 WillBeHeapVector<RefPtrWillBeMember<EditCommand>> m_commands; 174 WillBeHeapVector<RefPtrWillBeMember<EditCommand>> m_commands;
175 175
176 private: 176 private:
177 bool isCompositeEditCommand() const final { return true; } 177 bool isCompositeEditCommand() const final { return true; }
178 178
179 RefPtrWillBeMember<EditCommandComposition> m_composition; 179 RefPtrWillBeMember<EditCommandComposition> m_composition;
180 }; 180 };
181 181
182 DEFINE_TYPE_CASTS(CompositeEditCommand, EditCommand, command, command->isComposi teEditCommand(), command.isCompositeEditCommand()); 182 DEFINE_TYPE_CASTS(CompositeEditCommand, EditCommand, command, command->isComposi teEditCommand(), command.isCompositeEditCommand());
183 183
184 } // namespace blink 184 } // namespace blink
185 185
186 #endif // CompositeEditCommand_h 186 #endif // CompositeEditCommand_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698