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

Side by Side Diff: third_party/WebKit/Source/core/editing/commands/IndentOutdentCommand.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
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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 VisiblePosition position_in_enclosing_block = 229 VisiblePosition position_in_enclosing_block =
230 VisiblePosition::FirstPositionInNode(*enclosing_element); 230 VisiblePosition::FirstPositionInNode(*enclosing_element);
231 // If the blockquote is inline, the start of the enclosing block coincides 231 // If the blockquote is inline, the start of the enclosing block coincides
232 // with positionInEnclosingBlock. 232 // with positionInEnclosingBlock.
233 VisiblePosition start_of_enclosing_block = 233 VisiblePosition start_of_enclosing_block =
234 (enclosing_element->GetLayoutObject() && 234 (enclosing_element->GetLayoutObject() &&
235 enclosing_element->GetLayoutObject()->IsInline()) 235 enclosing_element->GetLayoutObject()->IsInline())
236 ? position_in_enclosing_block 236 ? position_in_enclosing_block
237 : StartOfBlock(position_in_enclosing_block); 237 : StartOfBlock(position_in_enclosing_block);
238 VisiblePosition last_position_in_enclosing_block = 238 VisiblePosition last_position_in_enclosing_block =
239 VisiblePosition::LastPositionInNode(enclosing_element); 239 VisiblePosition::LastPositionInNode(*enclosing_element);
240 VisiblePosition end_of_enclosing_block = 240 VisiblePosition end_of_enclosing_block =
241 EndOfBlock(last_position_in_enclosing_block); 241 EndOfBlock(last_position_in_enclosing_block);
242 if (visible_start_of_paragraph.DeepEquivalent() == 242 if (visible_start_of_paragraph.DeepEquivalent() ==
243 start_of_enclosing_block.DeepEquivalent() && 243 start_of_enclosing_block.DeepEquivalent() &&
244 visible_end_of_paragraph.DeepEquivalent() == 244 visible_end_of_paragraph.DeepEquivalent() ==
245 end_of_enclosing_block.DeepEquivalent()) { 245 end_of_enclosing_block.DeepEquivalent()) {
246 // The blockquote doesn't contain anything outside the paragraph, so it can 246 // The blockquote doesn't contain anything outside the paragraph, so it can
247 // be totally removed. 247 // be totally removed.
248 Node* split_point = enclosing_element->nextSibling(); 248 Node* split_point = enclosing_element->nextSibling();
249 RemoveNodePreservingChildren(enclosing_element, editing_state); 249 RemoveNodePreservingChildren(enclosing_element, editing_state);
(...skipping 170 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

Powered by Google App Engine
This is Rietveld 408576698