⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 185431 in webkit


Ignore:
Timestamp:
Jun 10, 2015, 2:53:42 PM (11 years ago)
Author:
Beth Dakin
Message:

Overriding the overlay scrollbar style on WKView doesn't take effect immediately
​https://bugs.webkit.org/show_bug.cgi?id=145855
-and corresponding-
rdar://problem/20948706

Reviewed by Simon Fraser.

Since we opt into layer-per-part scrollbars in order to move the knob on the
secondary thread, AppKit is creating its own layers for the knob and track. To
invalidate them, we need to call into the ScrollbarPainter’s setNeedsDisplay.

New virtual function on ScrollAnimator to call into ScrollbarPainter’s
setNeedsDispay.

  • platform/ScrollAnimator.h:

Call the new function when setting the overlay style.

  • platform/ScrollableArea.cpp:

(WebCore::ScrollableArea::setScrollbarOverlayStyle):

Add setNeedsDisplay to the list of ScrollbarPainter methods.

  • platform/mac/NSScrollerImpDetails.h:

Implement invalidateScrollbarPartLayers.

  • platform/mac/ScrollAnimatorMac.h:
  • platform/mac/ScrollAnimatorMac.mm:

(WebCore::ScrollAnimatorMac::invalidateScrollbarPartLayers):

Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r185429 r185431  
     12015-06-10  Beth Dakin  <bdakin@apple.com>
     2
     3        Overriding the overlay scrollbar style on WKView doesn't take effect immediately
     4        https://bugs.webkit.org/show_bug.cgi?id=145855
     5        -and corresponding-
     6        rdar://problem/20948706
     7
     8        Reviewed by Simon Fraser.
     9
     10        Since we opt into layer-per-part scrollbars in order to move the knob on the
     11        secondary thread, AppKit is creating its own layers for the knob and track. To
     12        invalidate them, we need to call into the ScrollbarPainter’s setNeedsDisplay.
     13
     14        New virtual function on ScrollAnimator to call into ScrollbarPainter’s
     15        setNeedsDispay.
     16        * platform/ScrollAnimator.h:
     17
     18        Call the new function when setting the overlay style.
     19        * platform/ScrollableArea.cpp:
     20        (WebCore::ScrollableArea::setScrollbarOverlayStyle):
     21
     22        Add setNeedsDisplay to the list of ScrollbarPainter methods.
     23        * platform/mac/NSScrollerImpDetails.h:
     24
     25        Implement invalidateScrollbarPartLayers.
     26        * platform/mac/ScrollAnimatorMac.h:
     27        * platform/mac/ScrollAnimatorMac.mm:
     28        (WebCore::ScrollAnimatorMac::invalidateScrollbarPartLayers):
     29
    1302015-06-10  Matt Rajca  <mrajca@apple.com>
    231
  • trunk/Source/WebCore/platform/ScrollAnimator.h

    r184728 r185431  
    111111    virtual void willRemoveHorizontalScrollbar(Scrollbar*) { }
    112112
     113    virtual void invalidateScrollbarPartLayers(Scrollbar*) { }
     114
    113115    virtual void verticalScrollbarLayerDidChange() { }
    114116    virtual void horizontalScrollbarLayerDidChange() { }
  • trunk/Source/WebCore/platform/ScrollableArea.cpp

    r184596 r185431  
    342342        ScrollbarTheme::theme()->updateScrollbarOverlayStyle(horizontalScrollbar());
    343343        horizontalScrollbar()->invalidate();
     344        if (ScrollAnimator* scrollAnimator = existingScrollAnimator())
     345            scrollAnimator->invalidateScrollbarPartLayers(horizontalScrollbar());
    344346    }
    345347   
    … …  
    347349        ScrollbarTheme::theme()->updateScrollbarOverlayStyle(verticalScrollbar());
    348350        verticalScrollbar()->invalidate();
     351        if (ScrollAnimator* scrollAnimator = existingScrollAnimator())
     352            scrollAnimator->invalidateScrollbarPartLayers(verticalScrollbar());
    349353    }
    350354}
  • trunk/Source/WebCore/platform/mac/NSScrollerImpDetails.h

    r172346 r185431  
    6363- (void)mouseEnteredScroller;
    6464- (void)mouseExitedScroller;
     65#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
     66- (void)setNeedsDisplay:(BOOL)flag;
     67#endif
    6568@end
    6669
  • trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.h

    r184513 r185431  
    116116    virtual void willRemoveHorizontalScrollbar(Scrollbar*);
    117117
     118    void invalidateScrollbarPartLayers(Scrollbar*) override;
     119
    118120    virtual void verticalScrollbarLayerDidChange();
    119121    virtual void horizontalScrollbarLayerDidChange();
  • trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm

    r184728 r185431  
    10121012}
    10131013
     1014#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
     1015void ScrollAnimatorMac::invalidateScrollbarPartLayers(Scrollbar* scrollbar)
     1016{
     1017    ScrollbarPainter painter = scrollbarPainterForScrollbar(scrollbar);
     1018    [painter setNeedsDisplay:YES];
     1019}
     1020#else
     1021void ScrollAnimatorMac::invalidateScrollbarPartLayers(Scrollbar*)
     1022{
     1023}
     1024#endif
     1025
    10141026void ScrollAnimatorMac::verticalScrollbarLayerDidChange()
    10151027{
Note: See TracChangeset for help on using the changeset viewer.