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

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

Issue 2824633002: Reform editing/execCommand/delete-non-editable-range-crash.html (Closed)
Patch Set: Created 3 years, 8 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/LayoutTests/editing/execCommand/delete-non-editable-range-crash-expected.txt ('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 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 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after
1053 } 1053 }
1054 } 1054 }
1055 1055
1056 void DeleteSelectionCommand::DoApply(EditingState* editing_state) { 1056 void DeleteSelectionCommand::DoApply(EditingState* editing_state) {
1057 // If selection has not been set to a custom selection when the command was 1057 // If selection has not been set to a custom selection when the command was
1058 // created, use the current ending selection. 1058 // created, use the current ending selection.
1059 if (!has_selection_to_delete_) 1059 if (!has_selection_to_delete_)
1060 selection_to_delete_ = EndingSelection(); 1060 selection_to_delete_ = EndingSelection();
1061 1061
1062 if (!selection_to_delete_.IsNonOrphanedRange() || 1062 if (!selection_to_delete_.IsNonOrphanedRange() ||
1063 !selection_to_delete_.IsContentEditable()) 1063 !selection_to_delete_.IsContentEditable()) {
1064 // editing/execCommand/delete-non-editable-range-crash.html reaches here.
Xiaocheng 2017/04/15 04:37:32 I manually checked that the converted test does re
1064 return; 1065 return;
1066 }
1065 1067
1066 RelocatablePosition relocatable_reference_position(reference_move_position_); 1068 RelocatablePosition relocatable_reference_position(reference_move_position_);
1067 1069
1068 // save this to later make the selection with 1070 // save this to later make the selection with
1069 TextAffinity affinity = selection_to_delete_.Affinity(); 1071 TextAffinity affinity = selection_to_delete_.Affinity();
1070 1072
1071 GetDocument().UpdateStyleAndLayoutIgnorePendingStylesheets(); 1073 GetDocument().UpdateStyleAndLayoutIgnorePendingStylesheets();
1072 1074
1073 Position downstream_end = 1075 Position downstream_end =
1074 MostForwardCaretPosition(selection_to_delete_.end()); 1076 MostForwardCaretPosition(selection_to_delete_.end());
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
1244 visitor->Trace(delete_into_blockquote_style_); 1246 visitor->Trace(delete_into_blockquote_style_);
1245 visitor->Trace(start_root_); 1247 visitor->Trace(start_root_);
1246 visitor->Trace(end_root_); 1248 visitor->Trace(end_root_);
1247 visitor->Trace(start_table_row_); 1249 visitor->Trace(start_table_row_);
1248 visitor->Trace(end_table_row_); 1250 visitor->Trace(end_table_row_);
1249 visitor->Trace(temporary_placeholder_); 1251 visitor->Trace(temporary_placeholder_);
1250 CompositeEditCommand::Trace(visitor); 1252 CompositeEditCommand::Trace(visitor);
1251 } 1253 }
1252 1254
1253 } // namespace blink 1255 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/editing/execCommand/delete-non-editable-range-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698