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

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

Issue 2950273002: Make VisiblePosition::AfterNode() to take const Node& instead of Node* (Closed)
Patch Set: 2017-06-22T17:02:21 Created 3 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 | « third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.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) 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 // require proper deletion in that case. 102 // require proper deletion in that case.
103 const bool should_keep_selected_list = 103 const bool should_keep_selected_list =
104 end.AnchorNode() == selected_list_item || 104 end.AnchorNode() == selected_list_item ||
105 end.AnchorNode()->IsDescendantOf(selected_list_item->lastChild()); 105 end.AnchorNode()->IsDescendantOf(selected_list_item->lastChild());
106 106
107 const VisiblePosition& start_of_paragraph_to_move = 107 const VisiblePosition& start_of_paragraph_to_move =
108 CreateVisiblePosition(start); 108 CreateVisiblePosition(start);
109 const VisiblePosition& end_of_paragraph_to_move = 109 const VisiblePosition& end_of_paragraph_to_move =
110 should_keep_selected_list 110 should_keep_selected_list
111 ? CreateVisiblePosition(end) 111 ? CreateVisiblePosition(end)
112 : VisiblePosition::AfterNode(selected_list_item->lastChild()); 112 : VisiblePosition::AfterNode(*selected_list_item->lastChild());
113 113
114 // The insertion of |newList| may change the computed style of other 114 // The insertion of |newList| may change the computed style of other
115 // elements, resulting in failure in visible canonicalization. 115 // elements, resulting in failure in visible canonicalization.
116 if (start_of_paragraph_to_move.IsNull() || 116 if (start_of_paragraph_to_move.IsNull() ||
117 end_of_paragraph_to_move.IsNull()) { 117 end_of_paragraph_to_move.IsNull()) {
118 editing_state->Abort(); 118 editing_state->Abort();
119 return false; 119 return false;
120 } 120 }
121 121
122 MoveParagraphWithClones(start_of_paragraph_to_move, end_of_paragraph_to_move, 122 MoveParagraphWithClones(start_of_paragraph_to_move, end_of_paragraph_to_move,
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 else 420 else
421 IndentIntoBlockquote(start, end, blockquote_for_next_indent, editing_state); 421 IndentIntoBlockquote(start, end, blockquote_for_next_indent, editing_state);
422 } 422 }
423 423
424 InputEvent::InputType IndentOutdentCommand::GetInputType() const { 424 InputEvent::InputType IndentOutdentCommand::GetInputType() const {
425 return type_of_action_ == kIndent ? InputEvent::InputType::kFormatIndent 425 return type_of_action_ == kIndent ? InputEvent::InputType::kFormatIndent
426 : InputEvent::InputType::kFormatOutdent; 426 : InputEvent::InputType::kFormatOutdent;
427 } 427 }
428 428
429 } // namespace blink 429 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698