Changeset 290625 in webkit


Ignore:
Timestamp:
Feb 28, 2022 7:00:08 PM (5 months ago)
Author:
Simon Fraser
Message:

No animation when scroll snap scroller is navigated with the keyboard
https://bugs.webkit.org/show_bug.cgi?id=236244

Reviewed by Tim Horton.

Source/WebCore:

Keyboard-driven scrolls in overflow didn't animate, simply because scrollAnimatorEnabled()
wasn't implemented for RenderLayerScrollableArea.

I could not figure out a reliable way to test that we animated the scroll.

  • rendering/RenderLayerScrollableArea.cpp:

(WebCore::RenderLayerScrollableArea::scrollAnimatorEnabled const):

  • rendering/RenderLayerScrollableArea.h:

Tools:

In fixing this bug I ran into the issue predicted in https://bugs.webkit.org/show_bug.cgi?id=234456#c6.
As a workaround, explicitly set NSScrollAnimationEnabled to NO in both processes. This is a partial revert
of r287228 which I tried, and failed to fix via bug 234488.

  • WebKitTestRunner/InjectedBundle/mac/InjectedBundleMac.mm:

(WTR::InjectedBundle::platformInitialize):

  • WebKitTestRunner/mac/main.mm:

(setDefaultsToConsistentValuesForTesting):

LayoutTests:

Turn off the scroll animator for these tests that assume that scrolling is instantaneous.

  • css3/scroll-snap/scroll-padding-overflow-paging.html:
  • fast/events/wheelevent-in-scrolling-div.html:
  • tiled-drawing/scrolling/scroll-snap/scroll-snap-proximity-overflow-rtl-with-keyboard.html:
Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r290624 r290625  
     12022-02-28  Simon Fraser  <simon.fraser@apple.com>
     2
     3        No animation when scroll snap scroller is navigated with the keyboard
     4        https://bugs.webkit.org/show_bug.cgi?id=236244
     5
     6        Reviewed by Tim Horton.
     7
     8        Turn off the scroll animator for these tests that assume that scrolling is instantaneous.
     9
     10        * css3/scroll-snap/scroll-padding-overflow-paging.html:
     11        * fast/events/wheelevent-in-scrolling-div.html:
     12        * tiled-drawing/scrolling/scroll-snap/scroll-snap-proximity-overflow-rtl-with-keyboard.html:
     13
    1142022-02-28  Matteo Flores  <matteo_flores@apple.com>
    215
  • trunk/LayoutTests/css3/scroll-snap/scroll-padding-overflow-paging.html

    r290604 r290625  
    1 <!DOCTYPE html>
     1<!DOCTYPE html> <!-- webkit-test-runner [ ScrollAnimatorEnabled=false ] -->
    22<html>
    33    <head>
  • trunk/LayoutTests/fast/events/wheelevent-in-scrolling-div.html

    r290604 r290625  
     1<!DOCTYPE html> <!-- webkit-test-runner [ ScrollAnimatorEnabled=false ] -->
    12<html>
    23    <head>
  • trunk/LayoutTests/tiled-drawing/scrolling/scroll-snap/scroll-snap-proximity-overflow-rtl-with-keyboard.html

    r290604 r290625  
    1 <!DOCTYPE HTML>
     1<!DOCTYPE html> <!-- webkit-test-runner [ ScrollAnimatorEnabled=false ] -->
    22<html>
    33    <head>
  • trunk/Source/WebCore/ChangeLog

    r290621 r290625  
     12022-02-28  Simon Fraser  <simon.fraser@apple.com>
     2
     3        No animation when scroll snap scroller is navigated with the keyboard
     4        https://bugs.webkit.org/show_bug.cgi?id=236244
     5
     6        Reviewed by Tim Horton.
     7
     8        Keyboard-driven scrolls in overflow didn't animate, simply because scrollAnimatorEnabled()
     9        wasn't implemented for RenderLayerScrollableArea.
     10
     11        I could not figure out a reliable way to test that we animated the scroll.
     12
     13        * rendering/RenderLayerScrollableArea.cpp:
     14        (WebCore::RenderLayerScrollableArea::scrollAnimatorEnabled const):
     15        * rendering/RenderLayerScrollableArea.h:
     16
    1172022-02-28  Jer Noble  <jer.noble@apple.com>
    218
  • trunk/Source/WebCore/rendering/RenderLayerScrollableArea.cpp

    r290604 r290625  
    15431543}
    15441544
     1545bool RenderLayerScrollableArea::scrollAnimatorEnabled() const
     1546{
     1547    return m_layer.page().settings().scrollAnimatorEnabled();
     1548}
     1549
    15451550void RenderLayerScrollableArea::paintOverlayScrollbars(GraphicsContext& context, const LayoutRect& damageRect, OptionSet<PaintBehavior> paintBehavior, RenderObject* subtreePaintRoot)
    15461551{
  • trunk/Source/WebCore/rendering/RenderLayerScrollableArea.h

    r290604 r290625  
    194194    bool forceUpdateScrollbarsOnMainThreadForPerformanceTesting() const final;
    195195    bool isScrollSnapInProgress() const final;
     196    bool scrollAnimatorEnabled() const final;
    196197    bool mockScrollbarsControllerEnabled() const final;
    197198    void logMockScrollbarsControllerMessage(const String&) const final;
  • trunk/Tools/ChangeLog

    r290620 r290625  
     12022-02-28  Simon Fraser  <simon.fraser@apple.com>
     2
     3        No animation when scroll snap scroller is navigated with the keyboard
     4        https://bugs.webkit.org/show_bug.cgi?id=236244
     5
     6        Reviewed by Tim Horton.
     7
     8        In fixing this bug I ran into the issue predicted in https://bugs.webkit.org/show_bug.cgi?id=234456#c6.
     9        As a workaround, explicitly set NSScrollAnimationEnabled to NO in both processes. This is a partial revert
     10        of r287228 which I tried, and failed to fix via bug 234488.
     11
     12        * WebKitTestRunner/InjectedBundle/mac/InjectedBundleMac.mm:
     13        (WTR::InjectedBundle::platformInitialize):
     14        * WebKitTestRunner/mac/main.mm:
     15        (setDefaultsToConsistentValuesForTesting):
     16
    1172022-02-28  Wenson Hsieh  <wenson_hsieh@apple.com>
    218
  • trunk/Tools/WebKitTestRunner/InjectedBundle/mac/InjectedBundleMac.mm

    r287228 r290625  
    5454        @"AppleOtherHighlightColor": @"0.500000 0.500000 0.500000",
    5555        @"NSOverlayScrollersEnabled": @NO,
     56        @"NSScrollAnimationEnabled" : @NO,
    5657        @"AppleShowScrollBars": @"Always",
    5758        @"NSButtonAnimationsEnabled": @NO, // Ideally, we should find a way to test animations, but for now, make sure that the dumped snapshot matches actual state.
  • trunk/Tools/WebKitTestRunner/mac/main.mm

    r287228 r290625  
    4444        @"com.apple.trackpad.forceClick": @1,
    4545        @"NSOverlayScrollersEnabled": @NO,
     46        @"NSScrollAnimationEnabled" : @NO,
    4647        @"AppleShowScrollBars": @"Always",
    4748        @"WebKit2UseRemoteLayerTreeDrawingArea": @NO,
Note: See TracChangeset for help on using the changeset viewer.