| 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 2482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2493 } | 2493 } |
| 2494 | 2494 |
| 2495 bool EventHandler::isRootScroller(const Node& node) const | 2495 bool EventHandler::isRootScroller(const Node& node) const |
| 2496 { | 2496 { |
| 2497 // The root scroller is the one Element on the page designated to perform | 2497 // The root scroller is the one Element on the page designated to perform |
| 2498 // "viewport actions" like top controls movement and overscroll glow. | 2498 // "viewport actions" like top controls movement and overscroll glow. |
| 2499 | 2499 |
| 2500 if (!node.isElementNode() || node.document().ownerElement()) | 2500 if (!node.isElementNode() || node.document().ownerElement()) |
| 2501 return false; | 2501 return false; |
| 2502 | 2502 |
| 2503 Element* scrollingElement = node.document().scrollingElement(); | 2503 return node.document().rootScroller() == toElement(&node); |
| 2504 return scrollingElement | |
| 2505 ? toElement(&node) == node.document().scrollingElement() | |
| 2506 : toElement(&node) == node.document().documentElement(); | |
| 2507 } | 2504 } |
| 2508 | 2505 |
| 2509 WebInputEventResult EventHandler::handleGestureScrollUpdate(const PlatformGestur
eEvent& gestureEvent) | 2506 WebInputEventResult EventHandler::handleGestureScrollUpdate(const PlatformGestur
eEvent& gestureEvent) |
| 2510 { | 2507 { |
| 2511 ASSERT(gestureEvent.type() == PlatformEvent::GestureScrollUpdate); | 2508 ASSERT(gestureEvent.type() == PlatformEvent::GestureScrollUpdate); |
| 2512 | 2509 |
| 2513 // Negate the deltas since the gesture event stores finger movement and | 2510 // Negate the deltas since the gesture event stores finger movement and |
| 2514 // scrolling occurs in the direction opposite the finger's movement | 2511 // scrolling occurs in the direction opposite the finger's movement |
| 2515 // direction. e.g. Finger moving up has negative event delta but causes the | 2512 // direction. e.g. Finger moving up has negative event delta but causes the |
| 2516 // page to scroll down causing positive scroll delta. | 2513 // page to scroll down causing positive scroll delta. |
| (...skipping 1626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4143 | 4140 |
| 4144 FrameHost* EventHandler::frameHost() | 4141 FrameHost* EventHandler::frameHost() |
| 4145 { | 4142 { |
| 4146 if (!m_frame->page()) | 4143 if (!m_frame->page()) |
| 4147 return nullptr; | 4144 return nullptr; |
| 4148 | 4145 |
| 4149 return &m_frame->page()->frameHost(); | 4146 return &m_frame->page()->frameHost(); |
| 4150 } | 4147 } |
| 4151 | 4148 |
| 4152 } // namespace blink | 4149 } // namespace blink |
| OLD | NEW |