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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
226 , m_selectionInitiationState(HaveNotStartedSelection) | 226 , m_selectionInitiationState(HaveNotStartedSelection) |
227 , m_hoverTimer(this, &EventHandler::hoverTimerFired) | 227 , m_hoverTimer(this, &EventHandler::hoverTimerFired) |
228 , m_cursorUpdateTimer(this, &EventHandler::cursorUpdateTimerFired) | 228 , m_cursorUpdateTimer(this, &EventHandler::cursorUpdateTimerFired) |
229 , m_mouseDownMayStartAutoscroll(false) | 229 , m_mouseDownMayStartAutoscroll(false) |
230 , m_fakeMouseMoveEventTimer(this, &EventHandler::fakeMouseMoveEventTimerFire d) | 230 , m_fakeMouseMoveEventTimer(this, &EventHandler::fakeMouseMoveEventTimerFire d) |
231 , m_svgPan(false) | 231 , m_svgPan(false) |
232 , m_resizeScrollableArea(nullptr) | 232 , m_resizeScrollableArea(nullptr) |
233 , m_eventHandlerWillResetCapturingMouseEventsNode(0) | 233 , m_eventHandlerWillResetCapturingMouseEventsNode(0) |
234 , m_clickCount(0) | 234 , m_clickCount(0) |
235 , m_shouldOnlyFireDragOverEvent(false) | 235 , m_shouldOnlyFireDragOverEvent(false) |
236 , m_unusedDelta(FloatSize()) | |
237 , m_accumulatedRootOverscroll(FloatSize()) | |
236 , m_mousePositionIsUnknown(true) | 238 , m_mousePositionIsUnknown(true) |
237 , m_mouseDownTimestamp(0) | 239 , m_mouseDownTimestamp(0) |
238 , m_widgetIsLatched(false) | 240 , m_widgetIsLatched(false) |
239 , m_touchPressed(false) | 241 , m_touchPressed(false) |
240 , m_scrollGestureHandlingNode(nullptr) | 242 , m_scrollGestureHandlingNode(nullptr) |
241 , m_lastGestureScrollOverWidget(false) | 243 , m_lastGestureScrollOverWidget(false) |
242 , m_maxMouseMovedDuration(0) | 244 , m_maxMouseMovedDuration(0) |
243 , m_longTapShouldInvokeContextMenu(false) | 245 , m_longTapShouldInvokeContextMenu(false) |
244 , m_activeIntervalTimer(this, &EventHandler::activeIntervalTimerFired) | 246 , m_activeIntervalTimer(this, &EventHandler::activeIntervalTimerFired) |
245 , m_lastShowPressTimestamp(0) | 247 , m_lastShowPressTimestamp(0) |
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
917 | 919 |
918 return result; | 920 return result; |
919 } | 921 } |
920 | 922 |
921 void EventHandler::stopAutoscroll() | 923 void EventHandler::stopAutoscroll() |
922 { | 924 { |
923 if (AutoscrollController* controller = autoscrollController()) | 925 if (AutoscrollController* controller = autoscrollController()) |
924 controller->stopAutoscroll(); | 926 controller->stopAutoscroll(); |
925 } | 927 } |
926 | 928 |
927 bool EventHandler::scroll(ScrollDirection direction, ScrollGranularity granulari ty, Node* startNode, Node** stopNode, float delta, IntPoint absolutePoint) | 929 ScrollResultOneDimensional EventHandler::scroll(ScrollDirection direction, Scrol lGranularity granularity, Node* startNode, Node** stopNode, float delta, IntPoin t absolutePoint) |
928 { | 930 { |
929 if (!delta) | 931 if (!delta) |
930 return false; | 932 return ScrollResultOneDimensional(false); |
931 | 933 |
932 Node* node = startNode; | 934 Node* node = startNode; |
933 | 935 |
934 if (!node) | 936 if (!node) |
935 node = m_frame->document()->focusedElement(); | 937 node = m_frame->document()->focusedElement(); |
936 | 938 |
937 if (!node) | 939 if (!node) |
938 node = m_mousePressNode.get(); | 940 node = m_mousePressNode.get(); |
939 | 941 |
940 if (!node || !node->layoutObject()) | 942 if (!node || !node->layoutObject()) |
941 return false; | 943 return ScrollResultOneDimensional(false, delta); |
942 | 944 |
943 LayoutBox* curBox = node->layoutObject()->enclosingBox(); | 945 LayoutBox* curBox = node->layoutObject()->enclosingBox(); |
944 while (curBox && !curBox->isLayoutView()) { | 946 while (curBox && !curBox->isLayoutView()) { |
945 ScrollDirectionPhysical physicalDirection = toPhysicalDirection( | 947 ScrollDirectionPhysical physicalDirection = toPhysicalDirection( |
946 direction, curBox->isHorizontalWritingMode(), curBox->style()->isFli ppedBlocksWritingMode()); | 948 direction, curBox->isHorizontalWritingMode(), curBox->style()->isFli ppedBlocksWritingMode()); |
947 | 949 |
948 // If we're at the stopNode, we should try to scroll it but we shouldn't bubble past it | 950 // If we're at the stopNode, we should try to scroll it but we shouldn't bubble past it |
949 bool shouldStopBubbling = stopNode && *stopNode && curBox->node() == *st opNode; | 951 bool shouldStopBubbling = stopNode && *stopNode && curBox->node() == *st opNode; |
950 bool didScroll = curBox->scroll(physicalDirection, granularity, delta); | 952 ScrollResultOneDimensional result = curBox->scroll(physicalDirection, gr anularity, delta); |
951 | 953 |
952 if (didScroll && stopNode) | 954 if (result.didScroll && stopNode) |
953 *stopNode = curBox->node(); | 955 *stopNode = curBox->node(); |
954 | 956 |
955 if (didScroll || shouldStopBubbling) { | 957 if (result.didScroll || shouldStopBubbling) { |
956 setFrameWasScrolledByUser(); | 958 setFrameWasScrolledByUser(); |
957 return true; | 959 result.didScroll = true; |
960 return result; | |
958 } | 961 } |
959 | 962 |
960 curBox = curBox->containingBlock(); | 963 curBox = curBox->containingBlock(); |
961 } | 964 } |
962 | 965 |
963 return false; | 966 return ScrollResultOneDimensional(false, delta); |
964 } | 967 } |
965 | 968 |
966 void EventHandler::customizedScroll(const Node& startNode, ScrollState& scrollSt ate) | 969 void EventHandler::customizedScroll(const Node& startNode, ScrollState& scrollSt ate) |
967 { | 970 { |
968 if (scrollState.fullyConsumed()) | 971 if (scrollState.fullyConsumed()) |
969 return; | 972 return; |
970 | 973 |
971 if (m_currentScrollChain.isEmpty()) | 974 if (m_currentScrollChain.isEmpty()) |
972 recomputeScrollChain(*m_frame, startNode, m_currentScrollChain); | 975 recomputeScrollChain(*m_frame, startNode, m_currentScrollChain); |
973 scrollState.setScrollChain(m_currentScrollChain); | 976 scrollState.setScrollChain(m_currentScrollChain); |
974 scrollState.distributeToScrollChainDescendant(); | 977 scrollState.distributeToScrollChainDescendant(); |
975 } | 978 } |
976 | 979 |
977 bool EventHandler::bubblingScroll(ScrollDirection direction, ScrollGranularity g ranularity, Node* startingNode) | 980 bool EventHandler::bubblingScroll(ScrollDirection direction, ScrollGranularity g ranularity, Node* startingNode) |
978 { | 981 { |
979 // The layout needs to be up to date to determine if we can scroll. We may b e | 982 // The layout needs to be up to date to determine if we can scroll. We may b e |
980 // here because of an onLoad event, in which case the final layout hasn't be en performed yet. | 983 // here because of an onLoad event, in which case the final layout hasn't be en performed yet. |
981 m_frame->document()->updateLayoutIgnorePendingStylesheets(); | 984 m_frame->document()->updateLayoutIgnorePendingStylesheets(); |
982 // FIXME: enable scroll customization in this case. See crbug.com/410974. | 985 // FIXME: enable scroll customization in this case. See crbug.com/410974. |
983 if (scroll(direction, granularity, startingNode)) | 986 if (scroll(direction, granularity, startingNode).didScroll) |
984 return true; | 987 return true; |
985 LocalFrame* frame = m_frame; | 988 LocalFrame* frame = m_frame; |
986 FrameView* view = frame->view(); | 989 FrameView* view = frame->view(); |
987 if (view) { | 990 if (view) { |
988 ScrollDirectionPhysical physicalDirection = | 991 ScrollDirectionPhysical physicalDirection = |
989 toPhysicalDirection(direction, view->isVerticalDocument(), view->isF lippedDocument()); | 992 toPhysicalDirection(direction, view->isVerticalDocument(), view->isF lippedDocument()); |
990 if (view->scrollableArea()->scroll(physicalDirection, granularity)) { | 993 if (view->scrollableArea()->scroll(physicalDirection, granularity).didSc roll) { |
991 setFrameWasScrolledByUser(); | 994 setFrameWasScrolledByUser(); |
992 return true; | 995 return true; |
993 } | 996 } |
994 } | 997 } |
995 | 998 |
996 Frame* parentFrame = frame->tree().parent(); | 999 Frame* parentFrame = frame->tree().parent(); |
997 if (!parentFrame || !parentFrame->isLocalFrame()) | 1000 if (!parentFrame || !parentFrame->isLocalFrame()) |
998 return false; | 1001 return false; |
999 // FIXME: Broken for OOPI. | 1002 // FIXME: Broken for OOPI. |
1000 return toLocalFrame(parentFrame)->eventHandler().bubblingScroll(direction, g ranularity, m_frame->deprecatedLocalOwner()); | 1003 return toLocalFrame(parentFrame)->eventHandler().bubblingScroll(direction, g ranularity, m_frame->deprecatedLocalOwner()); |
(...skipping 1171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2172 if (node && !node->dispatchWheelEvent(event)) | 2175 if (node && !node->dispatchWheelEvent(event)) |
2173 RETURN_WHEEL_EVENT_HANDLED(); | 2176 RETURN_WHEEL_EVENT_HANDLED(); |
2174 } | 2177 } |
2175 | 2178 |
2176 // We do another check on the frame view because the event handler can run | 2179 // We do another check on the frame view because the event handler can run |
2177 // JS which results in the frame getting destroyed. | 2180 // JS which results in the frame getting destroyed. |
2178 view = m_frame->view(); | 2181 view = m_frame->view(); |
2179 if (!view) | 2182 if (!view) |
2180 return false; | 2183 return false; |
2181 | 2184 |
2182 if (view->scrollableArea()->handleWheel(event).didScroll) | 2185 if (view->scrollableArea()->handleWheel(event).didScroll()) |
2183 RETURN_WHEEL_EVENT_HANDLED(); | 2186 RETURN_WHEEL_EVENT_HANDLED(); |
2184 | 2187 |
2185 return false; | 2188 return false; |
2186 #undef RETURN_WHEEL_EVENT_HANDLED | 2189 #undef RETURN_WHEEL_EVENT_HANDLED |
2187 } | 2190 } |
2188 | 2191 |
2189 void EventHandler::defaultWheelEventHandler(Node* startNode, WheelEvent* wheelEv ent) | 2192 void EventHandler::defaultWheelEventHandler(Node* startNode, WheelEvent* wheelEv ent) |
2190 { | 2193 { |
2191 if (!startNode || !wheelEvent) | 2194 if (!startNode || !wheelEvent) |
2192 return; | 2195 return; |
2193 | 2196 |
2194 // When the wheelEvent do not scroll, we trigger zoom in/out instead. | 2197 // When the wheelEvent do not scroll, we trigger zoom in/out instead. |
2195 if (!wheelEvent->canScroll()) | 2198 if (!wheelEvent->canScroll()) |
2196 return; | 2199 return; |
2197 | 2200 |
2198 Node* stopNode = m_previousWheelScrolledNode.get(); | 2201 Node* stopNode = m_previousWheelScrolledNode.get(); |
2199 ScrollGranularity granularity = wheelGranularityToScrollGranularity(wheelEve nt); | 2202 ScrollGranularity granularity = wheelGranularityToScrollGranularity(wheelEve nt); |
2200 IntPoint absolutePosition = roundedIntPoint(wheelEvent->absoluteLocation()); | 2203 IntPoint absolutePosition = roundedIntPoint(wheelEvent->absoluteLocation()); |
2201 | 2204 |
2202 // Break up into two scrolls if we need to. Diagonal movement on | 2205 // Break up into two scrolls if we need to. Diagonal movement on |
2203 // a MacBook pro is an example of a 2-dimensional mouse wheel event (where b oth deltaX and deltaY can be set). | 2206 // a MacBook pro is an example of a 2-dimensional mouse wheel event (where b oth deltaX and deltaY can be set). |
2204 | 2207 |
2205 // FIXME: enable scroll customization in this case. See crbug.com/410974. | 2208 // FIXME: enable scroll customization in this case. See crbug.com/410974. |
2206 if (wheelEvent->railsMode() != Event::RailsModeVertical | 2209 if (wheelEvent->railsMode() != Event::RailsModeVertical |
2207 && scroll(ScrollRightIgnoringWritingMode, granularity, startNode, &stopN ode, wheelEvent->deltaX(), absolutePosition)) | 2210 && scroll(ScrollRightIgnoringWritingMode, granularity, startNode, &stopN ode, wheelEvent->deltaX(), absolutePosition).didScroll) |
2208 wheelEvent->setDefaultHandled(); | 2211 wheelEvent->setDefaultHandled(); |
2209 | 2212 |
2210 if (wheelEvent->railsMode() != Event::RailsModeHorizontal | 2213 if (wheelEvent->railsMode() != Event::RailsModeHorizontal |
2211 && scroll(ScrollDownIgnoringWritingMode, granularity, startNode, &stopNo de, wheelEvent->deltaY(), absolutePosition)) | 2214 && scroll(ScrollDownIgnoringWritingMode, granularity, startNode, &stopNo de, wheelEvent->deltaY(), absolutePosition).didScroll) |
2212 wheelEvent->setDefaultHandled(); | 2215 wheelEvent->setDefaultHandled(); |
2213 | 2216 |
2214 if (!m_latchedWheelEventNode) | 2217 if (!m_latchedWheelEventNode) |
2215 m_previousWheelScrolledNode = stopNode; | 2218 m_previousWheelScrolledNode = stopNode; |
2216 } | 2219 } |
2217 | 2220 |
2218 bool EventHandler::handleGestureShowPress() | 2221 bool EventHandler::handleGestureShowPress() |
2219 { | 2222 { |
2220 m_lastShowPressTimestamp = WTF::currentTime(); | 2223 m_lastShowPressTimestamp = WTF::currentTime(); |
2221 | 2224 |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2643 0, 0, 0, 0, 0, /* inInertialPhase */ false, /* isBeginning */ | 2646 0, 0, 0, 0, 0, /* inInertialPhase */ false, /* isBeginning */ |
2644 true, /* isEnding */ false, /* fromUserInput */ true); | 2647 true, /* isEnding */ false, /* fromUserInput */ true); |
2645 customizedScroll(*m_scrollGestureHandlingNode.get(), *scrollState); | 2648 customizedScroll(*m_scrollGestureHandlingNode.get(), *scrollState); |
2646 } else { | 2649 } else { |
2647 if (m_frame->isMainFrame()) | 2650 if (m_frame->isMainFrame()) |
2648 m_frame->host()->topControls().scrollBegin(); | 2651 m_frame->host()->topControls().scrollBegin(); |
2649 } | 2652 } |
2650 return true; | 2653 return true; |
2651 } | 2654 } |
2652 | 2655 |
2656 void EventHandler::resetOverscroll(bool didScrollX, bool didScrollY) | |
2657 { | |
2658 if (didScrollX) { | |
majidvp
2015/06/02 17:00:31
nitp: fix indentation
MuVen
2015/06/03 09:32:18
Done.
| |
2659 m_accumulatedRootOverscroll.setWidth(0); | |
2660 m_unusedDelta.setWidth(0); | |
2661 } | |
2662 if (didScrollY) { | |
2663 m_accumulatedRootOverscroll.setHeight(0); | |
2664 m_unusedDelta.setHeight(0); | |
2665 } | |
2666 } | |
2667 | |
2653 bool EventHandler::handleGestureScrollUpdate(const PlatformGestureEvent& gesture Event) | 2668 bool EventHandler::handleGestureScrollUpdate(const PlatformGestureEvent& gesture Event) |
2654 { | 2669 { |
2655 ASSERT(gestureEvent.type() == PlatformEvent::GestureScrollUpdate); | 2670 ASSERT(gestureEvent.type() == PlatformEvent::GestureScrollUpdate); |
2656 | 2671 |
2657 FloatSize delta(gestureEvent.deltaX(), gestureEvent.deltaY()); | 2672 FloatSize delta(gestureEvent.deltaX(), gestureEvent.deltaY()); |
2658 if (delta.isZero()) | 2673 if (delta.isZero()) |
2659 return false; | 2674 return false; |
2660 | 2675 |
2661 Node* node = m_scrollGestureHandlingNode.get(); | 2676 Node* node = m_scrollGestureHandlingNode.get(); |
2662 if (node) { | 2677 if (node) { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2702 m_previousGestureScrolledNode = scrollState->currentNativeScrollingE lement(); | 2717 m_previousGestureScrolledNode = scrollState->currentNativeScrollingE lement(); |
2703 m_deltaConsumedForScrollSequence = scrollState->deltaConsumedForScro llSequence(); | 2718 m_deltaConsumedForScrollSequence = scrollState->deltaConsumedForScro llSequence(); |
2704 scrolled = scrollState->deltaX() != gestureEvent.deltaX() | 2719 scrolled = scrollState->deltaX() != gestureEvent.deltaX() |
2705 || scrollState->deltaY() != gestureEvent.deltaY(); | 2720 || scrollState->deltaY() != gestureEvent.deltaY(); |
2706 } else { | 2721 } else { |
2707 if (gestureEvent.preventPropagation()) | 2722 if (gestureEvent.preventPropagation()) |
2708 stopNode = m_previousGestureScrolledNode.get(); | 2723 stopNode = m_previousGestureScrolledNode.get(); |
2709 | 2724 |
2710 // First try to scroll the closest scrollable LayoutBox ancestor of |node|. | 2725 // First try to scroll the closest scrollable LayoutBox ancestor of |node|. |
2711 ScrollGranularity granularity = ScrollByPrecisePixel; | 2726 ScrollGranularity granularity = ScrollByPrecisePixel; |
2712 bool horizontalScroll = scroll(ScrollLeftIgnoringWritingMode, granul arity, node, &stopNode, delta.width()); | 2727 m_unusedDelta = FloatSize(); |
2728 ScrollResultOneDimensional result = scroll(ScrollLeftIgnoringWriting Mode, granularity, node, &stopNode, delta.width()); | |
2729 bool horizontalScroll = result.didScroll; | |
2713 if (!gestureEvent.preventPropagation()) | 2730 if (!gestureEvent.preventPropagation()) |
2714 stopNode = nullptr; | 2731 stopNode = nullptr; |
2715 bool verticalScroll = scroll(ScrollUpIgnoringWritingMode, granularit y, node, &stopNode, delta.height()); | 2732 result = scroll(ScrollUpIgnoringWritingMode, granularity, node, &sto pNode, delta.height()); |
2733 bool verticalScroll = result.didScroll; | |
2716 scrolled = horizontalScroll || verticalScroll; | 2734 scrolled = horizontalScroll || verticalScroll; |
2717 | 2735 |
2718 if (gestureEvent.preventPropagation()) | 2736 if (gestureEvent.preventPropagation()) |
2719 m_previousGestureScrolledNode = stopNode; | 2737 m_previousGestureScrolledNode = stopNode; |
2738 | |
2739 resetOverscroll(horizontalScroll, verticalScroll); | |
2720 } | 2740 } |
2721 if (scrolled) { | 2741 if (scrolled) { |
2722 setFrameWasScrolledByUser(); | 2742 setFrameWasScrolledByUser(); |
2723 return true; | 2743 return true; |
2724 } | 2744 } |
2725 } | 2745 } |
2726 | 2746 |
2727 if (RuntimeEnabledFeatures::scrollCustomizationEnabled()) | 2747 if (RuntimeEnabledFeatures::scrollCustomizationEnabled()) |
2728 return false; | 2748 return false; |
2729 | 2749 |
2730 // Try to scroll the frame view. | 2750 // Try to scroll the frame view. |
2731 if (m_frame->applyScrollDelta(delta, false)) { | 2751 ScrollResult resultScrollDelta = m_frame->applyScrollDelta(delta, false); |
2752 m_unusedDelta.setWidth(resultScrollDelta.unusedScrollDeltaX); | |
2753 m_unusedDelta.setHeight(resultScrollDelta.unusedScrollDeltaY); | |
2754 resetOverscroll(resultScrollDelta.didScrollX, resultScrollDelta.didScrollY); | |
2755 if (m_frame->isMainFrame() && m_unusedDelta != FloatSize()) { | |
2756 m_accumulatedRootOverscroll += m_unusedDelta; | |
2757 FloatPoint position = FloatPoint(gestureEvent.position().x(), gestureEve nt.position().y()); | |
2758 FloatSize velocity = FloatSize(gestureEvent.velocityX(), gestureEvent.ve locityY()); | |
2759 m_frame->chromeClient().didOverscroll(m_unusedDelta, m_accumulatedRootOv erscroll, position, velocity); | |
2760 } | |
2761 | |
2762 if (resultScrollDelta.didScroll()) { | |
2732 setFrameWasScrolledByUser(); | 2763 setFrameWasScrolledByUser(); |
2733 return true; | 2764 return true; |
2734 } | 2765 } |
2735 | 2766 |
2736 return false; | 2767 return false; |
2737 } | 2768 } |
2738 | 2769 |
2739 void EventHandler::clearGestureScrollNodes() | 2770 void EventHandler::clearGestureScrollNodes() |
2740 { | 2771 { |
2741 m_scrollGestureHandlingNode = nullptr; | 2772 m_scrollGestureHandlingNode = nullptr; |
2742 m_previousGestureScrolledNode = nullptr; | 2773 m_previousGestureScrolledNode = nullptr; |
2743 m_deltaConsumedForScrollSequence = false; | 2774 m_deltaConsumedForScrollSequence = false; |
2744 m_currentScrollChain.clear(); | 2775 m_currentScrollChain.clear(); |
2776 m_accumulatedRootOverscroll = FloatSize(); | |
2777 m_unusedDelta = FloatSize(); | |
2745 } | 2778 } |
2746 | 2779 |
2747 bool EventHandler::isScrollbarHandlingGestures() const | 2780 bool EventHandler::isScrollbarHandlingGestures() const |
2748 { | 2781 { |
2749 return m_scrollbarHandlingScrollGesture.get(); | 2782 return m_scrollbarHandlingScrollGesture.get(); |
2750 } | 2783 } |
2751 | 2784 |
2752 bool EventHandler::shouldApplyTouchAdjustment(const PlatformGestureEvent& event) const | 2785 bool EventHandler::shouldApplyTouchAdjustment(const PlatformGestureEvent& event) const |
2753 { | 2786 { |
2754 if (m_frame->settings() && !m_frame->settings()->touchAdjustmentEnabled()) | 2787 if (m_frame->settings() && !m_frame->settings()->touchAdjustmentEnabled()) |
(...skipping 882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3637 void EventHandler::defaultSpaceEventHandler(KeyboardEvent* event) | 3670 void EventHandler::defaultSpaceEventHandler(KeyboardEvent* event) |
3638 { | 3671 { |
3639 ASSERT(event->type() == EventTypeNames::keypress); | 3672 ASSERT(event->type() == EventTypeNames::keypress); |
3640 | 3673 |
3641 if (event->ctrlKey() || event->metaKey() || event->altKey()) | 3674 if (event->ctrlKey() || event->metaKey() || event->altKey()) |
3642 return; | 3675 return; |
3643 | 3676 |
3644 ScrollDirection direction = event->shiftKey() ? ScrollBlockDirectionBackward : ScrollBlockDirectionForward; | 3677 ScrollDirection direction = event->shiftKey() ? ScrollBlockDirectionBackward : ScrollBlockDirectionForward; |
3645 | 3678 |
3646 // FIXME: enable scroll customization in this case. See crbug.com/410974. | 3679 // FIXME: enable scroll customization in this case. See crbug.com/410974. |
3647 if (scroll(direction, ScrollByPage)) { | 3680 if (scroll(direction, ScrollByPage).didScroll) { |
3648 event->setDefaultHandled(); | 3681 event->setDefaultHandled(); |
3649 return; | 3682 return; |
3650 } | 3683 } |
3651 | 3684 |
3652 FrameView* view = m_frame->view(); | 3685 FrameView* view = m_frame->view(); |
3653 if (!view) | 3686 if (!view) |
3654 return; | 3687 return; |
3655 | 3688 |
3656 ScrollDirectionPhysical physicalDirection = | 3689 ScrollDirectionPhysical physicalDirection = |
3657 toPhysicalDirection(direction, view->isVerticalDocument(), view->isFlipp edDocument()); | 3690 toPhysicalDirection(direction, view->isVerticalDocument(), view->isFlipp edDocument()); |
3658 | 3691 |
3659 if (view->scrollableArea()->scroll(physicalDirection, ScrollByPage)) | 3692 if (view->scrollableArea()->scroll(physicalDirection, ScrollByPage).didScrol l) |
3660 event->setDefaultHandled(); | 3693 event->setDefaultHandled(); |
3661 } | 3694 } |
3662 | 3695 |
3663 void EventHandler::defaultBackspaceEventHandler(KeyboardEvent* event) | 3696 void EventHandler::defaultBackspaceEventHandler(KeyboardEvent* event) |
3664 { | 3697 { |
3665 ASSERT(event->type() == EventTypeNames::keydown); | 3698 ASSERT(event->type() == EventTypeNames::keydown); |
3666 | 3699 |
3667 if (event->ctrlKey() || event->metaKey() || event->altKey()) | 3700 if (event->ctrlKey() || event->metaKey() || event->altKey()) |
3668 return; | 3701 return; |
3669 | 3702 |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4172 unsigned EventHandler::accessKeyModifiers() | 4205 unsigned EventHandler::accessKeyModifiers() |
4173 { | 4206 { |
4174 #if OS(MACOSX) | 4207 #if OS(MACOSX) |
4175 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; | 4208 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; |
4176 #else | 4209 #else |
4177 return PlatformEvent::AltKey; | 4210 return PlatformEvent::AltKey; |
4178 #endif | 4211 #endif |
4179 } | 4212 } |
4180 | 4213 |
4181 } // namespace blink | 4214 } // namespace blink |
OLD | NEW |