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

Side by Side Diff: third_party/WebKit/Source/core/page/DragController.cpp

Issue 2709793003: Expand FrameSeleciton::base() to increase chances of hoisting update layout (Closed)
Patch Set: 2017-02-22T13:08:01 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 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after
1143 } else if (state.m_dragType == DragSourceActionLink) { 1143 } else if (state.m_dragType == DragSourceActionLink) {
1144 if (linkURL.isEmpty()) 1144 if (linkURL.isEmpty())
1145 return false; 1145 return false;
1146 if (src->selection() 1146 if (src->selection()
1147 .computeVisibleSelectionInDOMTreeDeprecated() 1147 .computeVisibleSelectionInDOMTreeDeprecated()
1148 .isCaret() && 1148 .isCaret() &&
1149 src->selection().isContentEditable()) { 1149 src->selection().isContentEditable()) {
1150 // a user can initiate a drag on a link without having any text 1150 // a user can initiate a drag on a link without having any text
1151 // selected. In this case, we should expand the selection to 1151 // selected. In this case, we should expand the selection to
1152 // the enclosing anchor element 1152 // the enclosing anchor element
1153 if (Node* node = enclosingAnchorElement(src->selection().base())) { 1153 if (Node* node = enclosingAnchorElement(
1154 src->selection()
1155 .computeVisibleSelectionInDOMTreeDeprecated()
1156 .base())) {
1154 src->selection().setSelection( 1157 src->selection().setSelection(
1155 SelectionInDOMTree::Builder().selectAllChildren(*node).build()); 1158 SelectionInDOMTree::Builder().selectAllChildren(*node).build());
1156 } 1159 }
1157 } 1160 }
1158 1161
1159 if (!dragImage) { 1162 if (!dragImage) {
1160 DCHECK(src->page()); 1163 DCHECK(src->page());
1161 float screenDeviceScaleFactor = 1164 float screenDeviceScaleFactor =
1162 src->page()->chromeClient().screenInfo().deviceScaleFactor; 1165 src->page()->chromeClient().screenInfo().deviceScaleFactor;
1163 dragImage = dragImageForLink(linkURL, hitTestResult.textContent(), 1166 dragImage = dragImageForLink(linkURL, hitTestResult.textContent(),
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
1244 1247
1245 DEFINE_TRACE(DragController) { 1248 DEFINE_TRACE(DragController) {
1246 visitor->trace(m_page); 1249 visitor->trace(m_page);
1247 visitor->trace(m_documentUnderMouse); 1250 visitor->trace(m_documentUnderMouse);
1248 visitor->trace(m_dragInitiator); 1251 visitor->trace(m_dragInitiator);
1249 visitor->trace(m_dragState); 1252 visitor->trace(m_dragState);
1250 visitor->trace(m_fileInputElementUnderMouse); 1253 visitor->trace(m_fileInputElementUnderMouse);
1251 } 1254 }
1252 1255
1253 } // namespace blink 1256 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698