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

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

Issue 2617753002: [InputEvent] Move attributes from |EditCommand| to |CompositeEditCommand| (2/11) (Closed)
Patch Set: Created 3 years, 11 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, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2007, 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 #include "core/editing/commands/MergeIdenticalElementsCommand.h" 49 #include "core/editing/commands/MergeIdenticalElementsCommand.h"
50 #include "core/editing/commands/RemoveCSSPropertyCommand.h" 50 #include "core/editing/commands/RemoveCSSPropertyCommand.h"
51 #include "core/editing/commands/RemoveNodeCommand.h" 51 #include "core/editing/commands/RemoveNodeCommand.h"
52 #include "core/editing/commands/RemoveNodePreservingChildrenCommand.h" 52 #include "core/editing/commands/RemoveNodePreservingChildrenCommand.h"
53 #include "core/editing/commands/ReplaceNodeWithSpanCommand.h" 53 #include "core/editing/commands/ReplaceNodeWithSpanCommand.h"
54 #include "core/editing/commands/ReplaceSelectionCommand.h" 54 #include "core/editing/commands/ReplaceSelectionCommand.h"
55 #include "core/editing/commands/SetNodeAttributeCommand.h" 55 #include "core/editing/commands/SetNodeAttributeCommand.h"
56 #include "core/editing/commands/SplitElementCommand.h" 56 #include "core/editing/commands/SplitElementCommand.h"
57 #include "core/editing/commands/SplitTextNodeCommand.h" 57 #include "core/editing/commands/SplitTextNodeCommand.h"
58 #include "core/editing/commands/SplitTextNodeContainingElementCommand.h" 58 #include "core/editing/commands/SplitTextNodeContainingElementCommand.h"
59 #include "core/editing/commands/TypingCommand.h"
59 #include "core/editing/commands/WrapContentsInDummySpanCommand.h" 60 #include "core/editing/commands/WrapContentsInDummySpanCommand.h"
60 #include "core/editing/iterators/TextIterator.h" 61 #include "core/editing/iterators/TextIterator.h"
61 #include "core/editing/markers/DocumentMarkerController.h" 62 #include "core/editing/markers/DocumentMarkerController.h"
62 #include "core/editing/serializers/Serialization.h" 63 #include "core/editing/serializers/Serialization.h"
63 #include "core/editing/spellcheck/SpellChecker.h" 64 #include "core/editing/spellcheck/SpellChecker.h"
64 #include "core/events/ScopedEventQueue.h" 65 #include "core/events/ScopedEventQueue.h"
65 #include "core/frame/LocalFrame.h" 66 #include "core/frame/LocalFrame.h"
66 #include "core/html/HTMLBRElement.h" 67 #include "core/html/HTMLBRElement.h"
67 #include "core/html/HTMLDivElement.h" 68 #include "core/html/HTMLDivElement.h"
68 #include "core/html/HTMLElement.h" 69 #include "core/html/HTMLElement.h"
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 } 263 }
263 return command->m_composition.get(); 264 return command->m_composition.get();
264 } 265 }
265 266
266 bool CompositeEditCommand::willApplyEditing(EditCommandSource, 267 bool CompositeEditCommand::willApplyEditing(EditCommandSource,
267 BeforeInputTiming) { 268 BeforeInputTiming) {
268 // TODO(chongz): Move all the 'beforeinput' dispatching logic here. 269 // TODO(chongz): Move all the 'beforeinput' dispatching logic here.
269 return true; 270 return true;
270 } 271 }
271 272
273 InputEvent::InputType CompositeEditCommand::inputType() const {
274 return InputEvent::InputType::None;
275 }
276
277 String CompositeEditCommand::textDataForInputEvent() const {
278 return nullAtom;
279 }
280
281 DataTransfer* CompositeEditCommand::dataTransferForInputEvent() const {
282 return nullptr;
283 }
284
285 RangeVector* CompositeEditCommand::targetRangesForInputEvent() const {
286 // TODO(chongz): We should return current selection for ContentEditable if no
287 // better choice.
288 // https://crbug.com/652429
289 if (inputType() == InputEvent::InputType::InsertReplacementText &&
290 document().frame()->editor().canEditRichly())
291 return new RangeVector(1, document().frame()->selection().firstRange());
292 return nullptr;
293 }
294
272 bool CompositeEditCommand::preservesTypingStyle() const { 295 bool CompositeEditCommand::preservesTypingStyle() const {
273 return false; 296 return false;
274 } 297 }
275 298
276 bool CompositeEditCommand::isTypingCommand() const { 299 bool CompositeEditCommand::isTypingCommand() const {
277 return false; 300 return false;
278 } 301 }
279 302
280 bool CompositeEditCommand::isCommandGroupWrapper() const { 303 bool CompositeEditCommand::isCommandGroupWrapper() const {
281 return false; 304 return false;
(...skipping 1767 matching lines...) Expand 10 before | Expand all | Expand 10 after
2049 return node; 2072 return node;
2050 } 2073 }
2051 2074
2052 DEFINE_TRACE(CompositeEditCommand) { 2075 DEFINE_TRACE(CompositeEditCommand) {
2053 visitor->trace(m_commands); 2076 visitor->trace(m_commands);
2054 visitor->trace(m_composition); 2077 visitor->trace(m_composition);
2055 EditCommand::trace(visitor); 2078 EditCommand::trace(visitor);
2056 } 2079 }
2057 2080
2058 } // namespace blink 2081 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698