| OLD | NEW |
| 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 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 innerFrame->selection().granularity() == WordGranularity && | 610 innerFrame->selection().granularity() == WordGranularity && |
| 611 dragData->canSmartReplace()) | 611 dragData->canSmartReplace()) |
| 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 | |
| 621 // needs to be audited. See http://crbug.com/590369 for more details. | |
| 622 innerFrame->document()->updateStyleAndLayoutIgnorePendingStylesheets(); | |
| 623 | |
| 624 innerFrame->selection().setSelection( | 620 innerFrame->selection().setSelection( |
| 625 createVisibleSelection(range->startPosition(), range->endPosition())); | 621 SelectionInDOMTree::Builder() |
| 622 .setBaseAndExtent(EphemeralRange(range)) |
| 623 .build()); |
| 626 if (innerFrame->selection().isAvailable()) { | 624 if (innerFrame->selection().isAvailable()) { |
| 627 DCHECK(m_documentUnderMouse); | 625 DCHECK(m_documentUnderMouse); |
| 628 if (!innerFrame->editor().replaceSelectionAfterDraggingWithEvents( | 626 if (!innerFrame->editor().replaceSelectionAfterDraggingWithEvents( |
| 629 element, dragData, fragment, range, insertMode, dragSourceType)) | 627 element, dragData, fragment, range, insertMode, dragSourceType)) |
| 630 return false; | 628 return false; |
| 631 } | 629 } |
| 632 } else { | 630 } else { |
| 633 if (setSelectionToDragCaret(innerFrame, dragCaret, range, point)) { | 631 if (setSelectionToDragCaret(innerFrame, dragCaret, range, point)) { |
| 634 DCHECK(m_documentUnderMouse); | 632 DCHECK(m_documentUnderMouse); |
| 635 if (!innerFrame->editor().replaceSelectionAfterDraggingWithEvents( | 633 if (!innerFrame->editor().replaceSelectionAfterDraggingWithEvents( |
| (...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1216 } | 1214 } |
| 1217 | 1215 |
| 1218 DEFINE_TRACE(DragController) { | 1216 DEFINE_TRACE(DragController) { |
| 1219 visitor->trace(m_page); | 1217 visitor->trace(m_page); |
| 1220 visitor->trace(m_documentUnderMouse); | 1218 visitor->trace(m_documentUnderMouse); |
| 1221 visitor->trace(m_dragInitiator); | 1219 visitor->trace(m_dragInitiator); |
| 1222 visitor->trace(m_fileInputElementUnderMouse); | 1220 visitor->trace(m_fileInputElementUnderMouse); |
| 1223 } | 1221 } |
| 1224 | 1222 |
| 1225 } // namespace blink | 1223 } // namespace blink |
| OLD | NEW |