| Index: Source/core/frame/FrameView.cpp
|
| diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp
|
| index 9d329e47dc387d133df127467e863157ce29000c..c3bd0c4c57209b2d65d70a3f8185d4e0ff5c9905 100644
|
| --- a/Source/core/frame/FrameView.cpp
|
| +++ b/Source/core/frame/FrameView.cpp
|
| @@ -37,6 +37,7 @@
|
| #include "core/events/OverflowEvent.h"
|
| #include "core/fetch/ResourceFetcher.h"
|
| #include "core/fetch/ResourceLoadPriorityOptimizer.h"
|
| +#include "core/frame/FrameHost.h"
|
| #include "core/frame/LocalFrame.h"
|
| #include "core/frame/Settings.h"
|
| #include "core/html/HTMLFrameElement.h"
|
| @@ -2359,7 +2360,10 @@ IntSize FrameView::inputEventsOffsetForEmulation() const
|
|
|
| float FrameView::inputEventsScaleFactor() const
|
| {
|
| - return visibleContentScaleFactor() * m_inputEventsScaleFactorForEmulation;
|
| + float pageScale = m_frame->settings()->pinchVirtualViewportEnabled()
|
| + ? m_frame->page()->frameHost().pinchViewport().scale()
|
| + : visibleContentScaleFactor();
|
| + return pageScale * m_inputEventsScaleFactorForEmulation;
|
| }
|
|
|
| bool FrameView::scrollbarsCanBeActive() const
|
| @@ -3129,18 +3133,24 @@ void FrameView::removeChild(Widget* widget)
|
|
|
| bool FrameView::wheelEvent(const PlatformWheelEvent& wheelEvent)
|
| {
|
| + bool allowScrolling = userInputScrollable(HorizontalScrollbar) || userInputScrollable(VerticalScrollbar);
|
| +
|
| // Note that to allow for rubber-band over-scroll behavior, even non-scrollable views
|
| // should handle wheel events.
|
| #if !USE(RUBBER_BANDING)
|
| if (!isScrollable())
|
| - return false;
|
| + allowScrolling = false;
|
| #endif
|
|
|
| - // We don't allow mouse wheeling to happen in a ScrollView that has had its scrollbars explicitly disabled.
|
| - if (!canHaveScrollbars())
|
| - return false;
|
| + if (allowScrolling && ScrollableArea::handleWheelEvent(wheelEvent))
|
| + return true;
|
| +
|
| + // If the frame didn't handle the event, give the pinch-zoom viewport a chance to
|
| + // process the scroll event.
|
| + if (m_frame->settings()->pinchVirtualViewportEnabled() && m_frame->isMainFrame())
|
| + return page()->frameHost().pinchViewport().handleWheelEvent(wheelEvent);
|
|
|
| - return ScrollableArea::handleWheelEvent(wheelEvent);
|
| + return false;
|
| }
|
|
|
| bool FrameView::isVerticalDocument() const
|
|
|