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

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

Issue 2953683004: Make Position::AfterNode() to take const Node& instead of Node* (Closed)
Patch Set: 2017-06-22T12:37:16 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2009, 2010, 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2009, 2010, 2011 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 1505 matching lines...) Expand 10 before | Expand all | Expand 10 after
1516 if (TextControlElement* text_control = 1516 if (TextControlElement* text_control =
1517 EnclosingTextControl(current_root)) { 1517 EnclosingTextControl(current_root)) {
1518 if (!inserted_nodes.LastLeafInserted()->nextSibling()) { 1518 if (!inserted_nodes.LastLeafInserted()->nextSibling()) {
1519 InsertNodeAfter(text_control->CreatePlaceholderBreakElement(), 1519 InsertNodeAfter(text_control->CreatePlaceholderBreakElement(),
1520 inserted_nodes.LastLeafInserted(), editing_state); 1520 inserted_nodes.LastLeafInserted(), editing_state);
1521 if (editing_state->IsAborted()) 1521 if (editing_state->IsAborted())
1522 return; 1522 return;
1523 } 1523 }
1524 SetEndingSelection(SelectionInDOMTree::Builder() 1524 SetEndingSelection(SelectionInDOMTree::Builder()
1525 .Collapse(Position::AfterNode( 1525 .Collapse(Position::AfterNode(
1526 inserted_nodes.LastLeafInserted())) 1526 *inserted_nodes.LastLeafInserted()))
1527 .Build()); 1527 .Build());
1528 // Select up to the paragraph separator that was added. 1528 // Select up to the paragraph separator that was added.
1529 last_position_to_select = 1529 last_position_to_select =
1530 EndingSelection().VisibleStart().DeepEquivalent(); 1530 EndingSelection().VisibleStart().DeepEquivalent();
1531 } else if (!IsStartOfParagraph(end_of_inserted_content)) { 1531 } else if (!IsStartOfParagraph(end_of_inserted_content)) {
1532 SetEndingSelection( 1532 SetEndingSelection(
1533 SelectionInDOMTree::Builder() 1533 SelectionInDOMTree::Builder()
1534 .Collapse(end_of_inserted_content.DeepEquivalent()) 1534 .Collapse(end_of_inserted_content.DeepEquivalent())
1535 .Build()); 1535 .Build());
1536 Element* enclosing_block_element = EnclosingBlock( 1536 Element* enclosing_block_element = EnclosingBlock(
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
2009 visitor->Trace(start_of_inserted_content_); 2009 visitor->Trace(start_of_inserted_content_);
2010 visitor->Trace(end_of_inserted_content_); 2010 visitor->Trace(end_of_inserted_content_);
2011 visitor->Trace(insertion_style_); 2011 visitor->Trace(insertion_style_);
2012 visitor->Trace(document_fragment_); 2012 visitor->Trace(document_fragment_);
2013 visitor->Trace(start_of_inserted_range_); 2013 visitor->Trace(start_of_inserted_range_);
2014 visitor->Trace(end_of_inserted_range_); 2014 visitor->Trace(end_of_inserted_range_);
2015 CompositeEditCommand::Trace(visitor); 2015 CompositeEditCommand::Trace(visitor);
2016 } 2016 }
2017 2017
2018 } // namespace blink 2018 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698