| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. |
| 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) | 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) |
| 5 * Copyright (C) 2015 Google Inc. All rights reserved. | 5 * Copyright (C) 2015 Google Inc. All rights reserved. |
| 6 * | 6 * |
| 7 * Redistribution and use in source and binary forms, with or without | 7 * Redistribution and use in source and binary forms, with or without |
| 8 * modification, are permitted provided that the following conditions | 8 * modification, are permitted provided that the following conditions |
| 9 * are met: | 9 * are met: |
| 10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 if (pos.isNotNull()) { | 233 if (pos.isNotNull()) { |
| 234 newSelection = VisibleSelection(pos); | 234 newSelection = VisibleSelection(pos); |
| 235 newSelection.expandUsingGranularity(ParagraphGranularity); | 235 newSelection.expandUsingGranularity(ParagraphGranularity); |
| 236 } | 236 } |
| 237 | 237 |
| 238 return updateSelectionForMouseDownDispatchingSelectStart(innerNode, expandSe
lectionToRespectUserSelectAll(innerNode, newSelection), ParagraphGranularity); | 238 return updateSelectionForMouseDownDispatchingSelectStart(innerNode, expandSe
lectionToRespectUserSelectAll(innerNode, newSelection), ParagraphGranularity); |
| 239 } | 239 } |
| 240 | 240 |
| 241 static int textDistance(const Position& start, const Position& end) | 241 static int textDistance(const Position& start, const Position& end) |
| 242 { | 242 { |
| 243 RefPtrWillBeRawPtr<Range> range = Range::create(*start.document(), start, en
d); | 243 return TextIterator::rangeLength(start, end, true); |
| 244 return TextIterator::rangeLength(range->startPosition(), range->endPosition(
), true); | |
| 245 } | 244 } |
| 246 | 245 |
| 247 bool SelectionController::handleMousePressEventSingleClick(const MouseEventWithH
itTestResults& event) | 246 bool SelectionController::handleMousePressEventSingleClick(const MouseEventWithH
itTestResults& event) |
| 248 { | 247 { |
| 249 TRACE_EVENT0("blink", "SelectionController::handleMousePressEventSingleClick
"); | 248 TRACE_EVENT0("blink", "SelectionController::handleMousePressEventSingleClick
"); |
| 250 | 249 |
| 251 m_frame->document()->updateLayoutIgnorePendingStylesheets(); | 250 m_frame->document()->updateLayoutIgnorePendingStylesheets(); |
| 252 Node* innerNode = event.innerNode(); | 251 Node* innerNode = event.innerNode(); |
| 253 if (!(innerNode && innerNode->layoutObject() && m_mouseDownMayStartSelect)) | 252 if (!(innerNode && innerNode->layoutObject() && m_mouseDownMayStartSelect)) |
| 254 return false; | 253 return false; |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 { | 564 { |
| 566 return m_mouseDownMayStartSelect; | 565 return m_mouseDownMayStartSelect; |
| 567 } | 566 } |
| 568 | 567 |
| 569 bool SelectionController::mouseDownWasSingleClickInSelection() const | 568 bool SelectionController::mouseDownWasSingleClickInSelection() const |
| 570 { | 569 { |
| 571 return m_mouseDownWasSingleClickInSelection; | 570 return m_mouseDownWasSingleClickInSelection; |
| 572 } | 571 } |
| 573 | 572 |
| 574 } // namespace blink | 573 } // namespace blink |
| OLD | NEW |