OLD | NEW |
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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 UndoStep::trace(visitor); | 180 UndoStep::trace(visitor); |
181 } | 181 } |
182 | 182 |
183 CompositeEditCommand::CompositeEditCommand(Document& document) | 183 CompositeEditCommand::CompositeEditCommand(Document& document) |
184 : EditCommand(document) {} | 184 : EditCommand(document) {} |
185 | 185 |
186 CompositeEditCommand::~CompositeEditCommand() { | 186 CompositeEditCommand::~CompositeEditCommand() { |
187 DCHECK(isTopLevelCommand() || !m_composition); | 187 DCHECK(isTopLevelCommand() || !m_composition); |
188 } | 188 } |
189 | 189 |
190 // TODO(chongz): Fire 'beforeinput' based on |EditCommandSource|. | 190 bool CompositeEditCommand::apply() { |
191 bool CompositeEditCommand::apply(EditCommandSource) { | |
192 DCHECK(!isCommandGroupWrapper()); | 191 DCHECK(!isCommandGroupWrapper()); |
193 if (!endingSelection().isContentRichlyEditable()) { | 192 if (!endingSelection().isContentRichlyEditable()) { |
194 switch (inputType()) { | 193 switch (inputType()) { |
195 case InputEvent::InputType::InsertText: | 194 case InputEvent::InputType::InsertText: |
196 case InputEvent::InputType::InsertLineBreak: | 195 case InputEvent::InputType::InsertLineBreak: |
197 case InputEvent::InputType::InsertParagraph: | 196 case InputEvent::InputType::InsertParagraph: |
198 case InputEvent::InputType::InsertFromPaste: | 197 case InputEvent::InputType::InsertFromPaste: |
199 case InputEvent::InputType::InsertFromDrop: | 198 case InputEvent::InputType::InsertFromDrop: |
200 case InputEvent::InputType::InsertReplacementText: | 199 case InputEvent::InputType::InsertReplacementText: |
201 case InputEvent::InputType::DeleteComposedCharacterForward: | 200 case InputEvent::InputType::DeleteComposedCharacterForward: |
(...skipping 1829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2031 return node; | 2030 return node; |
2032 } | 2031 } |
2033 | 2032 |
2034 DEFINE_TRACE(CompositeEditCommand) { | 2033 DEFINE_TRACE(CompositeEditCommand) { |
2035 visitor->trace(m_commands); | 2034 visitor->trace(m_commands); |
2036 visitor->trace(m_composition); | 2035 visitor->trace(m_composition); |
2037 EditCommand::trace(visitor); | 2036 EditCommand::trace(visitor); |
2038 } | 2037 } |
2039 | 2038 |
2040 } // namespace blink | 2039 } // namespace blink |
OLD | NEW |