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

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

Issue 2871703003: Clear the state of scroll and selection onmouseup (Closed)
Patch Set: Update the test Created 3 years, 7 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/EventHandlerTest.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 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) 5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies)
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 985 matching lines...) Expand 10 before | Expand all | Expand 10 after
996 EventTypeNames::mouseup, mev.InnerNode(), mev.CanvasRegionId(), 996 EventTypeNames::mouseup, mev.InnerNode(), mev.CanvasRegionId(),
997 mev.Event(), Vector<WebMouseEvent>()); 997 mev.Event(), Vector<WebMouseEvent>());
998 998
999 WebInputEventResult click_event_result = 999 WebInputEventResult click_event_result =
1000 mouse_release_target ? mouse_event_manager_->DispatchMouseClickIfNeeded( 1000 mouse_release_target ? mouse_event_manager_->DispatchMouseClickIfNeeded(
1001 mev, *mouse_release_target) 1001 mev, *mouse_release_target)
1002 : WebInputEventResult::kNotHandled; 1002 : WebInputEventResult::kNotHandled;
1003 1003
1004 scroll_manager_->ClearResizeScrollableArea(false); 1004 scroll_manager_->ClearResizeScrollableArea(false);
1005 1005
1006 if (event_result == WebInputEventResult::kNotHandled) 1006 WebInputEventResult selection_scroll_event_result =
1007 event_result = mouse_event_manager_->HandleMouseReleaseEvent(mev); 1007 mouse_event_manager_->HandleMouseReleaseEvent(mev);
dtapuska 2017/05/08 18:54:07 What about preventing the paste on middle click re
1008 mouse_event_manager_->ClearDragHeuristicState(); 1008 mouse_event_manager_->ClearDragHeuristicState();
1009 1009
1010 mouse_event_manager_->InvalidateClick(); 1010 mouse_event_manager_->InvalidateClick();
1011 1011
1012 return EventHandlingUtil::MergeEventResult(click_event_result, event_result); 1012 return EventHandlingUtil::MergeEventResult(
1013 EventHandlingUtil::MergeEventResult(click_event_result, event_result),
1014 selection_scroll_event_result);
1013 } 1015 }
1014 1016
1015 static bool TargetIsFrame(Node* target, LocalFrame*& frame) { 1017 static bool TargetIsFrame(Node* target, LocalFrame*& frame) {
1016 if (!IsHTMLFrameElementBase(target)) 1018 if (!IsHTMLFrameElementBase(target))
1017 return false; 1019 return false;
1018 1020
1019 // Cross-process drag and drop is not yet supported. 1021 // Cross-process drag and drop is not yet supported.
1020 if (ToHTMLFrameElementBase(target)->ContentFrame() && 1022 if (ToHTMLFrameElementBase(target)->ContentFrame() &&
1021 !ToHTMLFrameElementBase(target)->ContentFrame()->IsLocalFrame()) 1023 !ToHTMLFrameElementBase(target)->ContentFrame()->IsLocalFrame())
1022 return false; 1024 return false;
(...skipping 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after
2117 MouseEventWithHitTestResults& mev, 2119 MouseEventWithHitTestResults& mev,
2118 LocalFrame* subframe) { 2120 LocalFrame* subframe) {
2119 WebInputEventResult result = 2121 WebInputEventResult result =
2120 subframe->GetEventHandler().HandleMouseReleaseEvent(mev.Event()); 2122 subframe->GetEventHandler().HandleMouseReleaseEvent(mev.Event());
2121 if (result != WebInputEventResult::kNotHandled) 2123 if (result != WebInputEventResult::kNotHandled)
2122 return result; 2124 return result;
2123 return WebInputEventResult::kHandledSystem; 2125 return WebInputEventResult::kHandledSystem;
2124 } 2126 }
2125 2127
2126 } // namespace blink 2128 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/input/EventHandlerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698