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