Changeset 246818 in webkit


Ignore:
Timestamp:
Jun 25, 2019 4:42:03 PM (5 years ago)
Author:
timothy@apple.com
Message:

Clicking the up/down spin buttons for a number input increments/decrements by 2.
https://bugs.webkit.org/show_bug.cgi?id=198809

Reviewed by Tim Horton.

AppKit no longer registers NSScrollerButtonDelay and NSScrollerButtonPeriod in the base
NSUserDefaults for an app. This caused our use to always get 0s when setting the click
and hold timer, causing the value to increment quickly for a single press.

  • platform/mac/ScrollbarThemeMac.h:

(WebCore::ScrollbarThemeMac::initialAutoscrollTimerDelay): Added. Hardcode 500ms.
(WebCore::ScrollbarThemeMac::autoscrollTimerDelay): Added. Hardcode 50ms.

  • platform/mac/ScrollbarThemeMac.mm:

(WebCore::ScrollbarThemeMac::preferencesChanged): Removed use of old user defaults.
(WebCore::ScrollbarThemeMac::initialAutoscrollTimerDelay): Deleted.
(WebCore::ScrollbarThemeMac::autoscrollTimerDelay): Deleted.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r246811 r246818  
     12019-06-25  Timothy Hatcher  <timothy@apple.com>
     2
     3        Clicking the up/down spin buttons for a number input increments/decrements by 2.
     4        https://bugs.webkit.org/show_bug.cgi?id=198809
     5
     6        Reviewed by Tim Horton.
     7
     8        AppKit no longer registers NSScrollerButtonDelay and NSScrollerButtonPeriod in the base
     9        NSUserDefaults for an app. This caused our use to always get 0s when setting the click
     10        and hold timer, causing the value to increment quickly for a single press.
     11
     12        * platform/mac/ScrollbarThemeMac.h:
     13        (WebCore::ScrollbarThemeMac::initialAutoscrollTimerDelay): Added. Hardcode 500ms.
     14        (WebCore::ScrollbarThemeMac::autoscrollTimerDelay): Added. Hardcode 50ms.
     15        * platform/mac/ScrollbarThemeMac.mm:
     16        (WebCore::ScrollbarThemeMac::preferencesChanged): Removed use of old user defaults.
     17        (WebCore::ScrollbarThemeMac::initialAutoscrollTimerDelay): Deleted.
     18        (WebCore::ScrollbarThemeMac::autoscrollTimerDelay): Deleted.
     19
    1202019-06-25  Keith Miller  <keith_miller@apple.com>
    221
  • trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.h

    r239689 r246818  
    5353    void updateScrollbarOverlayStyle(Scrollbar&)  override;
    5454
    55     Seconds initialAutoscrollTimerDelay() override;
    56     Seconds autoscrollTimerDelay() override;
     55    Seconds initialAutoscrollTimerDelay() override { return 500_ms; }
     56    Seconds autoscrollTimerDelay() override { return 50_ms; }
    5757
    5858    ScrollbarButtonsPlacement buttonsPlacement() const override;
  • trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.mm

    r239847 r246818  
    137137static const int cOuterButtonOverlap = 2;
    138138
    139 static Seconds gInitialButtonDelay { 500_ms };
    140 static Seconds gAutoscrollButtonDelay { 50_ms };
    141139static bool gJumpOnTrackClick = false;
    142140static bool gUsesOverlayScrollbars = false;
     
    241239    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    242240    [defaults synchronize];
    243     gInitialButtonDelay = Seconds { [defaults floatForKey:@"NSScrollerButtonDelay"] };
    244     gAutoscrollButtonDelay = Seconds { [defaults floatForKey:@"NSScrollerButtonPeriod"] };
    245241    gJumpOnTrackClick = [defaults boolForKey:@"AppleScrollerPagingBehavior"];
    246242    usesOverlayScrollbarsChanged();
     
    284280}
    285281
    286 Seconds ScrollbarThemeMac::initialAutoscrollTimerDelay()
    287 {
    288     return gInitialButtonDelay;
    289 }
    290 
    291 Seconds ScrollbarThemeMac::autoscrollTimerDelay()
    292 {
    293     return gAutoscrollButtonDelay;
    294 }
    295    
    296282ScrollbarButtonsPlacement ScrollbarThemeMac::buttonsPlacement() const
    297283{
Note: See TracChangeset for help on using the changeset viewer.