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

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

Issue 2393903003: [LayoutTest] Fix flakey test "inputevent-drag-drop.html" (Closed)
Patch Set: Clear composition after merging with command wrapper 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, 2007 Apple, Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2007 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 LayoutObject* layoutObject = position.anchorNode()->layoutObject(); 95 LayoutObject* layoutObject = position.anchorNode()->layoutObject();
96 if (!layoutObject) 96 if (!layoutObject)
97 return false; 97 return false;
98 98
99 return toLayoutText(layoutObject) 99 return toLayoutText(layoutObject)
100 ->isRenderedCharacter(position.offsetInContainerNode()); 100 ->isRenderedCharacter(position.offsetInContainerNode());
101 } 101 }
102 102
103 void EditCommand::setParent(CompositeEditCommand* parent) { 103 void EditCommand::setParent(CompositeEditCommand* parent) {
104 DCHECK((parent && !m_parent) || (!parent && m_parent)); 104 DCHECK((parent && !m_parent) || (!parent && m_parent));
105 // Currently only allow merging |InsertFromDrop| and |DeleteByDrag| with |Drag AndDropCommand| after applied. 105 DCHECK(!parent || !isCompositeEditCommand() ||
106 DCHECK(!parent || parent->isCommandGroupWrapper() ||
chongz 2016/10/05 23:27:55 We don't need this anymore since the composition w
107 !isCompositeEditCommand() ||
108 !toCompositeEditCommand(this)->composition()); 106 !toCompositeEditCommand(this)->composition());
109 m_parent = parent; 107 m_parent = parent;
110 if (parent) { 108 if (parent) {
111 m_startingSelection = parent->m_endingSelection; 109 m_startingSelection = parent->m_endingSelection;
112 m_endingSelection = parent->m_endingSelection; 110 m_endingSelection = parent->m_endingSelection;
113 } 111 }
114 } 112 }
115 113
116 void SimpleEditCommand::doReapply() { 114 void SimpleEditCommand::doReapply() {
117 EditingState editingState; 115 EditingState editingState;
118 doApply(&editingState); 116 doApply(&editingState);
119 } 117 }
120 118
121 DEFINE_TRACE(EditCommand) { 119 DEFINE_TRACE(EditCommand) {
122 visitor->trace(m_document); 120 visitor->trace(m_document);
123 visitor->trace(m_startingSelection); 121 visitor->trace(m_startingSelection);
124 visitor->trace(m_endingSelection); 122 visitor->trace(m_endingSelection);
125 visitor->trace(m_parent); 123 visitor->trace(m_parent);
126 } 124 }
127 125
128 } // namespace blink 126 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698