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

Side by Side Diff: Source/core/editing/CompositeEditCommand.cpp

Issue 1201423002: Use VisibleSelection::InDOMTree::equalSelections() instead of operator==() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-06-24T15:30:20 Rebase - exclude FrameSelection Created 5 years, 6 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
« no previous file with comments | « no previous file | Source/core/editing/Editor.cpp » ('j') | Source/core/editing/VisibleSelection.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | Source/core/editing/Editor.cpp » ('j') | Source/core/editing/VisibleSelection.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698