| 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 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 SelectionInDOMTree::Builder().collapse(caretPosition).build()); | 565 SelectionInDOMTree::Builder().collapse(caretPosition).build()); |
| 566 m_page->dragCaret().clear(); | 566 m_page->dragCaret().clear(); |
| 567 // |innerFrame| can be removed by event handler called by | 567 // |innerFrame| can be removed by event handler called by |
| 568 // |dispatchTextInputEventFor()|. | 568 // |dispatchTextInputEventFor()|. |
| 569 if (!innerFrame->selection().isAvailable()) { | 569 if (!innerFrame->selection().isAvailable()) { |
| 570 // "editing/pasteboard/drop-text-events-sideeffect-crash.html" reaches | 570 // "editing/pasteboard/drop-text-events-sideeffect-crash.html" reaches |
| 571 // here. | 571 // here. |
| 572 return false; | 572 return false; |
| 573 } | 573 } |
| 574 Range* range = createRange(dragCaret.toNormalizedEphemeralRange()); | 574 Range* range = createRange(dragCaret.toNormalizedEphemeralRange()); |
| 575 Element* rootEditableElement = innerFrame->selection().rootEditableElement(); | 575 Element* rootEditableElement = |
| 576 innerFrame->selection() |
| 577 .computeVisibleSelectionInDOMTreeDeprecated() |
| 578 .rootEditableElement(); |
| 576 | 579 |
| 577 // For range to be null a WebKit client must have done something bad while | 580 // For range to be null a WebKit client must have done something bad while |
| 578 // manually controlling drag behaviour | 581 // manually controlling drag behaviour |
| 579 if (!range) | 582 if (!range) |
| 580 return false; | 583 return false; |
| 581 ResourceFetcher* fetcher = range->ownerDocument().fetcher(); | 584 ResourceFetcher* fetcher = range->ownerDocument().fetcher(); |
| 582 ResourceCacheValidationSuppressor validationSuppressor(fetcher); | 585 ResourceCacheValidationSuppressor validationSuppressor(fetcher); |
| 583 | 586 |
| 584 // Start new Drag&Drop command group, invalidate previous command group. | 587 // Start new Drag&Drop command group, invalidate previous command group. |
| 585 // Assume no other places is firing |DeleteByDrag| and |InsertFromDrop|. | 588 // Assume no other places is firing |DeleteByDrag| and |InsertFromDrop|. |
| (...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1237 | 1240 |
| 1238 DEFINE_TRACE(DragController) { | 1241 DEFINE_TRACE(DragController) { |
| 1239 visitor->trace(m_page); | 1242 visitor->trace(m_page); |
| 1240 visitor->trace(m_documentUnderMouse); | 1243 visitor->trace(m_documentUnderMouse); |
| 1241 visitor->trace(m_dragInitiator); | 1244 visitor->trace(m_dragInitiator); |
| 1242 visitor->trace(m_dragState); | 1245 visitor->trace(m_dragState); |
| 1243 visitor->trace(m_fileInputElementUnderMouse); | 1246 visitor->trace(m_fileInputElementUnderMouse); |
| 1244 } | 1247 } |
| 1245 | 1248 |
| 1246 } // namespace blink | 1249 } // namespace blink |
| OLD | NEW |