OLD | NEW |
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 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 | 588 |
589 // For 4th/5th button in the mouse since Chrome does not yet send | 589 // For 4th/5th button in the mouse since Chrome does not yet send |
590 // button value to Blink but in some cases it does send the event. | 590 // button value to Blink but in some cases it does send the event. |
591 // This check is needed to suppress such an event (crbug.com/574959) | 591 // This check is needed to suppress such an event (crbug.com/574959) |
592 if (mouse_event.button == WebPointerProperties::Button::kNoButton) | 592 if (mouse_event.button == WebPointerProperties::Button::kNoButton) |
593 return WebInputEventResult::kHandledSuppressed; | 593 return WebInputEventResult::kHandledSuppressed; |
594 | 594 |
595 if (event_handler_will_reset_capturing_mouse_events_node_) | 595 if (event_handler_will_reset_capturing_mouse_events_node_) |
596 capturing_mouse_events_node_ = nullptr; | 596 capturing_mouse_events_node_ = nullptr; |
597 mouse_event_manager_->HandleMousePressEventUpdateStates(mouse_event); | 597 mouse_event_manager_->HandleMousePressEventUpdateStates(mouse_event); |
598 GetSelectionController().SetMouseDownMayStartSelect(false); | |
599 if (!frame_->View()) | 598 if (!frame_->View()) |
600 return WebInputEventResult::kNotHandled; | 599 return WebInputEventResult::kNotHandled; |
601 | 600 |
602 HitTestRequest request(HitTestRequest::kActive); | 601 HitTestRequest request(HitTestRequest::kActive); |
603 // Save the document point we generate in case the window coordinate is | 602 // Save the document point we generate in case the window coordinate is |
604 // invalidated by what happens when we dispatch the event. | 603 // invalidated by what happens when we dispatch the event. |
605 LayoutPoint document_point = frame_->View()->RootFrameToContents( | 604 LayoutPoint document_point = frame_->View()->RootFrameToContents( |
606 FlooredIntPoint(mouse_event.PositionInRootFrame())); | 605 FlooredIntPoint(mouse_event.PositionInRootFrame())); |
607 MouseEventWithHitTestResults mev = | 606 MouseEventWithHitTestResults mev = |
608 frame_->GetDocument()->PerformMouseEventHitTest(request, document_point, | 607 frame_->GetDocument()->PerformMouseEventHitTest(request, document_point, |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
998 | 997 |
999 WebInputEventResult click_event_result = | 998 WebInputEventResult click_event_result = |
1000 mouse_release_target ? mouse_event_manager_->DispatchMouseClickIfNeeded( | 999 mouse_release_target ? mouse_event_manager_->DispatchMouseClickIfNeeded( |
1001 mev, *mouse_release_target) | 1000 mev, *mouse_release_target) |
1002 : WebInputEventResult::kNotHandled; | 1001 : WebInputEventResult::kNotHandled; |
1003 | 1002 |
1004 scroll_manager_->ClearResizeScrollableArea(false); | 1003 scroll_manager_->ClearResizeScrollableArea(false); |
1005 | 1004 |
1006 if (event_result == WebInputEventResult::kNotHandled) | 1005 if (event_result == WebInputEventResult::kNotHandled) |
1007 event_result = mouse_event_manager_->HandleMouseReleaseEvent(mev); | 1006 event_result = mouse_event_manager_->HandleMouseReleaseEvent(mev); |
1008 mouse_event_manager_->ClearDragHeuristicState(); | |
1009 | 1007 |
1010 mouse_event_manager_->InvalidateClick(); | 1008 mouse_event_manager_->HandleMouseReleaseEventUpdateStates(); |
1011 | 1009 |
1012 return EventHandlingUtil::MergeEventResult(click_event_result, event_result); | 1010 return EventHandlingUtil::MergeEventResult(click_event_result, event_result); |
1013 } | 1011 } |
1014 | 1012 |
1015 static bool TargetIsFrame(Node* target, LocalFrame*& frame) { | 1013 static bool TargetIsFrame(Node* target, LocalFrame*& frame) { |
1016 if (!IsHTMLFrameElementBase(target)) | 1014 if (!IsHTMLFrameElementBase(target)) |
1017 return false; | 1015 return false; |
1018 | 1016 |
1019 // Cross-process drag and drop is not yet supported. | 1017 // Cross-process drag and drop is not yet supported. |
1020 if (ToHTMLFrameElementBase(target)->ContentFrame() && | 1018 if (ToHTMLFrameElementBase(target)->ContentFrame() && |
(...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2117 MouseEventWithHitTestResults& mev, | 2115 MouseEventWithHitTestResults& mev, |
2118 LocalFrame* subframe) { | 2116 LocalFrame* subframe) { |
2119 WebInputEventResult result = | 2117 WebInputEventResult result = |
2120 subframe->GetEventHandler().HandleMouseReleaseEvent(mev.Event()); | 2118 subframe->GetEventHandler().HandleMouseReleaseEvent(mev.Event()); |
2121 if (result != WebInputEventResult::kNotHandled) | 2119 if (result != WebInputEventResult::kNotHandled) |
2122 return result; | 2120 return result; |
2123 return WebInputEventResult::kHandledSystem; | 2121 return WebInputEventResult::kHandledSystem; |
2124 } | 2122 } |
2125 | 2123 |
2126 } // namespace blink | 2124 } // namespace blink |
OLD | NEW |