| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 #include "core/page/AutoscrollController.h" | 77 #include "core/page/AutoscrollController.h" |
| 78 #include "core/page/ChromeClient.h" | 78 #include "core/page/ChromeClient.h" |
| 79 #include "core/page/DragController.h" | 79 #include "core/page/DragController.h" |
| 80 #include "core/page/DragState.h" | 80 #include "core/page/DragState.h" |
| 81 #include "core/page/FocusController.h" | 81 #include "core/page/FocusController.h" |
| 82 #include "core/page/FrameTree.h" | 82 #include "core/page/FrameTree.h" |
| 83 #include "core/page/Page.h" | 83 #include "core/page/Page.h" |
| 84 #include "core/page/SpatialNavigation.h" | 84 #include "core/page/SpatialNavigation.h" |
| 85 #include "core/page/TouchAdjustment.h" | 85 #include "core/page/TouchAdjustment.h" |
| 86 #include "core/page/scrolling/OverscrollController.h" | 86 #include "core/page/scrolling/OverscrollController.h" |
| 87 #include "core/page/scrolling/RootScroller.h" |
| 87 #include "core/page/scrolling/ScrollState.h" | 88 #include "core/page/scrolling/ScrollState.h" |
| 88 #include "core/paint/PaintLayer.h" | 89 #include "core/paint/PaintLayer.h" |
| 89 #include "core/style/ComputedStyle.h" | 90 #include "core/style/ComputedStyle.h" |
| 90 #include "core/svg/SVGDocumentExtensions.h" | 91 #include "core/svg/SVGDocumentExtensions.h" |
| 91 #include "platform/PlatformGestureEvent.h" | 92 #include "platform/PlatformGestureEvent.h" |
| 92 #include "platform/PlatformKeyboardEvent.h" | 93 #include "platform/PlatformKeyboardEvent.h" |
| 93 #include "platform/PlatformTouchEvent.h" | 94 #include "platform/PlatformTouchEvent.h" |
| 94 #include "platform/PlatformWheelEvent.h" | 95 #include "platform/PlatformWheelEvent.h" |
| 95 #include "platform/RuntimeEnabledFeatures.h" | 96 #include "platform/RuntimeEnabledFeatures.h" |
| 96 #include "platform/TraceEvent.h" | 97 #include "platform/TraceEvent.h" |
| (...skipping 2325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2422 if (m_frame->isMainFrame()) | 2423 if (m_frame->isMainFrame()) |
| 2423 m_frame->host()->topControls().scrollBegin(); | 2424 m_frame->host()->topControls().scrollBegin(); |
| 2424 } | 2425 } |
| 2425 return WebInputEventResult::HandledSystem; | 2426 return WebInputEventResult::HandledSystem; |
| 2426 } | 2427 } |
| 2427 | 2428 |
| 2428 bool EventHandler::isRootScroller(const Node& node) const | 2429 bool EventHandler::isRootScroller(const Node& node) const |
| 2429 { | 2430 { |
| 2430 // The root scroller is the one Element on the page designated to perform | 2431 // The root scroller is the one Element on the page designated to perform |
| 2431 // "viewport actions" like top controls movement and overscroll glow. | 2432 // "viewport actions" like top controls movement and overscroll glow. |
| 2432 | 2433 if (!frameHost() || !frameHost()->rootScroller()) |
| 2433 if (!node.isElementNode() || node.document().ownerElement()) | |
| 2434 return false; | 2434 return false; |
| 2435 | 2435 |
| 2436 return node.document().rootScroller() == toElement(&node); | 2436 return frameHost()->rootScroller()->get() == &node; |
| 2437 } | 2437 } |
| 2438 | 2438 |
| 2439 WebInputEventResult EventHandler::handleGestureScrollUpdate(const PlatformGestur
eEvent& gestureEvent) | 2439 WebInputEventResult EventHandler::handleGestureScrollUpdate(const PlatformGestur
eEvent& gestureEvent) |
| 2440 { | 2440 { |
| 2441 ASSERT(gestureEvent.type() == PlatformEvent::GestureScrollUpdate); | 2441 ASSERT(gestureEvent.type() == PlatformEvent::GestureScrollUpdate); |
| 2442 | 2442 |
| 2443 // Negate the deltas since the gesture event stores finger movement and | 2443 // Negate the deltas since the gesture event stores finger movement and |
| 2444 // scrolling occurs in the direction opposite the finger's movement | 2444 // scrolling occurs in the direction opposite the finger's movement |
| 2445 // direction. e.g. Finger moving up has negative event delta but causes the | 2445 // direction. e.g. Finger moving up has negative event delta but causes the |
| 2446 // page to scroll down causing positive scroll delta. | 2446 // page to scroll down causing positive scroll delta. |
| (...skipping 1252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3699 | 3699 |
| 3700 PlatformEvent::Modifiers EventHandler::accessKeyModifiers() | 3700 PlatformEvent::Modifiers EventHandler::accessKeyModifiers() |
| 3701 { | 3701 { |
| 3702 #if OS(MACOSX) | 3702 #if OS(MACOSX) |
| 3703 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo
rmEvent::AltKey); | 3703 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo
rmEvent::AltKey); |
| 3704 #else | 3704 #else |
| 3705 return PlatformEvent::AltKey; | 3705 return PlatformEvent::AltKey; |
| 3706 #endif | 3706 #endif |
| 3707 } | 3707 } |
| 3708 | 3708 |
| 3709 FrameHost* EventHandler::frameHost() | 3709 FrameHost* EventHandler::frameHost() const |
| 3710 { | 3710 { |
| 3711 if (!m_frame->page()) | 3711 if (!m_frame->page()) |
| 3712 return nullptr; | 3712 return nullptr; |
| 3713 | 3713 |
| 3714 return &m_frame->page()->frameHost(); | 3714 return &m_frame->page()->frameHost(); |
| 3715 } | 3715 } |
| 3716 | 3716 |
| 3717 } // namespace blink | 3717 } // namespace blink |
| OLD | NEW |