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

Side by Side Diff: third_party/WebKit/Source/core/page/DragController.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) 2007, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2009, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Google Inc. 3 * Copyright (C) 2008 Google Inc.
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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 dragSourceType = DragSourceType::PlainTextSource; 192 dragSourceType = DragSourceType::PlainTextSource;
193 return createFragmentFromText(EphemeralRange(context), 193 return createFragmentFromText(EphemeralRange(context),
194 dragData->asPlainText()); 194 dragData->asPlainText());
195 } 195 }
196 196
197 return nullptr; 197 return nullptr;
198 } 198 }
199 199
200 bool DragController::dragIsMove(FrameSelection& selection, DragData* dragData) { 200 bool DragController::dragIsMove(FrameSelection& selection, DragData* dragData) {
201 return m_documentUnderMouse == m_dragInitiator && 201 return m_documentUnderMouse == m_dragInitiator &&
202 selection.isContentEditable() && selection.isRange() && 202 selection.isContentEditable() &&
203 selection.computeVisibleSelectionInDOMTreeDeprecated().isRange() &&
203 !isCopyKeyDown(dragData); 204 !isCopyKeyDown(dragData);
204 } 205 }
205 206
206 // FIXME: This method is poorly named. We're just clearing the selection from 207 // FIXME: This method is poorly named. We're just clearing the selection from
207 // the document this drag is exiting. 208 // the document this drag is exiting.
208 void DragController::cancelDrag() { 209 void DragController::cancelDrag() {
209 m_page->dragCaret().clear(); 210 m_page->dragCaret().clear();
210 } 211 }
211 212
212 void DragController::dragEnded() { 213 void DragController::dragEnded() {
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after
1243 1244
1244 DEFINE_TRACE(DragController) { 1245 DEFINE_TRACE(DragController) {
1245 visitor->trace(m_page); 1246 visitor->trace(m_page);
1246 visitor->trace(m_documentUnderMouse); 1247 visitor->trace(m_documentUnderMouse);
1247 visitor->trace(m_dragInitiator); 1248 visitor->trace(m_dragInitiator);
1248 visitor->trace(m_dragState); 1249 visitor->trace(m_dragState);
1249 visitor->trace(m_fileInputElementUnderMouse); 1250 visitor->trace(m_fileInputElementUnderMouse);
1250 } 1251 }
1251 1252
1252 } // namespace blink 1253 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/input/MouseEventManager.cpp ('k') | third_party/WebKit/Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698