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

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

Issue 2398923002: Prune a new call site of createVisibleSelectionDeprecated from DragController (Closed)
Patch Set: 201610061158 Created 4 years, 2 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 | « no previous file | 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) 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 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 innerFrame->selection().granularity() == WordGranularity && 582 innerFrame->selection().granularity() == WordGranularity &&
583 dragData->canSmartReplace()) 583 dragData->canSmartReplace())
584 ? InsertMode::Smart 584 ? InsertMode::Smart
585 : InsertMode::Simple; 585 : InsertMode::Simple;
586 586
587 if (!innerFrame->editor().deleteSelectionAfterDraggingWithEvents( 587 if (!innerFrame->editor().deleteSelectionAfterDraggingWithEvents(
588 innerFrame->editor().findEventTargetFromSelection(), deleteMode, 588 innerFrame->editor().findEventTargetFromSelection(), deleteMode,
589 dragCaret.base())) 589 dragCaret.base()))
590 return false; 590 return false;
591 591
592 innerFrame->selection().setSelection(createVisibleSelectionDeprecated( 592 // TODO(xiaochengh): Use of updateStyleAndLayoutIgnorePendingStylesheets
593 range->startPosition(), range->endPosition())); 593 // needs to be audited. See http://crbug.com/590369 for more details.
594 innerFrame->document()->updateStyleAndLayoutIgnorePendingStylesheets();
595
596 innerFrame->selection().setSelection(
597 createVisibleSelection(range->startPosition(), range->endPosition()));
594 if (innerFrame->selection().isAvailable()) { 598 if (innerFrame->selection().isAvailable()) {
595 DCHECK(m_documentUnderMouse); 599 DCHECK(m_documentUnderMouse);
596 if (!innerFrame->editor().replaceSelectionAfterDraggingWithEvents( 600 if (!innerFrame->editor().replaceSelectionAfterDraggingWithEvents(
597 element, dragData, fragment, range, insertMode, dragSourceType)) 601 element, dragData, fragment, range, insertMode, dragSourceType))
598 return false; 602 return false;
599 } 603 }
600 } else { 604 } else {
601 if (setSelectionToDragCaret(innerFrame, dragCaret, range, point)) { 605 if (setSelectionToDragCaret(innerFrame, dragCaret, range, point)) {
602 DCHECK(m_documentUnderMouse); 606 DCHECK(m_documentUnderMouse);
603 if (!innerFrame->editor().replaceSelectionAfterDraggingWithEvents( 607 if (!innerFrame->editor().replaceSelectionAfterDraggingWithEvents(
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
1174 } 1178 }
1175 1179
1176 DEFINE_TRACE(DragController) { 1180 DEFINE_TRACE(DragController) {
1177 visitor->trace(m_page); 1181 visitor->trace(m_page);
1178 visitor->trace(m_documentUnderMouse); 1182 visitor->trace(m_documentUnderMouse);
1179 visitor->trace(m_dragInitiator); 1183 visitor->trace(m_dragInitiator);
1180 visitor->trace(m_fileInputElementUnderMouse); 1184 visitor->trace(m_fileInputElementUnderMouse);
1181 } 1185 }
1182 1186
1183 } // namespace blink 1187 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698