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

Side by Side Diff: third_party/WebKit/Source/core/editing/commands/IndentOutdentCommand.cpp

Issue 2450213002: Utilize EditCommand::setEndingSelection() taking SelectionInDOMTree (Closed)
Patch Set: 2016-10-28T14:44:14 Created 4 years, 1 month 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 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 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 341
342 while (endOfCurrentParagraph.deepEquivalent() != endAfterSelection) { 342 while (endOfCurrentParagraph.deepEquivalent() != endAfterSelection) {
343 PositionWithAffinity endOfNextParagraph = 343 PositionWithAffinity endOfNextParagraph =
344 endOfParagraph(nextPositionOf(endOfCurrentParagraph)) 344 endOfParagraph(nextPositionOf(endOfCurrentParagraph))
345 .toPositionWithAffinity(); 345 .toPositionWithAffinity();
346 if (endOfCurrentParagraph.deepEquivalent() == 346 if (endOfCurrentParagraph.deepEquivalent() ==
347 endOfLastParagraph.deepEquivalent()) { 347 endOfLastParagraph.deepEquivalent()) {
348 SelectionInDOMTree::Builder builder; 348 SelectionInDOMTree::Builder builder;
349 if (originalSelectionEnd.isNotNull()) 349 if (originalSelectionEnd.isNotNull())
350 builder.collapse(originalSelectionEnd); 350 builder.collapse(originalSelectionEnd);
351 setEndingSelection(createVisibleSelection(builder.build())); 351 setEndingSelection(builder.build());
352 } else { 352 } else {
353 setEndingSelection(SelectionInDOMTree::Builder() 353 setEndingSelection(SelectionInDOMTree::Builder()
354 .collapse(endOfCurrentParagraph.deepEquivalent()) 354 .collapse(endOfCurrentParagraph.deepEquivalent())
355 .build()); 355 .build());
356 } 356 }
357 357
358 outdentParagraph(editingState); 358 outdentParagraph(editingState);
359 if (editingState->isAborted()) 359 if (editingState->isAborted())
360 return; 360 return;
361 361
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 else 400 else
401 indentIntoBlockquote(start, end, blockquoteForNextIndent, editingState); 401 indentIntoBlockquote(start, end, blockquoteForNextIndent, editingState);
402 } 402 }
403 403
404 InputEvent::InputType IndentOutdentCommand::inputType() const { 404 InputEvent::InputType IndentOutdentCommand::inputType() const {
405 return m_typeOfAction == Indent ? InputEvent::InputType::Indent 405 return m_typeOfAction == Indent ? InputEvent::InputType::Indent
406 : InputEvent::InputType::Outdent; 406 : InputEvent::InputType::Outdent;
407 } 407 }
408 408
409 } // namespace blink 409 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698