Changeset 239984 in webkit


Ignore:
Timestamp:
Jan 15, 2019 7:46:19 AM (5 years ago)
Author:
Antti Koivisto
Message:

Remove unused fields from Scrollbar
https://bugs.webkit.org/show_bug.cgi?id=193442

Reviewed by Zalan Bujtas.

  • platform/Scrollbar.cpp:

(WebCore::Scrollbar::Scrollbar):

  • platform/Scrollbar.h:

(WebCore::Scrollbar::isCustomScrollbar const):

Make virtual so it doesn't need a bit.

(WebCore::Scrollbar::isAlphaLocked const): Deleted.
(WebCore::Scrollbar::setIsAlphaLocked): Deleted.

  • platform/mac/ScrollAnimatorMac.mm:

(WebCore::ScrollAnimatorMac::shouldScrollbarParticipateInHitTesting):

  • rendering/RenderScrollbar.cpp:

(WebCore::RenderScrollbar::RenderScrollbar):

  • rendering/RenderScrollbar.h:
Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r239983 r239984  
     12019-01-15  Antti Koivisto  <antti@apple.com>
     2
     3        Remove unused fields from Scrollbar
     4        https://bugs.webkit.org/show_bug.cgi?id=193442
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        * platform/Scrollbar.cpp:
     9        (WebCore::Scrollbar::Scrollbar):
     10        * platform/Scrollbar.h:
     11        (WebCore::Scrollbar::isCustomScrollbar const):
     12
     13        Make virtual so it doesn't need a bit.
     14
     15        (WebCore::Scrollbar::isAlphaLocked const): Deleted.
     16        (WebCore::Scrollbar::setIsAlphaLocked): Deleted.
     17        * platform/mac/ScrollAnimatorMac.mm:
     18        (WebCore::ScrollAnimatorMac::shouldScrollbarParticipateInHitTesting):
     19        * rendering/RenderScrollbar.cpp:
     20        (WebCore::RenderScrollbar::RenderScrollbar):
     21        * rendering/RenderScrollbar.h:
     22
    1232019-01-15  Zalan Bujtas  <zalan@apple.com>
    224
  • trunk/Source/WebCore/platform/Scrollbar.cpp

    r237266 r239984  
    5555}
    5656
    57 Scrollbar::Scrollbar(ScrollableArea& scrollableArea, ScrollbarOrientation orientation, ScrollbarControlSize controlSize, ScrollbarTheme* customTheme, bool isCustomScrollbar)
     57Scrollbar::Scrollbar(ScrollableArea& scrollableArea, ScrollbarOrientation orientation, ScrollbarControlSize controlSize, ScrollbarTheme* customTheme)
    5858    : m_scrollableArea(scrollableArea)
    5959    , m_orientation(orientation)
    6060    , m_controlSize(controlSize)
    6161    , m_theme(customTheme ? *customTheme : ScrollbarTheme::theme())
    62     , m_visibleSize(0)
    63     , m_totalSize(0)
    64     , m_currentPos(0)
    65     , m_dragOrigin(0)
    66     , m_lineStep(0)
    67     , m_pageStep(0)
    68     , m_pixelStep(1)
    69     , m_hoveredPart(NoPart)
    70     , m_pressedPart(NoPart)
    71     , m_pressedPos(0)
    72     , m_scrollPos(0)
    73     , m_draggingDocument(false)
    74     , m_documentDragPos(0)
    75     , m_enabled(true)
    7662    , m_scrollTimer(*this, &Scrollbar::autoscrollTimerFired)
    77     , m_suppressInvalidation(false)
    78     , m_isAlphaLocked(false)
    79     , m_isCustomScrollbar(isCustomScrollbar)
    8063{
    8164    theme().registerScrollbar(*this);
  • trunk/Source/WebCore/platform/Scrollbar.h

    r237266 r239984  
    5757    ScrollableArea& scrollableArea() const { return m_scrollableArea; }
    5858
    59     bool isCustomScrollbar() const { return m_isCustomScrollbar; }
     59    virtual bool isCustomScrollbar() const { return false; }
    6060    ScrollbarOrientation orientation() const { return m_orientation; }
    6161
     
    125125    void moveThumb(int pos, bool draggingDocument = false);
    126126
    127     bool isAlphaLocked() const { return m_isAlphaLocked; }
    128     void setIsAlphaLocked(bool flag) { m_isAlphaLocked = flag; }
    129 
     127#if !PLATFORM(COCOA)
    130128    float opacity() const { return m_opacity; }
    131129    void setOpacity(float opacity) { m_opacity = opacity; }
     130#endif
    132131
    133132    bool supportsUpdateOnSecondaryThread() const;
    134133
    135134protected:
    136     Scrollbar(ScrollableArea&, ScrollbarOrientation, ScrollbarControlSize, ScrollbarTheme* = 0, bool isCustomScrollbar = false);
     135    Scrollbar(ScrollableArea&, ScrollbarOrientation, ScrollbarControlSize, ScrollbarTheme* = nullptr);
    137136
    138137    void updateThumb();
     
    152151    ScrollbarTheme& m_theme;
    153152
    154     int m_visibleSize;
    155     int m_totalSize;
    156     float m_currentPos;
    157     float m_dragOrigin;
    158     int m_lineStep;
    159     int m_pageStep;
    160     float m_pixelStep;
     153    int m_visibleSize { 0 };
     154    int m_totalSize { 0 };
     155    float m_currentPos { 0 };
     156    float m_dragOrigin { 0 };
     157    int m_lineStep { 0 };
     158    int m_pageStep { 0 };
     159    float m_pixelStep { 1 };
    161160
    162     ScrollbarPart m_hoveredPart;
    163     ScrollbarPart m_pressedPart;
    164     int m_pressedPos;
    165     float m_scrollPos;
    166     bool m_draggingDocument;
    167     int m_documentDragPos;
     161    ScrollbarPart m_hoveredPart { NoPart };
     162    ScrollbarPart m_pressedPart { NoPart };
     163    int m_pressedPos { 0 };
     164    bool m_draggingDocument { false };
     165    int m_documentDragPos { 0 };
    168166
    169     bool m_enabled;
     167    bool m_enabled { true };
    170168
    171169    Timer m_scrollTimer;
    172170
    173     bool m_suppressInvalidation;
     171    bool m_suppressInvalidation { false };
    174172
    175     bool m_isAlphaLocked;
    176 
    177     bool m_isCustomScrollbar;
    178 
     173#if !PLATFORM(COCOA)
    179174    float m_opacity { 1 };
     175#endif
    180176
    181177private:
  • trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm

    r239904 r239984  
    11261126        return true;
    11271127
    1128     if (scrollbar->isAlphaLocked())
    1129         return true;
    1130 
    11311128    // Overlay scrollbars should participate in hit testing whenever they are at all visible.
    11321129    NSScrollerImp *painter = scrollerImpForScrollbar(*scrollbar);
  • trunk/Source/WebCore/rendering/RenderScrollbar.cpp

    r233872 r239984  
    4343
    4444RenderScrollbar::RenderScrollbar(ScrollableArea& scrollableArea, ScrollbarOrientation orientation, Element* ownerElement, Frame* owningFrame)
    45     : Scrollbar(scrollableArea, orientation, RegularScrollbar, RenderScrollbarTheme::renderScrollbarTheme(), true)
     45    : Scrollbar(scrollableArea, orientation, RegularScrollbar, RenderScrollbarTheme::renderScrollbarTheme())
    4646    , m_ownerElement(ownerElement)
    4747    , m_owningFrame(owningFrame)
  • trunk/Source/WebCore/rendering/RenderScrollbar.h

    r216541 r239984  
    5555    int minimumThumbLength();
    5656
    57     bool isOverlayScrollbar() const override { return false; }
    58 
    5957    float opacity();
    6058
     
    6361private:
    6462    RenderScrollbar(ScrollableArea&, ScrollbarOrientation, Element*, Frame*);
     63
     64    bool isCustomScrollbar() const override { return true; }
     65    bool isOverlayScrollbar() const override { return false; }
    6566
    6667    void setParent(ScrollView*) override;
Note: See TracChangeset for help on using the changeset viewer.