| Index: Source/core/input/EventHandler.cpp
|
| diff --git a/Source/core/input/EventHandler.cpp b/Source/core/input/EventHandler.cpp
|
| index 5ce38751106f6d06f862f27b290b771cca457905..76c2b173d3a14046f18eb1f8ead4515a9e4094d3 100644
|
| --- a/Source/core/input/EventHandler.cpp
|
| +++ b/Source/core/input/EventHandler.cpp
|
| @@ -205,14 +205,21 @@ void recomputeScrollChain(const LocalFrame& frame, const Node& startNode,
|
| while (curBox && !curBox->isLayoutView()) {
|
| Node* curNode = curBox->node();
|
| // FIXME: this should reject more elements, as part of crbug.com/410974.
|
| - if (curNode && curNode->isElementNode())
|
| - scrollChain.prepend(toElement(curNode));
|
| + if (curNode && curNode->isElementNode()) {
|
| + Element* curElement = toElement(curNode);
|
| + if (curElement == frame.document()->scrollingElement())
|
| + break;
|
| + scrollChain.prepend(curElement);
|
| + }
|
| curBox = curBox->containingBlock();
|
| }
|
| -
|
| - // FIXME: we should exclude the document in some cases, as part
|
| - // of crbug.com/410974.
|
| - scrollChain.prepend(frame.document()->documentElement());
|
| + // TODO(tdresser): this should sometimes be excluded, as part of crbug.com/410974.
|
| + // We need to ensure that the scrollingElement is always part of
|
| + // the scroll chain. In quirks mode, when the scrollingElement is
|
| + // the body, some elements may use the documentElement as their
|
| + // containingBlock, so we ensure the scrollingElement is added
|
| + // here.
|
| + scrollChain.prepend(frame.document()->scrollingElement());
|
| }
|
|
|
| EventHandler::EventHandler(LocalFrame* frame)
|
| @@ -310,9 +317,8 @@ void EventHandler::clear()
|
| m_targetForTouchID.clear();
|
| m_touchSequenceDocument.clear();
|
| m_touchSequenceUserGestureToken.clear();
|
| - m_scrollGestureHandlingNode = nullptr;
|
| + clearGestureScrollState();
|
| m_lastGestureScrollOverWidget = false;
|
| - m_previousGestureScrolledNode = nullptr;
|
| m_scrollbarHandlingScrollGesture = nullptr;
|
| m_maxMouseMovedDuration = 0;
|
| m_touchPressed = false;
|
| @@ -2607,7 +2613,7 @@ bool EventHandler::handleGestureScrollEnd(const PlatformGestureEvent& gestureEve
|
| }
|
| }
|
|
|
| - clearGestureScrollNodes();
|
| + clearGestureScrollState();
|
| return false;
|
| }
|
|
|
| @@ -2734,7 +2740,7 @@ bool EventHandler::handleGestureScrollUpdate(const PlatformGestureEvent& gesture
|
| return false;
|
| }
|
|
|
| -void EventHandler::clearGestureScrollNodes()
|
| +void EventHandler::clearGestureScrollState()
|
| {
|
| m_scrollGestureHandlingNode = nullptr;
|
| m_previousGestureScrolledNode = nullptr;
|
|
|