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

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

Issue 2558643003: [InputEvent] Move 'beforeinput' logic into |CompositeEditCommand::willApplyEditing()| (3/3) (Closed)
Patch Set: xiaocheng's review 3: Rebase and remove updateStyleAndLayoutIgnorePendingStylesheets() Created 3 years, 12 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 26 matching lines...) Expand all
37 EditCommand::EditCommand(Document& document) 37 EditCommand::EditCommand(Document& document)
38 : m_document(&document), m_parent(nullptr) { 38 : m_document(&document), m_parent(nullptr) {
39 DCHECK(m_document); 39 DCHECK(m_document);
40 DCHECK(m_document->frame()); 40 DCHECK(m_document->frame());
41 setStartingSelection(m_document->frame()->selection().selection()); 41 setStartingSelection(m_document->frame()->selection().selection());
42 setEndingVisibleSelection(m_startingSelection); 42 setEndingVisibleSelection(m_startingSelection);
43 } 43 }
44 44
45 EditCommand::~EditCommand() {} 45 EditCommand::~EditCommand() {}
46 46
47 InputEvent::InputType EditCommand::inputType() const {
48 return InputEvent::InputType::None;
49 }
50
51 String EditCommand::textDataForInputEvent() const {
52 return nullAtom;
53 }
54
55 static inline EditCommandComposition* compositionIfPossible( 47 static inline EditCommandComposition* compositionIfPossible(
56 EditCommand* command) { 48 EditCommand* command) {
57 if (!command->isCompositeEditCommand()) 49 if (!command->isCompositeEditCommand())
58 return 0; 50 return 0;
59 return toCompositeEditCommand(command)->composition(); 51 return toCompositeEditCommand(command)->composition();
60 } 52 }
61 53
62 void EditCommand::setStartingSelection(const VisibleSelection& selection) { 54 void EditCommand::setStartingSelection(const VisibleSelection& selection) {
63 for (EditCommand* command = this;; command = command->m_parent) { 55 for (EditCommand* command = this;; command = command->m_parent) {
64 if (EditCommandComposition* composition = compositionIfPossible(command)) { 56 if (EditCommandComposition* composition = compositionIfPossible(command)) {
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 } 118 }
127 119
128 DEFINE_TRACE(EditCommand) { 120 DEFINE_TRACE(EditCommand) {
129 visitor->trace(m_document); 121 visitor->trace(m_document);
130 visitor->trace(m_startingSelection); 122 visitor->trace(m_startingSelection);
131 visitor->trace(m_endingSelection); 123 visitor->trace(m_endingSelection);
132 visitor->trace(m_parent); 124 visitor->trace(m_parent);
133 } 125 }
134 126
135 } // namespace blink 127 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698