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

Side by Side Diff: Source/core/editing/CompositeEditCommand.h

Issue 430843002: Use tighter typing in editing: PlainTextRange / ReplaceNodeWithSpanCommand (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/editing/CompositeEditCommand.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 19 matching lines...) Expand all
30 #include "core/editing/EditCommand.h" 30 #include "core/editing/EditCommand.h"
31 #include "core/editing/UndoStep.h" 31 #include "core/editing/UndoStep.h"
32 #include "wtf/Vector.h" 32 #include "wtf/Vector.h"
33 33
34 namespace blink { 34 namespace blink {
35 35
36 class EditingStyle; 36 class EditingStyle;
37 class Element; 37 class Element;
38 class HTMLBRElement; 38 class HTMLBRElement;
39 class HTMLElement; 39 class HTMLElement;
40 class HTMLSpanElement;
40 class Text; 41 class Text;
41 42
42 class EditCommandComposition FINAL : public UndoStep { 43 class EditCommandComposition FINAL : public UndoStep {
43 public: 44 public:
44 static PassRefPtrWillBeRawPtr<EditCommandComposition> create(Document*, cons t VisibleSelection&, const VisibleSelection&, EditAction); 45 static PassRefPtrWillBeRawPtr<EditCommandComposition> create(Document*, cons t VisibleSelection&, const VisibleSelection&, EditAction);
45 46
46 virtual bool belongsTo(const LocalFrame&) const OVERRIDE; 47 virtual bool belongsTo(const LocalFrame&) const OVERRIDE;
47 virtual void unapply() OVERRIDE; 48 virtual void unapply() OVERRIDE;
48 virtual void reapply() OVERRIDE; 49 virtual void reapply() OVERRIDE;
49 virtual EditAction editingAction() const OVERRIDE { return m_editAction; } 50 virtual EditAction editingAction() const OVERRIDE { return m_editAction; }
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 void rebalanceWhitespaceAt(const Position&); 116 void rebalanceWhitespaceAt(const Position&);
116 void rebalanceWhitespaceOnTextSubstring(PassRefPtrWillBeRawPtr<Text>, int st artOffset, int endOffset); 117 void rebalanceWhitespaceOnTextSubstring(PassRefPtrWillBeRawPtr<Text>, int st artOffset, int endOffset);
117 void prepareWhitespaceAtPositionForSplit(Position&); 118 void prepareWhitespaceAtPositionForSplit(Position&);
118 void replaceCollapsibleWhitespaceWithNonBreakingSpaceIfNeeded(const VisibleP osition&); 119 void replaceCollapsibleWhitespaceWithNonBreakingSpaceIfNeeded(const VisibleP osition&);
119 bool canRebalance(const Position&) const; 120 bool canRebalance(const Position&) const;
120 bool shouldRebalanceLeadingWhitespaceFor(const String&) const; 121 bool shouldRebalanceLeadingWhitespaceFor(const String&) const;
121 void removeCSSProperty(PassRefPtrWillBeRawPtr<Element>, CSSPropertyID); 122 void removeCSSProperty(PassRefPtrWillBeRawPtr<Element>, CSSPropertyID);
122 void removeNodeAttribute(PassRefPtrWillBeRawPtr<Element>, const QualifiedNam e& attribute); 123 void removeNodeAttribute(PassRefPtrWillBeRawPtr<Element>, const QualifiedNam e& attribute);
123 void removeChildrenInRange(PassRefPtrWillBeRawPtr<Node>, unsigned from, unsi gned to); 124 void removeChildrenInRange(PassRefPtrWillBeRawPtr<Node>, unsigned from, unsi gned to);
124 virtual void removeNode(PassRefPtrWillBeRawPtr<Node>, ShouldAssumeContentIsA lwaysEditable = DoNotAssumeContentIsAlwaysEditable); 125 virtual void removeNode(PassRefPtrWillBeRawPtr<Node>, ShouldAssumeContentIsA lwaysEditable = DoNotAssumeContentIsAlwaysEditable);
125 HTMLElement* replaceElementWithSpanPreservingChildrenAndAttributes(PassRefPt rWillBeRawPtr<HTMLElement>); 126 HTMLSpanElement* replaceElementWithSpanPreservingChildrenAndAttributes(PassR efPtrWillBeRawPtr<HTMLElement>);
126 void removeNodePreservingChildren(PassRefPtrWillBeRawPtr<Node>, ShouldAssume ContentIsAlwaysEditable = DoNotAssumeContentIsAlwaysEditable); 127 void removeNodePreservingChildren(PassRefPtrWillBeRawPtr<Node>, ShouldAssume ContentIsAlwaysEditable = DoNotAssumeContentIsAlwaysEditable);
127 void removeNodeAndPruneAncestors(PassRefPtrWillBeRawPtr<Node>, Node* exclude Node = 0); 128 void removeNodeAndPruneAncestors(PassRefPtrWillBeRawPtr<Node>, Node* exclude Node = 0);
128 void moveRemainingSiblingsToNewParent(Node*, Node* pastLastNodeToMove, PassR efPtrWillBeRawPtr<Element> prpNewParent); 129 void moveRemainingSiblingsToNewParent(Node*, Node* pastLastNodeToMove, PassR efPtrWillBeRawPtr<Element> prpNewParent);
129 void updatePositionForNodeRemovalPreservingChildren(Position&, Node&); 130 void updatePositionForNodeRemovalPreservingChildren(Position&, Node&);
130 void prune(PassRefPtrWillBeRawPtr<Node>, Node* excludeNode = 0); 131 void prune(PassRefPtrWillBeRawPtr<Node>, Node* excludeNode = 0);
131 void replaceTextInNode(PassRefPtrWillBeRawPtr<Text>, unsigned offset, unsign ed count, const String& replacementText); 132 void replaceTextInNode(PassRefPtrWillBeRawPtr<Text>, unsigned offset, unsign ed count, const String& replacementText);
132 Position replaceSelectedTextInNode(const String&); 133 Position replaceSelectedTextInNode(const String&);
133 void replaceTextInNodePreservingMarkers(PassRefPtrWillBeRawPtr<Text>, unsign ed offset, unsigned count, const String& replacementText); 134 void replaceTextInNodePreservingMarkers(PassRefPtrWillBeRawPtr<Text>, unsign ed offset, unsigned count, const String& replacementText);
134 Position positionOutsideTabSpan(const Position&); 135 Position positionOutsideTabSpan(const Position&);
135 void setNodeAttribute(PassRefPtrWillBeRawPtr<Element>, const QualifiedName& attribute, const AtomicString& value); 136 void setNodeAttribute(PassRefPtrWillBeRawPtr<Element>, const QualifiedName& attribute, const AtomicString& value);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 virtual bool isCompositeEditCommand() const OVERRIDE FINAL { return true; } 174 virtual bool isCompositeEditCommand() const OVERRIDE FINAL { return true; }
174 175
175 RefPtrWillBeMember<EditCommandComposition> m_composition; 176 RefPtrWillBeMember<EditCommandComposition> m_composition;
176 }; 177 };
177 178
178 DEFINE_TYPE_CASTS(CompositeEditCommand, EditCommand, command, command->isComposi teEditCommand(), command.isCompositeEditCommand()); 179 DEFINE_TYPE_CASTS(CompositeEditCommand, EditCommand, command, command->isComposi teEditCommand(), command.isCompositeEditCommand());
179 180
180 } // namespace blink 181 } // namespace blink
181 182
182 #endif // CompositeEditCommand_h 183 #endif // CompositeEditCommand_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/editing/CompositeEditCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698