void ScrollingTree::setOrClearLatchedNode(const PlatformWheelEvent& wheelEvent, ScrollingNodeID nodeID) { if (wheelEvent.shouldConsiderLatching()) setLatchedNode(nodeID); else if (wheelEvent.shouldResetLatching()) clearLatchedNode(); }
bool ScrollingTree::shouldHandleWheelEventSynchronously(const PlatformWheelEvent& wheelEvent) { // This method is invoked by the event handling thread MutexLocker lock(m_mutex); if (m_hasWheelEventHandlers) return true; bool shouldSetLatch = wheelEvent.shouldConsiderLatching(); if (hasLatchedNode() && !shouldSetLatch) return false; if (shouldSetLatch) m_latchedNode = 0; if (!m_nonFastScrollableRegion.isEmpty()) { // FIXME: This is not correct for non-default scroll origins. FloatPoint position = wheelEvent.position(); position.moveBy(m_mainFrameScrollPosition); if (m_nonFastScrollableRegion.contains(roundedIntPoint(position))) return true; } return false; }