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

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

Issue 2957833004: Make VisiblePosition::LastPositionInNode() to take const Node& instead of Node* (Closed)
Patch Set: 2017-06-27T15:28:02 Created 3 years, 5 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 | « third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.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 883 matching lines...) Expand 10 before | Expand all | Expand 10 after
894 selection_modifier.Modify(FrameSelection::kAlterationExtend, 894 selection_modifier.Modify(FrameSelection::kAlterationExtend,
895 kDirectionForward, kCharacterGranularity); 895 kDirectionForward, kCharacterGranularity);
896 896
897 Position downstream_end = 897 Position downstream_end =
898 MostForwardCaretPosition(EndingSelection().End()); 898 MostForwardCaretPosition(EndingSelection().End());
899 VisiblePosition visible_end = EndingSelection().VisibleEnd(); 899 VisiblePosition visible_end = EndingSelection().VisibleEnd();
900 Node* enclosing_table_cell = 900 Node* enclosing_table_cell =
901 EnclosingNodeOfType(visible_end.DeepEquivalent(), &IsTableCell); 901 EnclosingNodeOfType(visible_end.DeepEquivalent(), &IsTableCell);
902 if (enclosing_table_cell && 902 if (enclosing_table_cell &&
903 visible_end.DeepEquivalent() == 903 visible_end.DeepEquivalent() ==
904 VisiblePosition::LastPositionInNode(enclosing_table_cell) 904 VisiblePosition::LastPositionInNode(*enclosing_table_cell)
905 .DeepEquivalent()) 905 .DeepEquivalent())
906 return; 906 return;
907 if (visible_end.DeepEquivalent() == 907 if (visible_end.DeepEquivalent() ==
908 EndOfParagraph(visible_end).DeepEquivalent()) 908 EndOfParagraph(visible_end).DeepEquivalent())
909 downstream_end = MostForwardCaretPosition( 909 downstream_end = MostForwardCaretPosition(
910 NextPositionOf(visible_end, kCannotCrossEditingBoundary) 910 NextPositionOf(visible_end, kCannotCrossEditingBoundary)
911 .DeepEquivalent()); 911 .DeepEquivalent());
912 // When deleting tables: Select the table first, then perform the deletion 912 // When deleting tables: Select the table first, then perform the deletion
913 if (IsDisplayInsideTable(downstream_end.ComputeContainerNode()) && 913 if (IsDisplayInsideTable(downstream_end.ComputeContainerNode()) &&
914 downstream_end.ComputeOffsetInContainerNode() <= 914 downstream_end.ComputeOffsetInContainerNode() <=
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1015 } 1015 }
1016 NOTREACHED(); 1016 NOTREACHED();
1017 preserves_typing_style_ = false; 1017 preserves_typing_style_ = false;
1018 } 1018 }
1019 1019
1020 bool TypingCommand::IsTypingCommand() const { 1020 bool TypingCommand::IsTypingCommand() const {
1021 return true; 1021 return true;
1022 } 1022 }
1023 1023
1024 } // namespace blink 1024 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698