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

Changeset 277482 in webkit


Ignore:
Timestamp:
May 13, 2021, 10:52:46 PM (5 years ago)
Author:
Carlos Garcia Campos
Message:

[GTK] Wrong smooth animation sometimes with non-async scrolling
​https://bugs.webkit.org/show_bug.cgi?id=225764

Reviewed by Adrian Perez de Castro.

This is happening because sometimes when the scrollbars are added to the scroll view, the contents size hasn't
been updated yet, so that values saved by ScrollAnimationSmooth::updateVisibleLengths() are 0x0. After that the
updateVisibleLengths() is not called again when the contents size is updated, so scroll happens with the wrong
visible lengths. This doesn't happen with async scrolling because updateVisibleLengths() is called every time
layers are repositioned. For non-async scrolling it should be enough to update visible lengths when he contents
size changes.

  • platform/ScrollAnimator.cpp:

(WebCore::ScrollAnimator::contentsResized const):

  • platform/ScrollAnimator.h:

(WebCore::ScrollAnimator::ScrollAnimator::contentsResized const):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r277481 r277482  
     12021-05-13  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] Wrong smooth animation sometimes with non-async scrolling
     4        https://bugs.webkit.org/show_bug.cgi?id=225764
     5
     6        Reviewed by Adrian Perez de Castro.
     7
     8        This is happening because sometimes when the scrollbars are added to the scroll view, the contents size hasn't
     9        been updated yet, so that values saved by ScrollAnimationSmooth::updateVisibleLengths() are 0x0. After that the
     10        updateVisibleLengths() is not called again when the contents size is updated, so scroll happens with the wrong
     11        visible lengths. This doesn't happen with async scrolling because updateVisibleLengths()  is called every time
     12        layers are repositioned. For non-async scrolling it should be enough to update visible lengths when he contents
     13        size changes.
     14
     15        * platform/ScrollAnimator.cpp:
     16        (WebCore::ScrollAnimator::contentsResized const):
     17        * platform/ScrollAnimator.h:
     18        (WebCore::ScrollAnimator::ScrollAnimator::contentsResized const):
     19
    1202021-05-13  Devin Rousso  <drousso@apple.com>
    221
  • trunk/Source/WebCore/platform/ScrollAnimator.cpp

    r277350 r277482  
    380380}
    381381
     382void ScrollAnimator::contentsResized() const
     383{
     384    m_scrollAnimation->updateVisibleLengths();
     385}
     386
    382387void ScrollAnimator::willEndLiveResize()
    383388{
  • trunk/Source/WebCore/platform/ScrollAnimator.h

    r277350 r277482  
    112112    virtual void mouseIsDownInScrollbar(Scrollbar*, bool) const { }
    113113    virtual void willStartLiveResize() { }
    114     virtual void contentsResized() const { }
     114    virtual void contentsResized() const;
    115115    virtual void willEndLiveResize();
    116116    virtual void contentAreaDidShow() { }
Note: See TracChangeset for help on using the changeset viewer.