| 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 } | 144 } |
| 145 | 145 |
| 146 frame->editor().reappliedEditing(this); | 146 frame->editor().reappliedEditing(this); |
| 147 } | 147 } |
| 148 | 148 |
| 149 InputEvent::InputType EditCommandComposition::inputType() const { | 149 InputEvent::InputType EditCommandComposition::inputType() const { |
| 150 return m_inputType; | 150 return m_inputType; |
| 151 } | 151 } |
| 152 | 152 |
| 153 void EditCommandComposition::append(SimpleEditCommand* command) { | 153 void EditCommandComposition::append(SimpleEditCommand* command) { |
| 154 m_commands.append(command); | 154 m_commands.push_back(command); |
| 155 } | 155 } |
| 156 | 156 |
| 157 void EditCommandComposition::append(EditCommandComposition* composition) { | 157 void EditCommandComposition::append(EditCommandComposition* composition) { |
| 158 m_commands.appendVector(composition->m_commands); | 158 m_commands.appendVector(composition->m_commands); |
| 159 } | 159 } |
| 160 | 160 |
| 161 void EditCommandComposition::setStartingSelection( | 161 void EditCommandComposition::setStartingSelection( |
| 162 const VisibleSelection& selection) { | 162 const VisibleSelection& selection) { |
| 163 m_startingSelection = selection; | 163 m_startingSelection = selection; |
| 164 m_startingRootEditableElement = selection.rootEditableElement(); | 164 m_startingRootEditableElement = selection.rootEditableElement(); |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 command->setParent(this); | 280 command->setParent(this); |
| 281 command->doApply(editingState); | 281 command->doApply(editingState); |
| 282 if (editingState->isAborted()) { | 282 if (editingState->isAborted()) { |
| 283 command->setParent(nullptr); | 283 command->setParent(nullptr); |
| 284 return; | 284 return; |
| 285 } | 285 } |
| 286 if (command->isSimpleEditCommand()) { | 286 if (command->isSimpleEditCommand()) { |
| 287 command->setParent(0); | 287 command->setParent(0); |
| 288 ensureComposition()->append(toSimpleEditCommand(command)); | 288 ensureComposition()->append(toSimpleEditCommand(command)); |
| 289 } | 289 } |
| 290 m_commands.append(command); | 290 m_commands.push_back(command); |
| 291 } | 291 } |
| 292 | 292 |
| 293 void CompositeEditCommand::applyCommandToComposite( | 293 void CompositeEditCommand::applyCommandToComposite( |
| 294 CompositeEditCommand* command, | 294 CompositeEditCommand* command, |
| 295 const VisibleSelection& selection, | 295 const VisibleSelection& selection, |
| 296 EditingState* editingState) { | 296 EditingState* editingState) { |
| 297 command->setParent(this); | 297 command->setParent(this); |
| 298 if (selection != command->endingSelection()) { | 298 if (selection != command->endingSelection()) { |
| 299 command->setStartingSelection(selection); | 299 command->setStartingSelection(selection); |
| 300 command->setEndingVisibleSelection(selection); | 300 command->setEndingVisibleSelection(selection); |
| 301 } | 301 } |
| 302 command->doApply(editingState); | 302 command->doApply(editingState); |
| 303 if (!editingState->isAborted()) | 303 if (!editingState->isAborted()) |
| 304 m_commands.append(command); | 304 m_commands.push_back(command); |
| 305 } | 305 } |
| 306 | 306 |
| 307 void CompositeEditCommand::appendCommandToComposite( | 307 void CompositeEditCommand::appendCommandToComposite( |
| 308 CompositeEditCommand* command) { | 308 CompositeEditCommand* command) { |
| 309 ensureComposition()->append(command->ensureComposition()); | 309 ensureComposition()->append(command->ensureComposition()); |
| 310 command->m_composition = nullptr; | 310 command->m_composition = nullptr; |
| 311 command->setParent(this); | 311 command->setParent(this); |
| 312 m_commands.append(command); | 312 m_commands.append(command); |
| 313 } | 313 } |
| 314 | 314 |
| (...skipping 1714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2029 return node; | 2029 return node; |
| 2030 } | 2030 } |
| 2031 | 2031 |
| 2032 DEFINE_TRACE(CompositeEditCommand) { | 2032 DEFINE_TRACE(CompositeEditCommand) { |
| 2033 visitor->trace(m_commands); | 2033 visitor->trace(m_commands); |
| 2034 visitor->trace(m_composition); | 2034 visitor->trace(m_composition); |
| 2035 EditCommand::trace(visitor); | 2035 EditCommand::trace(visitor); |
| 2036 } | 2036 } |
| 2037 | 2037 |
| 2038 } // namespace blink | 2038 } // namespace blink |
| OLD | NEW |