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

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

Issue 2574793002: [Editing] Store |CommandSource| in |CompositeEditCommand| (Closed)
Patch Set: Created 4 years 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 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2005 Apple Computer, 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 row->document().updateStyleAndLayoutIgnorePendingStylesheets(); 59 row->document().updateStyleAndLayoutIgnorePendingStylesheets();
60 for (Node* child = row->firstChild(); child; child = child->nextSibling()) { 60 for (Node* child = row->firstChild(); child; child = child->nextSibling()) {
61 if (isTableCell(child) && !isTableCellEmpty(child)) 61 if (isTableCell(child) && !isTableCellEmpty(child))
62 return false; 62 return false;
63 } 63 }
64 return true; 64 return true;
65 } 65 }
66 66
67 DeleteSelectionCommand::DeleteSelectionCommand( 67 DeleteSelectionCommand::DeleteSelectionCommand(
68 Document& document, 68 Document& document,
69 CommandSource source,
69 bool smartDelete, 70 bool smartDelete,
70 bool mergeBlocksAfterDelete, 71 bool mergeBlocksAfterDelete,
71 bool expandForSpecialElements, 72 bool expandForSpecialElements,
72 bool sanitizeMarkup, 73 bool sanitizeMarkup,
73 InputEvent::InputType inputType, 74 InputEvent::InputType inputType,
74 const Position& referenceMovePosition) 75 const Position& referenceMovePosition)
75 : CompositeEditCommand(document), 76 : CompositeEditCommand(document, source),
76 m_hasSelectionToDelete(false), 77 m_hasSelectionToDelete(false),
77 m_smartDelete(smartDelete), 78 m_smartDelete(smartDelete),
78 m_mergeBlocksAfterDelete(mergeBlocksAfterDelete), 79 m_mergeBlocksAfterDelete(mergeBlocksAfterDelete),
79 m_needPlaceholder(false), 80 m_needPlaceholder(false),
80 m_expandForSpecialElements(expandForSpecialElements), 81 m_expandForSpecialElements(expandForSpecialElements),
81 m_pruneStartBlockIfNecessary(false), 82 m_pruneStartBlockIfNecessary(false),
82 m_startsAtEmptyLine(false), 83 m_startsAtEmptyLine(false),
83 m_sanitizeMarkup(sanitizeMarkup), 84 m_sanitizeMarkup(sanitizeMarkup),
84 m_inputType(inputType), 85 m_inputType(inputType),
85 m_referenceMovePosition(referenceMovePosition), 86 m_referenceMovePosition(referenceMovePosition),
86 m_startBlock(nullptr), 87 m_startBlock(nullptr),
87 m_endBlock(nullptr), 88 m_endBlock(nullptr),
88 m_typingStyle(nullptr), 89 m_typingStyle(nullptr),
89 m_deleteIntoBlockquoteStyle(nullptr) {} 90 m_deleteIntoBlockquoteStyle(nullptr) {}
90 91
91 DeleteSelectionCommand::DeleteSelectionCommand( 92 DeleteSelectionCommand::DeleteSelectionCommand(
93 CommandSource source,
92 const VisibleSelection& selection, 94 const VisibleSelection& selection,
93 bool smartDelete, 95 bool smartDelete,
94 bool mergeBlocksAfterDelete, 96 bool mergeBlocksAfterDelete,
95 bool expandForSpecialElements, 97 bool expandForSpecialElements,
96 bool sanitizeMarkup, 98 bool sanitizeMarkup,
97 InputEvent::InputType inputType) 99 InputEvent::InputType inputType)
98 : CompositeEditCommand(*selection.start().document()), 100 : CompositeEditCommand(*selection.start().document(), source),
99 m_hasSelectionToDelete(true), 101 m_hasSelectionToDelete(true),
100 m_smartDelete(smartDelete), 102 m_smartDelete(smartDelete),
101 m_mergeBlocksAfterDelete(mergeBlocksAfterDelete), 103 m_mergeBlocksAfterDelete(mergeBlocksAfterDelete),
102 m_needPlaceholder(false), 104 m_needPlaceholder(false),
103 m_expandForSpecialElements(expandForSpecialElements), 105 m_expandForSpecialElements(expandForSpecialElements),
104 m_pruneStartBlockIfNecessary(false), 106 m_pruneStartBlockIfNecessary(false),
105 m_startsAtEmptyLine(false), 107 m_startsAtEmptyLine(false),
106 m_sanitizeMarkup(sanitizeMarkup), 108 m_sanitizeMarkup(sanitizeMarkup),
107 m_inputType(inputType), 109 m_inputType(inputType),
108 m_selectionToDelete(selection), 110 m_selectionToDelete(selection),
(...skipping 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after
1226 visitor->trace(m_deleteIntoBlockquoteStyle); 1228 visitor->trace(m_deleteIntoBlockquoteStyle);
1227 visitor->trace(m_startRoot); 1229 visitor->trace(m_startRoot);
1228 visitor->trace(m_endRoot); 1230 visitor->trace(m_endRoot);
1229 visitor->trace(m_startTableRow); 1231 visitor->trace(m_startTableRow);
1230 visitor->trace(m_endTableRow); 1232 visitor->trace(m_endTableRow);
1231 visitor->trace(m_temporaryPlaceholder); 1233 visitor->trace(m_temporaryPlaceholder);
1232 CompositeEditCommand::trace(visitor); 1234 CompositeEditCommand::trace(visitor);
1233 } 1235 }
1234 1236
1235 } // namespace blink 1237 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698