| 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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 mouse_event_manager_->LastKnownMousePosition()); | 256 mouse_event_manager_->LastKnownMousePosition()); |
| 257 mouse_event_manager_->InvalidateClick(); | 257 mouse_event_manager_->InvalidateClick(); |
| 258 } | 258 } |
| 259 | 259 |
| 260 HitTestResult EventHandler::HitTestResultAtPoint( | 260 HitTestResult EventHandler::HitTestResultAtPoint( |
| 261 const LayoutPoint& point, | 261 const LayoutPoint& point, |
| 262 HitTestRequest::HitTestRequestType hit_type, | 262 HitTestRequest::HitTestRequestType hit_type, |
| 263 const LayoutSize& padding) { | 263 const LayoutSize& padding) { |
| 264 TRACE_EVENT0("blink", "EventHandler::hitTestResultAtPoint"); | 264 TRACE_EVENT0("blink", "EventHandler::hitTestResultAtPoint"); |
| 265 | 265 |
| 266 ASSERT((hit_type & HitTestRequest::kListBased) || padding.IsEmpty()); | 266 DCHECK((hit_type & HitTestRequest::kListBased) || padding.IsEmpty()); |
| 267 | 267 |
| 268 // We always send hitTestResultAtPoint to the main frame if we have one, | 268 // We always send hitTestResultAtPoint to the main frame if we have one, |
| 269 // otherwise we might hit areas that are obscured by higher frames. | 269 // otherwise we might hit areas that are obscured by higher frames. |
| 270 if (frame_->GetPage()) { | 270 if (frame_->GetPage()) { |
| 271 LocalFrame& main_frame = frame_->LocalFrameRoot(); | 271 LocalFrame& main_frame = frame_->LocalFrameRoot(); |
| 272 if (frame_ != &main_frame) { | 272 if (frame_ != &main_frame) { |
| 273 FrameView* frame_view = frame_->View(); | 273 FrameView* frame_view = frame_->View(); |
| 274 FrameView* main_view = main_frame.View(); | 274 FrameView* main_view = main_frame.View(); |
| 275 if (frame_view && main_view) { | 275 if (frame_view && main_view) { |
| 276 IntPoint main_frame_point = main_view->RootFrameToContents( | 276 IntPoint main_frame_point = main_view->RootFrameToContents( |
| (...skipping 956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1233 void EventHandler::ElementRemoved(EventTarget* target) { | 1233 void EventHandler::ElementRemoved(EventTarget* target) { |
| 1234 pointer_event_manager_->ElementRemoved(target); | 1234 pointer_event_manager_->ElementRemoved(target); |
| 1235 } | 1235 } |
| 1236 | 1236 |
| 1237 WebInputEventResult EventHandler::UpdatePointerTargetAndDispatchEvents( | 1237 WebInputEventResult EventHandler::UpdatePointerTargetAndDispatchEvents( |
| 1238 const AtomicString& mouse_event_type, | 1238 const AtomicString& mouse_event_type, |
| 1239 Node* target_node, | 1239 Node* target_node, |
| 1240 const String& canvas_region_id, | 1240 const String& canvas_region_id, |
| 1241 const WebMouseEvent& mouse_event, | 1241 const WebMouseEvent& mouse_event, |
| 1242 const Vector<WebMouseEvent>& coalesced_events) { | 1242 const Vector<WebMouseEvent>& coalesced_events) { |
| 1243 ASSERT(mouse_event_type == EventTypeNames::mousedown || | 1243 DCHECK(mouse_event_type == EventTypeNames::mousedown || |
| 1244 mouse_event_type == EventTypeNames::mousemove || | 1244 mouse_event_type == EventTypeNames::mousemove || |
| 1245 mouse_event_type == EventTypeNames::mouseup); | 1245 mouse_event_type == EventTypeNames::mouseup); |
| 1246 | 1246 |
| 1247 const auto& event_result = pointer_event_manager_->SendMousePointerEvent( | 1247 const auto& event_result = pointer_event_manager_->SendMousePointerEvent( |
| 1248 UpdateMouseEventTargetNode(target_node), canvas_region_id, | 1248 UpdateMouseEventTargetNode(target_node), canvas_region_id, |
| 1249 mouse_event_type, mouse_event, coalesced_events); | 1249 mouse_event_type, mouse_event, coalesced_events); |
| 1250 return event_result; | 1250 return event_result; |
| 1251 } | 1251 } |
| 1252 | 1252 |
| 1253 WebInputEventResult EventHandler::HandleWheelEvent( | 1253 WebInputEventResult EventHandler::HandleWheelEvent( |
| (...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2016 !mouse_event_manager_->GetDragState().drag_src_->isConnected()) | 2016 !mouse_event_manager_->GetDragState().drag_src_->isConnected()) |
| 2017 mouse_event_manager_->GetDragState().drag_src_ = root_editable_element; | 2017 mouse_event_manager_->GetDragState().drag_src_ = root_editable_element; |
| 2018 } | 2018 } |
| 2019 | 2019 |
| 2020 bool EventHandler::HandleTextInputEvent(const String& text, | 2020 bool EventHandler::HandleTextInputEvent(const String& text, |
| 2021 Event* underlying_event, | 2021 Event* underlying_event, |
| 2022 TextEventInputType input_type) { | 2022 TextEventInputType input_type) { |
| 2023 // Platforms should differentiate real commands like selectAll from text input | 2023 // Platforms should differentiate real commands like selectAll from text input |
| 2024 // in disguise (like insertNewline), and avoid dispatching text input events | 2024 // in disguise (like insertNewline), and avoid dispatching text input events |
| 2025 // from keydown default handlers. | 2025 // from keydown default handlers. |
| 2026 ASSERT(!underlying_event || !underlying_event->IsKeyboardEvent() || | 2026 DCHECK(!underlying_event || !underlying_event->IsKeyboardEvent() || |
| 2027 ToKeyboardEvent(underlying_event)->type() == EventTypeNames::keypress); | 2027 ToKeyboardEvent(underlying_event)->type() == EventTypeNames::keypress); |
| 2028 | 2028 |
| 2029 if (!frame_) | 2029 if (!frame_) |
| 2030 return false; | 2030 return false; |
| 2031 | 2031 |
| 2032 EventTarget* target; | 2032 EventTarget* target; |
| 2033 if (underlying_event) | 2033 if (underlying_event) |
| 2034 target = underlying_event->target(); | 2034 target = underlying_event->target(); |
| 2035 else | 2035 else |
| 2036 target = EventTargetNodeForDocument(frame_->GetDocument()); | 2036 target = EventTargetNodeForDocument(frame_->GetDocument()); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2119 MouseEventWithHitTestResults& mev, | 2119 MouseEventWithHitTestResults& mev, |
| 2120 LocalFrame* subframe) { | 2120 LocalFrame* subframe) { |
| 2121 WebInputEventResult result = | 2121 WebInputEventResult result = |
| 2122 subframe->GetEventHandler().HandleMouseReleaseEvent(mev.Event()); | 2122 subframe->GetEventHandler().HandleMouseReleaseEvent(mev.Event()); |
| 2123 if (result != WebInputEventResult::kNotHandled) | 2123 if (result != WebInputEventResult::kNotHandled) |
| 2124 return result; | 2124 return result; |
| 2125 return WebInputEventResult::kHandledSystem; | 2125 return WebInputEventResult::kHandledSystem; |
| 2126 } | 2126 } |
| 2127 | 2127 |
| 2128 } // namespace blink | 2128 } // namespace blink |
| OLD | NEW |