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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 const VisiblePositionInFlatTree& pos = visiblePositionOfHitTestResult(adjust
edHitTestResult); | 311 const VisiblePositionInFlatTree& pos = visiblePositionOfHitTestResult(adjust
edHitTestResult); |
312 if (pos.isNotNull()) { | 312 if (pos.isNotNull()) { |
313 newSelection = VisibleSelectionInFlatTree(pos); | 313 newSelection = VisibleSelectionInFlatTree(pos); |
314 newSelection.expandUsingGranularity(WordGranularity); | 314 newSelection.expandUsingGranularity(WordGranularity); |
315 } | 315 } |
316 | 316 |
317 if (selectInputEventType == SelectInputEventType::Touch) { | 317 if (selectInputEventType == SelectInputEventType::Touch) { |
318 // If node doesn't have text except space, tab or line break, do not | 318 // If node doesn't have text except space, tab or line break, do not |
319 // select that 'empty' area. | 319 // select that 'empty' area. |
320 EphemeralRangeInFlatTree range(newSelection.start(), newSelection.end())
; | 320 EphemeralRangeInFlatTree range(newSelection.start(), newSelection.end())
; |
321 const String& str = plainText(range, TextIteratorEmitsObjectReplacementC
haracter); | 321 const String& str = plainText(range, innerNode->hasEditableStyle() ? Tex
tIteratorEmitsObjectReplacementCharacter : TextIteratorDefaultBehavior); |
322 if (str.isEmpty() || str.simplifyWhiteSpace().containsOnlyWhitespace()) | 322 if (str.isEmpty() || str.simplifyWhiteSpace().containsOnlyWhitespace()) |
323 return; | 323 return; |
324 | 324 |
325 if (newSelection.rootEditableElement() && pos.deepEquivalent() == Visibl
ePositionInFlatTree::lastPositionInNode(newSelection.rootEditableElement()).deep
Equivalent()) | 325 if (newSelection.rootEditableElement() && pos.deepEquivalent() == Visibl
ePositionInFlatTree::lastPositionInNode(newSelection.rootEditableElement()).deep
Equivalent()) |
326 return; | 326 return; |
327 } | 327 } |
328 | 328 |
329 if (appendTrailingWhitespace == AppendTrailingWhitespace::ShouldAppend && ne
wSelection.isRange()) | 329 if (appendTrailingWhitespace == AppendTrailingWhitespace::ShouldAppend && ne
wSelection.isRange()) |
330 newSelection.appendTrailingWhitespace(); | 330 newSelection.appendTrailingWhitespace(); |
331 | 331 |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 { | 664 { |
665 return m_frame->selection(); | 665 return m_frame->selection(); |
666 } | 666 } |
667 | 667 |
668 bool isLinkSelection(const MouseEventWithHitTestResults& event) | 668 bool isLinkSelection(const MouseEventWithHitTestResults& event) |
669 { | 669 { |
670 return event.event().altKey() && event.isOverLink(); | 670 return event.event().altKey() && event.isOverLink(); |
671 } | 671 } |
672 | 672 |
673 } // namespace blink | 673 } // namespace blink |
OLD | NEW |