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

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

Issue 2708703003: Expand FrameSeleciton::isRange() to increase chances of hoisting update layout (Closed)
Patch Set: 2017-02-21T23:48:22 rebase Created 3 years, 10 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, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2007, 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 m_shouldRetainAutocorrectionIndicator(options & 146 m_shouldRetainAutocorrectionIndicator(options &
147 RetainAutocorrectionIndicator), 147 RetainAutocorrectionIndicator),
148 m_shouldPreventSpellChecking(options & PreventSpellChecking) { 148 m_shouldPreventSpellChecking(options & PreventSpellChecking) {
149 updatePreservesTypingStyle(m_commandType); 149 updatePreservesTypingStyle(m_commandType);
150 } 150 }
151 151
152 void TypingCommand::deleteSelection(Document& document, Options options) { 152 void TypingCommand::deleteSelection(Document& document, Options options) {
153 LocalFrame* frame = document.frame(); 153 LocalFrame* frame = document.frame();
154 DCHECK(frame); 154 DCHECK(frame);
155 155
156 if (!frame->selection().isRange()) 156 if (!frame->selection()
157 .computeVisibleSelectionInDOMTreeDeprecated()
158 .isRange())
157 return; 159 return;
158 160
159 if (TypingCommand* lastTypingCommand = 161 if (TypingCommand* lastTypingCommand =
160 lastTypingCommandIfStillOpenForTyping(frame)) { 162 lastTypingCommandIfStillOpenForTyping(frame)) {
161 updateSelectionIfDifferentFromCurrentSelection(lastTypingCommand, frame); 163 updateSelectionIfDifferentFromCurrentSelection(lastTypingCommand, frame);
162 164
163 lastTypingCommand->setShouldPreventSpellChecking(options & 165 lastTypingCommand->setShouldPreventSpellChecking(options &
164 PreventSpellChecking); 166 PreventSpellChecking);
165 // InputMethodController uses this function to delete composition 167 // InputMethodController uses this function to delete composition
166 // selection. It won't be aborted. 168 // selection. It won't be aborted.
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after
965 } 967 }
966 NOTREACHED(); 968 NOTREACHED();
967 m_preservesTypingStyle = false; 969 m_preservesTypingStyle = false;
968 } 970 }
969 971
970 bool TypingCommand::isTypingCommand() const { 972 bool TypingCommand::isTypingCommand() const {
971 return true; 973 return true;
972 } 974 }
973 975
974 } // namespace blink 976 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp ('k') | third_party/WebKit/Source/core/frame/LocalFrame.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698