Changeset 266016 in webkit


Ignore:
Timestamp:
Aug 21, 2020, 3:49:12 PM (5 years ago)
Author:
Simon Fraser
Message:

Add some FIXMEs in the EventHandler wheel event handling code for all the things that are wrong
https://bugs.webkit.org/show_bug.cgi?id=215741

Reviewed by Wenson Hsieh.

There is much confusing code here. Trying to document the issues I've found.

  • page/EventHandler.cpp:

(WebCore::EventHandler::handleWheelEvent):

  • page/mac/EventHandlerMac.mm:

(WebCore::findEnclosingScrollableContainer):
(WebCore::EventHandler::determineWheelEventTarget):
(WebCore::EventHandler::processWheelEventForScrolling):

  • page/scrolling/mac/ScrollingCoordinatorMac.mm:

(WebCore::ScrollingCoordinatorMac::handleWheelEvent):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r266010 r266016  
     12020-08-21  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Add some FIXMEs in the EventHandler wheel event handling code for all the things that are wrong
     4        https://bugs.webkit.org/show_bug.cgi?id=215741
     5
     6        Reviewed by Wenson Hsieh.
     7
     8        There is much confusing code here. Trying to document the issues I've found.
     9
     10        * page/EventHandler.cpp:
     11        (WebCore::EventHandler::handleWheelEvent):
     12        * page/mac/EventHandlerMac.mm:
     13        (WebCore::findEnclosingScrollableContainer):
     14        (WebCore::EventHandler::determineWheelEventTarget):
     15        (WebCore::EventHandler::processWheelEventForScrolling):
     16        * page/scrolling/mac/ScrollingCoordinatorMac.mm:
     17        (WebCore::ScrollingCoordinatorMac::handleWheelEvent):
     18
    1192020-08-21  Rob Buis  <rbuis@igalia.com>
    220
  • trunk/Source/WebCore/page/EventHandler.cpp

    r265881 r266016  
    29182918    document->hitTest(request, result);
    29192919
     2920    // FIXME: Why do we have track all three of targetElement, scrollableContainer and ScrollableArea?
    29202921    RefPtr<Element> element = result.targetElement();
    29212922    RefPtr<ContainerNode> scrollableContainer;
    29222923    WeakPtr<ScrollableArea> scrollableArea;
    29232924    bool isOverWidget = result.isOverWidget();
     2925   
     2926    // FIXME: Using the value of isOverWidget from the latching state triggers double-recursion into subframes.
     2927    // FIXME: Despite doing this up-front search for the correct scrollable area, we dispatch events via elements which
     2928    // itself finds and tries to scroll overflow scrollers.
    29242929    determineWheelEventTarget(event, result, element, scrollableContainer, scrollableArea, isOverWidget);
    29252930
     
    29552960        scrollableArea->setScrollShouldClearLatchedState(false);
    29562961
     2962    // FIXME: processWheelEventForScrolling() is only called for FrameView scrolling, not overflow scrolling, which is confusing.
    29572963    bool handledEvent = processWheelEventForScrolling(event, scrollableContainer.get(), scrollableArea);
    29582964    processWheelEventForScrollSnap(event, scrollableArea);
  • trunk/Source/WebCore/page/mac/EventHandlerMac.mm

    r264247 r266016  
    808808            return candidate;
    809809
     810        // FIXME: This needs to have the same axis bias that we use in other latching code.
    810811        auto deltaX = wheelEvent.deltaX();
    811812        auto deltaY = wheelEvent.deltaY();
     
    975976                scrollableArea = scrollableAreaForContainerNode(*scrollableContainer);
    976977            else {
     978                // FIXME: Why does this assume the body? What if we hit an iframe inside an overflow:scroll?
    977979                scrollableContainer = view->frame().document()->bodyOrFrameset();
    978980                scrollableArea = makeWeakPtr(static_cast<ScrollableArea&>(*view));
     
    10101012    }
    10111013
     1014    // FIXME: This can use a stale laching state, before we just pushed or cleared.
    10121015    if (!wheelEvent.shouldResetLatching() && latchingState && latchingState->wheelEventElement()) {
    10131016        if (latchingIsLockedToPlatformFrame(m_frame))
     
    10801083        }
    10811084
    1082         if (!latchingState->startedGestureAtScrollLimit())
     1085        if (!latchingState->startedGestureAtScrollLimit()) {
     1086            // FIXME: This set 'view' to a FrameView that is not this EventHandler's FrameView, which then gets scrolled from here, which is wrong.
    10831087            view = frameViewForLatchingState(m_frame, *latchingState);
     1088        }
    10841089
    10851090        ASSERT(view);
  • trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm

    r265820 r266016  
    8383
    8484    LOG_WITH_STREAM(Scrolling, stream << "ScrollingCoordinatorMac::handleWheelEvent - sending event to scrolling thread");
     85   
     86    // FIXME: Over on the scrolling thread, we'll hit-test the layers and possibly send the event to a node
     87    // which we've already discounted on the main thread. This needs to target a specific node.
    8588
    8689    RefPtr<ThreadedScrollingTree> threadedScrollingTree = downcast<ThreadedScrollingTree>(scrollingTree());
Note: See TracChangeset for help on using the changeset viewer.