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/DeleteSelectionCommand.cpp

Issue 2950053002: Make Position::BeforeNode() to take const Node& instead of Node* (Closed)
Patch Set: 2017-06-21T17:56:36 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 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2005 Apple Computer, 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 HTMLElement* start_special_container = nullptr; 120 HTMLElement* start_special_container = nullptr;
121 HTMLElement* end_special_container = nullptr; 121 HTMLElement* end_special_container = nullptr;
122 122
123 start = selection_to_delete_.Start(); 123 start = selection_to_delete_.Start();
124 end = selection_to_delete_.End(); 124 end = selection_to_delete_.End();
125 125
126 // For HRs, we'll get a position at (HR,1) when hitting delete from the 126 // For HRs, we'll get a position at (HR,1) when hitting delete from the
127 // beginning of the previous line, or (HR,0) when forward deleting, but in 127 // beginning of the previous line, or (HR,0) when forward deleting, but in
128 // these cases, we want to delete it, so manually expand the selection 128 // these cases, we want to delete it, so manually expand the selection
129 if (isHTMLHRElement(*start.AnchorNode())) 129 if (isHTMLHRElement(*start.AnchorNode()))
130 start = Position::BeforeNode(start.AnchorNode()); 130 start = Position::BeforeNode(*start.AnchorNode());
131 else if (isHTMLHRElement(*end.AnchorNode())) 131 else if (isHTMLHRElement(*end.AnchorNode()))
132 end = Position::AfterNode(end.AnchorNode()); 132 end = Position::AfterNode(end.AnchorNode());
133 133
134 // FIXME: This is only used so that moveParagraphs can avoid the bugs in 134 // FIXME: This is only used so that moveParagraphs can avoid the bugs in
135 // special element expansion. 135 // special element expansion.
136 if (!expand_for_special_elements_) 136 if (!expand_for_special_elements_)
137 return; 137 return;
138 138
139 while (1) { 139 while (1) {
140 start_special_container = 0; 140 start_special_container = 0;
(...skipping 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after
1247 visitor->Trace(delete_into_blockquote_style_); 1247 visitor->Trace(delete_into_blockquote_style_);
1248 visitor->Trace(start_root_); 1248 visitor->Trace(start_root_);
1249 visitor->Trace(end_root_); 1249 visitor->Trace(end_root_);
1250 visitor->Trace(start_table_row_); 1250 visitor->Trace(start_table_row_);
1251 visitor->Trace(end_table_row_); 1251 visitor->Trace(end_table_row_);
1252 visitor->Trace(temporary_placeholder_); 1252 visitor->Trace(temporary_placeholder_);
1253 CompositeEditCommand::Trace(visitor); 1253 CompositeEditCommand::Trace(visitor);
1254 } 1254 }
1255 1255
1256 } // namespace blink 1256 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698