Changeset 268499 in webkit


Ignore:
Timestamp:
Oct 14, 2020 4:55:58 PM (4 years ago)
Author:
Simon Fraser
Message:

Scrolls in the passive handler region should be reported as handled promptly
https://bugs.webkit.org/show_bug.cgi?id=217718

Reviewed by Tim Horton.

The UI process will enqueue wheel events to send later if the WebContent process doesn't
promptly respond that it has handled the previous event. When scrolling in the passive
event region, we want the WebContent process to appear responsive, so respond to the UI
process when we've scrolled (which is before the event has been dispatched for DOM events).

Hard to test because CPU-constrained bots don't send wheel events in a predictable way.

  • WebProcess/WebPage/EventDispatcher.cpp:

(WebKit::EventDispatcher::wheelEvent):

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::wheelEvent):

Location:
trunk/Source/WebKit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r268497 r268499  
     12020-10-14  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Scrolls in the passive handler region should be reported as handled promptly
     4        https://bugs.webkit.org/show_bug.cgi?id=217718
     5
     6        Reviewed by Tim Horton.
     7
     8        The UI process will enqueue wheel events to send later if the WebContent process doesn't
     9        promptly respond that it has handled the previous event. When scrolling in the passive
     10        event region, we want the WebContent process to appear responsive, so respond to the UI
     11        process when we've scrolled (which is before the event has been dispatched for DOM events).
     12
     13        Hard to test because CPU-constrained bots don't send wheel events in a predictable way.
     14
     15        * WebProcess/WebPage/EventDispatcher.cpp:
     16        (WebKit::EventDispatcher::wheelEvent):
     17        * WebProcess/WebPage/WebPage.cpp:
     18        (WebKit::WebPage::wheelEvent):
     19
    1202020-10-14  Ryosuke Niwa  <rniwa@webkit.org>
    221
  • trunk/Source/WebKit/WebProcess/WebPage/EventDispatcher.cpp

    r268417 r268499  
    149149            if (result.needsMainThreadProcessing()) {
    150150                protectedThis->dispatchWheelEventViaMainThread(pageID, wheelEvent, result.steps);
    151                 return;
     151                if (result.steps.contains(WheelEventProcessingSteps::MainThreadForScrolling))
     152                    return;
    152153            }
    153154
     155            // If we scrolled on the scrolling thread (even if we send the event to the main thread for passive event handlers)
     156            // respond to the UI process that the event was handled.
    154157            protectedThis->sendDidReceiveEvent(pageID, wheelEvent.type(), result.wasHandled);
    155158        });
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp

    r268492 r268499  
    28712871    bool handled = handleWheelEvent(wheelEvent, m_page.get(), processingSteps);
    28722872
    2873     send(Messages::WebPageProxy::DidReceiveEvent(static_cast<uint32_t>(wheelEvent.type()), handled));
     2873    if (processingSteps.contains(WheelEventProcessingSteps::MainThreadForScrolling))
     2874        send(Messages::WebPageProxy::DidReceiveEvent(static_cast<uint32_t>(wheelEvent.type()), handled));
    28742875}
    28752876
Note: See TracChangeset for help on using the changeset viewer.