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

Side by Side Diff: sky/engine/core/editing/TypingCommand.cpp

Issue 767623004: Delete a bunch of rich text editing code. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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 | « sky/engine/core/editing/SplitTextNodeContainingElementCommand.cpp ('k') | no next file » | no next file with comments »
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 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 392
393 VisibleSelection selectionToDelete; 393 VisibleSelection selectionToDelete;
394 VisibleSelection selectionAfterUndo; 394 VisibleSelection selectionAfterUndo;
395 395
396 switch (endingSelection().selectionType()) { 396 switch (endingSelection().selectionType()) {
397 case RangeSelection: 397 case RangeSelection:
398 selectionToDelete = endingSelection(); 398 selectionToDelete = endingSelection();
399 selectionAfterUndo = selectionToDelete; 399 selectionAfterUndo = selectionToDelete;
400 break; 400 break;
401 case CaretSelection: { 401 case CaretSelection: {
402 // After breaking out of an empty mail blockquote, we still want continu e with the deletion
403 // so actual content will get deleted, and not just the quote style.
404 if (breakOutOfEmptyMailBlockquotedParagraph())
405 typingAddedToOpenCommand(DeleteKey);
406
407 m_smartDelete = false; 402 m_smartDelete = false;
408 403
409 OwnPtr<FrameSelection> selection = FrameSelection::create(); 404 OwnPtr<FrameSelection> selection = FrameSelection::create();
410 selection->setSelection(endingSelection()); 405 selection->setSelection(endingSelection());
411 selection->modify(FrameSelection::AlterationExtend, DirectionBackward, g ranularity); 406 selection->modify(FrameSelection::AlterationExtend, DirectionBackward, g ranularity);
412 407
413 VisiblePosition visibleStart(endingSelection().visibleStart()); 408 VisiblePosition visibleStart(endingSelection().visibleStart());
414 if (visibleStart.previous(CannotCrossEditingBoundary).isNull()) { 409 if (visibleStart.previous(CannotCrossEditingBoundary).isNull()) {
415 // When the caret is at the start of the editable area in an empty l ist item, break out of the list item.
416 if (breakOutOfEmptyListItem()) {
417 typingAddedToOpenCommand(DeleteKey);
418 return;
419 }
420 // When there are no visible positions in the editing root, delete i ts entire contents. 410 // When there are no visible positions in the editing root, delete i ts entire contents.
421 if (visibleStart.next(CannotCrossEditingBoundary).isNull() && makeEd itableRootEmpty()) { 411 if (visibleStart.next(CannotCrossEditingBoundary).isNull() && makeEd itableRootEmpty()) {
422 typingAddedToOpenCommand(DeleteKey); 412 typingAddedToOpenCommand(DeleteKey);
423 return; 413 return;
424 } 414 }
425 } 415 }
426 416
427 // If the caret is at the start of a paragraph after a table, move conte nt into the last table cell. 417 // If the caret is at the start of a paragraph after a table, move conte nt into the last table cell.
428 if (isStartOfParagraph(visibleStart) && isFirstPositionAfterTable(visibl eStart.previous(CannotCrossEditingBoundary))) { 418 if (isStartOfParagraph(visibleStart) && isFirstPositionAfterTable(visibl eStart.previous(CannotCrossEditingBoundary))) {
429 // Unless the caret is just before a table. We don't want to move a table into the last table cell. 419 // Unless the caret is just before a table. We don't want to move a table into the last table cell.
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 ASSERT_NOT_REACHED(); 574 ASSERT_NOT_REACHED();
585 m_preservesTypingStyle = false; 575 m_preservesTypingStyle = false;
586 } 576 }
587 577
588 bool TypingCommand::isTypingCommand() const 578 bool TypingCommand::isTypingCommand() const
589 { 579 {
590 return true; 580 return true;
591 } 581 }
592 582
593 } // namespace blink 583 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/editing/SplitTextNodeContainingElementCommand.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698