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

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

Issue 2451613003: Get rid of createVisibleSelection() taking two Position (Closed)
Patch Set: 2016-10-26T11:29:45 Created 4 years, 1 month 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 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 ? InsertMode::Smart 612 ? InsertMode::Smart
613 : InsertMode::Simple; 613 : InsertMode::Simple;
614 614
615 if (!innerFrame->editor().deleteSelectionAfterDraggingWithEvents( 615 if (!innerFrame->editor().deleteSelectionAfterDraggingWithEvents(
616 innerFrame->editor().findEventTargetFromSelection(), deleteMode, 616 innerFrame->editor().findEventTargetFromSelection(), deleteMode,
617 dragCaret.base())) 617 dragCaret.base()))
618 return false; 618 return false;
619 619
620 // TODO(xiaochengh): Use of updateStyleAndLayoutIgnorePendingStylesheets 620 // TODO(xiaochengh): Use of updateStyleAndLayoutIgnorePendingStylesheets
621 // needs to be audited. See http://crbug.com/590369 for more details. 621 // needs to be audited. See http://crbug.com/590369 for more details.
622 innerFrame->document()->updateStyleAndLayoutIgnorePendingStylesheets(); 622 innerFrame->document()->updateStyleAndLayoutIgnorePendingStylesheets();
Xiaocheng 2016/10/26 05:49:18 We can remove it now.
yosin_UTC9 2016/10/26 07:43:07 Good catch! Done.
623 623
624 innerFrame->selection().setSelection( 624 innerFrame->selection().setSelection(
625 createVisibleSelection(range->startPosition(), range->endPosition())); 625 SelectionInDOMTree::Builder()
626 .setBaseAndExtent(EphemeralRange(range))
627 .build());
626 if (innerFrame->selection().isAvailable()) { 628 if (innerFrame->selection().isAvailable()) {
627 DCHECK(m_documentUnderMouse); 629 DCHECK(m_documentUnderMouse);
628 if (!innerFrame->editor().replaceSelectionAfterDraggingWithEvents( 630 if (!innerFrame->editor().replaceSelectionAfterDraggingWithEvents(
629 element, dragData, fragment, range, insertMode, dragSourceType)) 631 element, dragData, fragment, range, insertMode, dragSourceType))
630 return false; 632 return false;
631 } 633 }
632 } else { 634 } else {
633 if (setSelectionToDragCaret(innerFrame, dragCaret, range, point)) { 635 if (setSelectionToDragCaret(innerFrame, dragCaret, range, point)) {
634 DCHECK(m_documentUnderMouse); 636 DCHECK(m_documentUnderMouse);
635 if (!innerFrame->editor().replaceSelectionAfterDraggingWithEvents( 637 if (!innerFrame->editor().replaceSelectionAfterDraggingWithEvents(
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
1216 } 1218 }
1217 1219
1218 DEFINE_TRACE(DragController) { 1220 DEFINE_TRACE(DragController) {
1219 visitor->trace(m_page); 1221 visitor->trace(m_page);
1220 visitor->trace(m_documentUnderMouse); 1222 visitor->trace(m_documentUnderMouse);
1221 visitor->trace(m_dragInitiator); 1223 visitor->trace(m_dragInitiator);
1222 visitor->trace(m_fileInputElementUnderMouse); 1224 visitor->trace(m_fileInputElementUnderMouse);
1223 } 1225 }
1224 1226
1225 } // namespace blink 1227 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698