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

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

Issue 88453002: Calling isRenderedTable() instead of isTable() to maintain consistency within the Editing module. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 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 | « Source/core/editing/TextIterator.cpp ('k') | Source/core/editing/htmlediting.cpp » ('j') | 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 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 selection.modify(FrameSelection::AlterationExtend, DirectionForward, CharacterGranularity); 523 selection.modify(FrameSelection::AlterationExtend, DirectionForward, CharacterGranularity);
524 524
525 Position downstreamEnd = endingSelection().end().downstream(); 525 Position downstreamEnd = endingSelection().end().downstream();
526 VisiblePosition visibleEnd = endingSelection().visibleEnd(); 526 VisiblePosition visibleEnd = endingSelection().visibleEnd();
527 Node* enclosingTableCell = enclosingNodeOfType(visibleEnd.deepEquivalent (), &isTableCell); 527 Node* enclosingTableCell = enclosingNodeOfType(visibleEnd.deepEquivalent (), &isTableCell);
528 if (enclosingTableCell && visibleEnd == lastPositionInNode(enclosingTabl eCell)) 528 if (enclosingTableCell && visibleEnd == lastPositionInNode(enclosingTabl eCell))
529 return; 529 return;
530 if (visibleEnd == endOfParagraph(visibleEnd)) 530 if (visibleEnd == endOfParagraph(visibleEnd))
531 downstreamEnd = visibleEnd.next(CannotCrossEditingBoundary).deepEqui valent().downstream(); 531 downstreamEnd = visibleEnd.next(CannotCrossEditingBoundary).deepEqui valent().downstream();
532 // When deleting tables: Select the table first, then perform the deleti on 532 // When deleting tables: Select the table first, then perform the deleti on
533 if (downstreamEnd.containerNode() && downstreamEnd.containerNode()->rend erer() && downstreamEnd.containerNode()->renderer()->isTable() 533 if (isRenderedTable(downstreamEnd.containerNode()) && downstreamEnd.comp uteOffsetInContainerNode() <= caretMinOffset(downstreamEnd.containerNode())) {
534 && downstreamEnd.computeOffsetInContainerNode() <= caretMinOffset(do wnstreamEnd.containerNode())) {
535 setEndingSelection(VisibleSelection(endingSelection().end(), positio nAfterNode(downstreamEnd.containerNode()), DOWNSTREAM, endingSelection().isDirec tional())); 534 setEndingSelection(VisibleSelection(endingSelection().end(), positio nAfterNode(downstreamEnd.containerNode()), DOWNSTREAM, endingSelection().isDirec tional()));
536 typingAddedToOpenCommand(ForwardDeleteKey); 535 typingAddedToOpenCommand(ForwardDeleteKey);
537 return; 536 return;
538 } 537 }
539 538
540 // deleting to end of paragraph when at end of paragraph needs to merge the next paragraph (if any) 539 // deleting to end of paragraph when at end of paragraph needs to merge the next paragraph (if any)
541 if (granularity == ParagraphBoundary && selection.selection().isCaret() && isEndOfParagraph(selection.selection().visibleEnd())) 540 if (granularity == ParagraphBoundary && selection.selection().isCaret() && isEndOfParagraph(selection.selection().visibleEnd()))
542 selection.modify(FrameSelection::AlterationExtend, DirectionForward, CharacterGranularity); 541 selection.modify(FrameSelection::AlterationExtend, DirectionForward, CharacterGranularity);
543 542
544 selectionToDelete = selection.selection(); 543 selectionToDelete = selection.selection();
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 ASSERT_NOT_REACHED(); 608 ASSERT_NOT_REACHED();
610 m_preservesTypingStyle = false; 609 m_preservesTypingStyle = false;
611 } 610 }
612 611
613 bool TypingCommand::isTypingCommand() const 612 bool TypingCommand::isTypingCommand() const
614 { 613 {
615 return true; 614 return true;
616 } 615 }
617 616
618 } // namespace WebCore 617 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/editing/TextIterator.cpp ('k') | Source/core/editing/htmlediting.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698