| 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 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 return dragOperation(dragData); | 456 return dragOperation(dragData); |
| 457 } | 457 } |
| 458 | 458 |
| 459 // Returns true if node at |point| is editable with populating |dragCaret| and | 459 // Returns true if node at |point| is editable with populating |dragCaret| and |
| 460 // |range|, otherwise returns false. | 460 // |range|, otherwise returns false. |
| 461 // TODO(yosin): We should return |VisibleSelection| rather than three values. | 461 // TODO(yosin): We should return |VisibleSelection| rather than three values. |
| 462 static bool setSelectionToDragCaret(LocalFrame* frame, | 462 static bool setSelectionToDragCaret(LocalFrame* frame, |
| 463 VisibleSelection& dragCaret, | 463 VisibleSelection& dragCaret, |
| 464 Range*& range, | 464 Range*& range, |
| 465 const IntPoint& point) { | 465 const IntPoint& point) { |
| 466 frame->selection().setSelection(dragCaret); | 466 frame->selection().setSelection(dragCaret.asSelection()); |
| 467 if (frame->selection() | 467 if (frame->selection() |
| 468 .computeVisibleSelectionInDOMTreeDeprecated() | 468 .computeVisibleSelectionInDOMTreeDeprecated() |
| 469 .isNone()) { | 469 .isNone()) { |
| 470 // TODO(editing-dev): The use of | 470 // TODO(editing-dev): The use of |
| 471 // updateStyleAndLayoutIgnorePendingStylesheets | 471 // updateStyleAndLayoutIgnorePendingStylesheets |
| 472 // needs to be audited. See http://crbug.com/590369 for more details. | 472 // needs to be audited. See http://crbug.com/590369 for more details. |
| 473 // |LocalFrame::positinForPoint()| requires clean layout. | 473 // |LocalFrame::positinForPoint()| requires clean layout. |
| 474 frame->document()->updateStyleAndLayoutIgnorePendingStylesheets(); | 474 frame->document()->updateStyleAndLayoutIgnorePendingStylesheets(); |
| 475 const PositionWithAffinity& position = frame->positionForPoint(point); | 475 const PositionWithAffinity& position = frame->positionForPoint(point); |
| 476 if (!position.isConnected()) | 476 if (!position.isConnected()) |
| (...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1255 | 1255 |
| 1256 DEFINE_TRACE(DragController) { | 1256 DEFINE_TRACE(DragController) { |
| 1257 visitor->trace(m_page); | 1257 visitor->trace(m_page); |
| 1258 visitor->trace(m_documentUnderMouse); | 1258 visitor->trace(m_documentUnderMouse); |
| 1259 visitor->trace(m_dragInitiator); | 1259 visitor->trace(m_dragInitiator); |
| 1260 visitor->trace(m_dragState); | 1260 visitor->trace(m_dragState); |
| 1261 visitor->trace(m_fileInputElementUnderMouse); | 1261 visitor->trace(m_fileInputElementUnderMouse); |
| 1262 } | 1262 } |
| 1263 | 1263 |
| 1264 } // namespace blink | 1264 } // namespace blink |
| OLD | NEW |