Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Side by Side Diff: Source/core/page/EventHandler.cpp

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

Powered by Google App Engine
This is Rietveld 408576698