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 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
553 else | 553 else |
554 newSelection = VisibleSelection(start, pos); | 554 newSelection = VisibleSelection(start, pos); |
555 } | 555 } |
556 } else | 556 } else |
557 newSelection.setExtent(pos); | 557 newSelection.setExtent(pos); |
558 | 558 |
559 if (m_frame->selection().granularity() != CharacterGranularity) { | 559 if (m_frame->selection().granularity() != CharacterGranularity) { |
560 granularity = m_frame->selection().granularity(); | 560 granularity = m_frame->selection().granularity(); |
561 newSelection.expandUsingGranularity(m_frame->selection().granularity ()); | 561 newSelection.expandUsingGranularity(m_frame->selection().granularity ()); |
562 } | 562 } |
563 } else { | 563 } else if (m_selectionInitiationState != ExtendedSelection) { |
Donn Denman
2014/12/09 00:59:37
This line causes a problem for Contextual Search (
| |
564 newSelection = expandSelectionToRespectUserSelectAll(innerNode, VisibleS election(visiblePos)); | 564 newSelection = expandSelectionToRespectUserSelectAll(innerNode, VisibleS election(visiblePos)); |
565 } | 565 } |
566 | 566 |
567 // Updating the selection is considered side-effect of the event and so it d oesn't impact the handled state. | 567 // Updating the selection is considered side-effect of the event and so it d oesn't impact the handled state. |
568 updateSelectionForMouseDownDispatchingSelectStart(innerNode, newSelection, g ranularity); | 568 updateSelectionForMouseDownDispatchingSelectStart(innerNode, newSelection, g ranularity); |
569 return false; | 569 return false; |
570 } | 570 } |
571 | 571 |
572 static inline bool canMouseDownStartSelect(Node* node) | 572 static inline bool canMouseDownStartSelect(Node* node) |
573 { | 573 { |
(...skipping 2405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2979 void EventHandler::notifyElementActivated() | 2979 void EventHandler::notifyElementActivated() |
2980 { | 2980 { |
2981 // Since another element has been set to active, stop current timer and clea r reference. | 2981 // Since another element has been set to active, stop current timer and clea r reference. |
2982 if (m_activeIntervalTimer.isActive()) | 2982 if (m_activeIntervalTimer.isActive()) |
2983 m_activeIntervalTimer.stop(); | 2983 m_activeIntervalTimer.stop(); |
2984 m_lastDeferredTapElement = nullptr; | 2984 m_lastDeferredTapElement = nullptr; |
2985 } | 2985 } |
2986 | 2986 |
2987 void EventHandler::notifySelectionChanged() | 2987 void EventHandler::notifySelectionChanged() |
2988 { | 2988 { |
2989 m_selectionInitiationState = ExtendedSelection; | 2989 if (m_frame->selection().isRange()) |
2990 m_selectionInitiationState = ExtendedSelection; | |
2990 } | 2991 } |
2991 | 2992 |
2992 bool EventHandler::handleAccessKey(const PlatformKeyboardEvent& evt) | 2993 bool EventHandler::handleAccessKey(const PlatformKeyboardEvent& evt) |
2993 { | 2994 { |
2994 // FIXME: Ignoring the state of Shift key is what neither IE nor Firefox do. | 2995 // FIXME: Ignoring the state of Shift key is what neither IE nor Firefox do. |
2995 // IE matches lower and upper case access keys regardless of Shift key state - but if both upper and | 2996 // IE matches lower and upper case access keys regardless of Shift key state - but if both upper and |
2996 // lower case variants are present in a document, the correct element is mat ched based on Shift key state. | 2997 // lower case variants are present in a document, the correct element is mat ched based on Shift key state. |
2997 // Firefox only matches an access key if Shift is not pressed, and does that case-insensitively. | 2998 // Firefox only matches an access key if Shift is not pressed, and does that case-insensitively. |
2998 ASSERT(!(accessKeyModifiers() & PlatformEvent::ShiftKey)); | 2999 ASSERT(!(accessKeyModifiers() & PlatformEvent::ShiftKey)); |
2999 if ((evt.modifiers() & ~PlatformEvent::ShiftKey) != accessKeyModifiers()) | 3000 if ((evt.modifiers() & ~PlatformEvent::ShiftKey) != accessKeyModifiers()) |
(...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3863 unsigned EventHandler::accessKeyModifiers() | 3864 unsigned EventHandler::accessKeyModifiers() |
3864 { | 3865 { |
3865 #if OS(MACOSX) | 3866 #if OS(MACOSX) |
3866 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; | 3867 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; |
3867 #else | 3868 #else |
3868 return PlatformEvent::AltKey; | 3869 return PlatformEvent::AltKey; |
3869 #endif | 3870 #endif |
3870 } | 3871 } |
3871 | 3872 |
3872 } // namespace blink | 3873 } // namespace blink |
OLD | NEW |