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 2551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2562 } else { | 2562 } else { |
2563 if (m_frame->isMainFrame()) | 2563 if (m_frame->isMainFrame()) |
2564 m_frame->host()->topControls().scrollBegin(); | 2564 m_frame->host()->topControls().scrollBegin(); |
2565 } | 2565 } |
2566 return true; | 2566 return true; |
2567 } | 2567 } |
2568 | 2568 |
2569 bool EventHandler::handleGestureScrollUpdate(const PlatformGestureEvent& gesture
Event) | 2569 bool EventHandler::handleGestureScrollUpdate(const PlatformGestureEvent& gesture
Event) |
2570 { | 2570 { |
2571 ASSERT(gestureEvent.type() == PlatformEvent::GestureScrollUpdate); | 2571 ASSERT(gestureEvent.type() == PlatformEvent::GestureScrollUpdate); |
2572 | 2572 bool ignoreX = gestureEvent.railsMode() == PlatformEvent::RailsModeVertical; |
2573 FloatSize delta(gestureEvent.deltaX(), gestureEvent.deltaY()); | 2573 bool ignoreY = gestureEvent.railsMode() == PlatformEvent::RailsModeHorizonta
l; |
| 2574 FloatSize delta(ignoreX ? 0 : gestureEvent.deltaX(), |
| 2575 ignoreY ? 0 : gestureEvent.deltaY()); |
| 2576 FloatSize velocity(ignoreX ? 0 : gestureEvent.velocityX(), |
| 2577 ignoreY ? 0 : gestureEvent.velocityY()); |
2574 if (delta.isZero()) | 2578 if (delta.isZero()) |
2575 return false; | 2579 return false; |
2576 | 2580 |
2577 Node* node = m_scrollGestureHandlingNode.get(); | 2581 Node* node = m_scrollGestureHandlingNode.get(); |
2578 if (node) { | 2582 if (node) { |
2579 LayoutObject* renderer = node->layoutObject(); | 2583 LayoutObject* renderer = node->layoutObject(); |
2580 if (!renderer) | 2584 if (!renderer) |
2581 return false; | 2585 return false; |
2582 | 2586 |
2583 RefPtrWillBeRawPtr<FrameView> protector(m_frame->view()); | 2587 RefPtrWillBeRawPtr<FrameView> protector(m_frame->view()); |
(...skipping 10 matching lines...) Expand all Loading... |
2594 } | 2598 } |
2595 // FIXME: we should allow simultaneous scrolling of nested | 2599 // FIXME: we should allow simultaneous scrolling of nested |
2596 // iframes along perpendicular axes. See crbug.com/466991. | 2600 // iframes along perpendicular axes. See crbug.com/466991. |
2597 m_deltaConsumedForScrollSequence = true; | 2601 m_deltaConsumedForScrollSequence = true; |
2598 return true; | 2602 return true; |
2599 } | 2603 } |
2600 | 2604 |
2601 bool scrolled = false; | 2605 bool scrolled = false; |
2602 if (RuntimeEnabledFeatures::scrollCustomizationEnabled()) { | 2606 if (RuntimeEnabledFeatures::scrollCustomizationEnabled()) { |
2603 RefPtrWillBeRawPtr<ScrollState> scrollState = ScrollState::create( | 2607 RefPtrWillBeRawPtr<ScrollState> scrollState = ScrollState::create( |
2604 gestureEvent.deltaX(), gestureEvent.deltaY(), | 2608 delta.width(), delta.height(), |
2605 0, gestureEvent.velocityX(), gestureEvent.velocityY(), | 2609 0, velocity.width(), velocity.height(), |
2606 gestureEvent.inertial(), /* isBeginning */ | 2610 gestureEvent.inertial(), /* isBeginning */ |
2607 false, /* isEnding */ false, /* fromUserInput */ true, | 2611 false, /* isEnding */ false, /* fromUserInput */ true, |
2608 !gestureEvent.preventPropagation(), m_deltaConsumedForScrollSequ
ence); | 2612 !gestureEvent.preventPropagation(), m_deltaConsumedForScrollSequ
ence); |
2609 if (m_previousGestureScrolledNode) { | 2613 if (m_previousGestureScrolledNode) { |
2610 // The ScrollState needs to know what the current | 2614 // The ScrollState needs to know what the current |
2611 // native scrolling element is, so that for an | 2615 // native scrolling element is, so that for an |
2612 // inertial scroll that shouldn't propagate, only the | 2616 // inertial scroll that shouldn't propagate, only the |
2613 // currently scrolling element responds. | 2617 // currently scrolling element responds. |
2614 ASSERT(m_previousGestureScrolledNode->isElementNode()); | 2618 ASSERT(m_previousGestureScrolledNode->isElementNode()); |
2615 scrollState->setCurrentNativeScrollingElement(toElement(m_previo
usGestureScrolledNode.get())); | 2619 scrollState->setCurrentNativeScrollingElement(toElement(m_previo
usGestureScrolledNode.get())); |
(...skipping 1379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3995 unsigned EventHandler::accessKeyModifiers() | 3999 unsigned EventHandler::accessKeyModifiers() |
3996 { | 4000 { |
3997 #if OS(MACOSX) | 4001 #if OS(MACOSX) |
3998 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; | 4002 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; |
3999 #else | 4003 #else |
4000 return PlatformEvent::AltKey; | 4004 return PlatformEvent::AltKey; |
4001 #endif | 4005 #endif |
4002 } | 4006 } |
4003 | 4007 |
4004 } // namespace blink | 4008 } // namespace blink |
OLD | NEW |