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

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

Issue 2374743002: [InputEvent] Support |deleteByDrag|, |insertFromDrop| and fire in sequential order (Closed)
Patch Set: Yosin's review 2 Created 4 years, 2 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 23 matching lines...) Expand all
34 class HTMLTableRowElement; 34 class HTMLTableRowElement;
35 35
36 class DeleteSelectionCommand final : public CompositeEditCommand { 36 class DeleteSelectionCommand final : public CompositeEditCommand {
37 public: 37 public:
38 static DeleteSelectionCommand* create( 38 static DeleteSelectionCommand* create(
39 Document& document, 39 Document& document,
40 bool smartDelete = false, 40 bool smartDelete = false,
41 bool mergeBlocksAfterDelete = true, 41 bool mergeBlocksAfterDelete = true,
42 bool expandForSpecialElements = false, 42 bool expandForSpecialElements = false,
43 bool sanitizeMarkup = true, 43 bool sanitizeMarkup = true,
44 InputEvent::InputType inputType = InputEvent::InputType::None) { 44 InputEvent::InputType inputType = InputEvent::InputType::None,
45 const Position& referenceMovePosition = Position()) {
45 return new DeleteSelectionCommand( 46 return new DeleteSelectionCommand(
46 document, smartDelete, mergeBlocksAfterDelete, expandForSpecialElements, 47 document, smartDelete, mergeBlocksAfterDelete, expandForSpecialElements,
47 sanitizeMarkup, inputType); 48 sanitizeMarkup, inputType, referenceMovePosition);
48 } 49 }
49 static DeleteSelectionCommand* create( 50 static DeleteSelectionCommand* create(
50 const VisibleSelection& selection, 51 const VisibleSelection& selection,
51 bool smartDelete = false, 52 bool smartDelete = false,
52 bool mergeBlocksAfterDelete = true, 53 bool mergeBlocksAfterDelete = true,
53 bool expandForSpecialElements = false, 54 bool expandForSpecialElements = false,
54 bool sanitizeMarkup = true, 55 bool sanitizeMarkup = true,
55 InputEvent::InputType inputType = InputEvent::InputType::None) { 56 InputEvent::InputType inputType = InputEvent::InputType::None) {
56 return new DeleteSelectionCommand( 57 return new DeleteSelectionCommand(
57 selection, smartDelete, mergeBlocksAfterDelete, 58 selection, smartDelete, mergeBlocksAfterDelete,
58 expandForSpecialElements, sanitizeMarkup, inputType); 59 expandForSpecialElements, sanitizeMarkup, inputType);
59 } 60 }
60 61
61 DECLARE_VIRTUAL_TRACE(); 62 DECLARE_VIRTUAL_TRACE();
62 63
63 private: 64 private:
64 DeleteSelectionCommand(Document&, 65 DeleteSelectionCommand(Document&,
65 bool smartDelete, 66 bool smartDelete,
66 bool mergeBlocksAfterDelete, 67 bool mergeBlocksAfterDelete,
67 bool expandForSpecialElements, 68 bool expandForSpecialElements,
68 bool santizeMarkup, 69 bool santizeMarkup,
69 InputEvent::InputType); 70 InputEvent::InputType,
71 const Position& referenceMovePosition);
70 DeleteSelectionCommand(const VisibleSelection&, 72 DeleteSelectionCommand(const VisibleSelection&,
71 bool smartDelete, 73 bool smartDelete,
72 bool mergeBlocksAfterDelete, 74 bool mergeBlocksAfterDelete,
73 bool expandForSpecialElements, 75 bool expandForSpecialElements,
74 bool sanitizeMarkup, 76 bool sanitizeMarkup,
75 InputEvent::InputType); 77 InputEvent::InputType);
76 78
77 void doApply(EditingState*) override; 79 void doApply(EditingState*) override;
78 InputEvent::InputType inputType() const override; 80 InputEvent::InputType inputType() const override;
79 81
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 113
112 // This data is transient and should be cleared at the end of the doApply func tion. 114 // This data is transient and should be cleared at the end of the doApply func tion.
113 VisibleSelection m_selectionToDelete; 115 VisibleSelection m_selectionToDelete;
114 Position m_upstreamStart; 116 Position m_upstreamStart;
115 Position m_downstreamStart; 117 Position m_downstreamStart;
116 Position m_upstreamEnd; 118 Position m_upstreamEnd;
117 Position m_downstreamEnd; 119 Position m_downstreamEnd;
118 Position m_endingPosition; 120 Position m_endingPosition;
119 Position m_leadingWhitespace; 121 Position m_leadingWhitespace;
120 Position m_trailingWhitespace; 122 Position m_trailingWhitespace;
123 Position m_referenceMovePosition;
121 Member<Node> m_startBlock; 124 Member<Node> m_startBlock;
122 Member<Node> m_endBlock; 125 Member<Node> m_endBlock;
123 Member<EditingStyle> m_typingStyle; 126 Member<EditingStyle> m_typingStyle;
124 Member<EditingStyle> m_deleteIntoBlockquoteStyle; 127 Member<EditingStyle> m_deleteIntoBlockquoteStyle;
125 Member<Element> m_startRoot; 128 Member<Element> m_startRoot;
126 Member<Element> m_endRoot; 129 Member<Element> m_endRoot;
127 Member<HTMLTableRowElement> m_startTableRow; 130 Member<HTMLTableRowElement> m_startTableRow;
128 Member<HTMLTableRowElement> m_endTableRow; 131 Member<HTMLTableRowElement> m_endTableRow;
129 Member<Node> m_temporaryPlaceholder; 132 Member<Node> m_temporaryPlaceholder;
130 }; 133 };
131 134
132 } // namespace blink 135 } // namespace blink
133 136
134 #endif // DeleteSelectionCommand_h 137 #endif // DeleteSelectionCommand_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698