• trchen@chromium.org's avatar
    Refactor ScrollView::updateScrollbars() · 336cdb95
    trchen@chromium.org authored
    This CL splits ScrollView::updateScrollbars() into 3 independent helper
    functions, namely:
    
    computeScrollbarExistence() computes whether scrollbars are needed given
    the current ScrollView state.
    
    adjustScrollbarExistence() creates/removes scrollbars and invoke appropriate
    callbacks to update layout (if applicable).
    
    updateScrollbarGeometry() positions the scrollbars and pushes the scroll
    extents.
    
    Also we no longer do update scrollbar passes in recursion. Instead we do
    it in a loop and early exits if updateScrollbars() is re-entered.
    
    No tests as there should be no behavior difference.
    
    Review URL: https://codereview.chromium.org/314583008
    
    git-svn-id: svn://svn.chromium.org/blink/trunk@175852 bbb929c8-8fbe-4397-9dbb-9b2b20218538
    336cdb95
ScrollView.h 16.8 KB