| 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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 if (command->isSimpleEditCommand()) { | 249 if (command->isSimpleEditCommand()) { |
| 250 command->setParent(0); | 250 command->setParent(0); |
| 251 ensureComposition()->append(toSimpleEditCommand(command.get())); | 251 ensureComposition()->append(toSimpleEditCommand(command.get())); |
| 252 } | 252 } |
| 253 m_commands.append(command.release()); | 253 m_commands.append(command.release()); |
| 254 } | 254 } |
| 255 | 255 |
| 256 void CompositeEditCommand::applyCommandToComposite(PassRefPtrWillBeRawPtr<Compos
iteEditCommand> command, const VisibleSelection& selection) | 256 void CompositeEditCommand::applyCommandToComposite(PassRefPtrWillBeRawPtr<Compos
iteEditCommand> command, const VisibleSelection& selection) |
| 257 { | 257 { |
| 258 command->setParent(this); | 258 command->setParent(this); |
| 259 if (selection != command->endingSelection()) { | 259 if (!VisibleSelection::InDOMTree::equalSelections(selection, command->ending
Selection())) { |
| 260 command->setStartingSelection(selection); | 260 command->setStartingSelection(selection); |
| 261 command->setEndingSelection(selection); | 261 command->setEndingSelection(selection); |
| 262 } | 262 } |
| 263 command->doApply(); | 263 command->doApply(); |
| 264 m_commands.append(command); | 264 m_commands.append(command); |
| 265 } | 265 } |
| 266 | 266 |
| 267 void CompositeEditCommand::applyStyle(const EditingStyle* style, EditAction edit
ingAction) | 267 void CompositeEditCommand::applyStyle(const EditingStyle* style, EditAction edit
ingAction) |
| 268 { | 268 { |
| 269 applyCommandToComposite(ApplyStyleCommand::create(document(), style, editing
Action)); | 269 applyCommandToComposite(ApplyStyleCommand::create(document(), style, editing
Action)); |
| (...skipping 1228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1498 } | 1498 } |
| 1499 | 1499 |
| 1500 DEFINE_TRACE(CompositeEditCommand) | 1500 DEFINE_TRACE(CompositeEditCommand) |
| 1501 { | 1501 { |
| 1502 visitor->trace(m_commands); | 1502 visitor->trace(m_commands); |
| 1503 visitor->trace(m_composition); | 1503 visitor->trace(m_composition); |
| 1504 EditCommand::trace(visitor); | 1504 EditCommand::trace(visitor); |
| 1505 } | 1505 } |
| 1506 | 1506 |
| 1507 } // namespace blink | 1507 } // namespace blink |
| OLD | NEW |