Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(379)

Side by Side Diff: third_party/WebKit/Source/core/input/EventHandler.cpp

Issue 2053213002: Don't suspend caret blinking on long press (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed unit test Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/input/KeyboardEventManager.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 835 matching lines...) Expand 10 before | Expand all | Expand 10 after
846 // We invalidate the click when exiting pan scrolling so that we don't i nadvertently navigate 846 // We invalidate the click when exiting pan scrolling so that we don't i nadvertently navigate
847 // away from the current page (e.g. the click was on a hyperlink). See < rdar://problem/6095023>. 847 // away from the current page (e.g. the click was on a hyperlink). See < rdar://problem/6095023>.
848 invalidateClick(); 848 invalidateClick();
849 return WebInputEventResult::HandledSuppressed; 849 return WebInputEventResult::HandledSuppressed;
850 } 850 }
851 #endif 851 #endif
852 852
853 m_clickCount = mouseEvent.clickCount(); 853 m_clickCount = mouseEvent.clickCount();
854 m_clickNode = mev.innerNode()->isTextNode() ? FlatTreeTraversal::parent(*me v.innerNode()) : mev.innerNode(); 854 m_clickNode = mev.innerNode()->isTextNode() ? FlatTreeTraversal::parent(*me v.innerNode()) : mev.innerNode();
855 855
856 m_frame->selection().setCaretBlinkingSuspended(true); 856 if (!mouseEvent.fromTouch())
857 m_frame->selection().setCaretBlinkingSuspended(true);
857 858
858 WebInputEventResult eventResult = updatePointerTargetAndDispatchEvents(Event TypeNames::mousedown, mev.innerNode(), m_clickCount, mev.event()); 859 WebInputEventResult eventResult = updatePointerTargetAndDispatchEvents(Event TypeNames::mousedown, mev.innerNode(), m_clickCount, mev.event());
859 860
860 if (eventResult == WebInputEventResult::NotHandled && m_frame->view()) { 861 if (eventResult == WebInputEventResult::NotHandled && m_frame->view()) {
861 FrameView* view = m_frame->view(); 862 FrameView* view = m_frame->view();
862 PaintLayer* layer = mev.innerNode()->layoutObject() ? mev.innerNode()->l ayoutObject()->enclosingLayer() : nullptr; 863 PaintLayer* layer = mev.innerNode()->layoutObject() ? mev.innerNode()->l ayoutObject()->enclosingLayer() : nullptr;
863 IntPoint p = view->rootFrameToContents(mouseEvent.position()); 864 IntPoint p = view->rootFrameToContents(mouseEvent.position());
864 if (layer && layer->getScrollableArea() && layer->getScrollableArea()->i sPointInResizeControl(p, ResizerForPointer)) { 865 if (layer && layer->getScrollableArea() && layer->getScrollableArea()->i sPointInResizeControl(p, ResizerForPointer)) {
865 m_scrollManager.setResizeScrollableArea(layer, p); 866 m_scrollManager.setResizeScrollableArea(layer, p);
866 return WebInputEventResult::HandledSystem; 867 return WebInputEventResult::HandledSystem;
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
1101 WebInputEventResult EventHandler::handleMouseReleaseEvent(const PlatformMouseEve nt& mouseEvent) 1102 WebInputEventResult EventHandler::handleMouseReleaseEvent(const PlatformMouseEve nt& mouseEvent)
1102 { 1103 {
1103 TRACE_EVENT0("blink", "EventHandler::handleMouseReleaseEvent"); 1104 TRACE_EVENT0("blink", "EventHandler::handleMouseReleaseEvent");
1104 1105
1105 // For 4th/5th button in the mouse since Chrome does not yet send 1106 // For 4th/5th button in the mouse since Chrome does not yet send
1106 // button value to Blink but in some cases it does send the event. 1107 // button value to Blink but in some cases it does send the event.
1107 // This check is needed to suppress such an event (crbug.com/574959) 1108 // This check is needed to suppress such an event (crbug.com/574959)
1108 if (mouseEvent.button() == NoButton) 1109 if (mouseEvent.button() == NoButton)
1109 return WebInputEventResult::HandledSuppressed; 1110 return WebInputEventResult::HandledSuppressed;
1110 1111
1111 m_frame->selection().setCaretBlinkingSuspended(false); 1112 if (!mouseEvent.fromTouch())
1113 m_frame->selection().setCaretBlinkingSuspended(false);
1112 1114
1113 OwnPtr<UserGestureIndicator> gestureIndicator; 1115 OwnPtr<UserGestureIndicator> gestureIndicator;
1114 1116
1115 if (m_frame->localFrameRoot()->eventHandler().m_lastMouseDownUserGestureToke n) 1117 if (m_frame->localFrameRoot()->eventHandler().m_lastMouseDownUserGestureToke n)
1116 gestureIndicator = adoptPtr(new UserGestureIndicator(m_frame->localFrame Root()->eventHandler().m_lastMouseDownUserGestureToken.release())); 1118 gestureIndicator = adoptPtr(new UserGestureIndicator(m_frame->localFrame Root()->eventHandler().m_lastMouseDownUserGestureToken.release()));
1117 else 1119 else
1118 gestureIndicator = adoptPtr(new UserGestureIndicator(DefinitelyProcessin gUserGesture)); 1120 gestureIndicator = adoptPtr(new UserGestureIndicator(DefinitelyProcessin gUserGesture));
1119 1121
1120 #if OS(WIN) 1122 #if OS(WIN)
1121 if (Page* page = m_frame->page()) 1123 if (Page* page = m_frame->page())
(...skipping 1701 matching lines...) Expand 10 before | Expand all | Expand 10 after
2823 2825
2824 FrameHost* EventHandler::frameHost() const 2826 FrameHost* EventHandler::frameHost() const
2825 { 2827 {
2826 if (!m_frame->page()) 2828 if (!m_frame->page())
2827 return nullptr; 2829 return nullptr;
2828 2830
2829 return &m_frame->page()->frameHost(); 2831 return &m_frame->page()->frameHost();
2830 } 2832 }
2831 2833
2832 } // namespace blink 2834 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/input/KeyboardEventManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698