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

Changeset 283360 in webkit


Ignore:
Timestamp:
Oct 1, 2021, 2:10:30 AM (5 years ago)
Author:
svillar@igalia.com
Message:

Clamp negative offset values
https://bugs.webkit.org/show_bug.cgi?id=230707

Reviewed by Simon Fraser.

ScrollOffsets are the values used by scrollbars and thus should be always positive. Under some circumstances
the value returned by maximumScrollOffset()|minimumScrollOffset() could be negative. For those cases we should
just clamp them to zero.

  • page/scrolling/ScrollSnapOffsetsInfo.cpp:

(WebCore::updateSnapOffsetsForScrollableArea):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r283359 r283360  
     12021-09-30  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        Clamp negative offset values
     4        https://bugs.webkit.org/show_bug.cgi?id=230707
     5
     6        Reviewed by Simon Fraser.
     7
     8        ScrollOffsets are the values used by scrollbars and thus should be always positive. Under some circumstances
     9        the value returned by maximumScrollOffset()|minimumScrollOffset() could be negative. For those cases we should
     10        just clamp them to zero.
     11
     12        * page/scrolling/ScrollSnapOffsetsInfo.cpp:
     13        (WebCore::updateSnapOffsetsForScrollableArea):
     14
    1152021-10-01  Kevin Turner  <kevin_turner@apple.com>
    216
  • trunk/Source/WebCore/page/scrolling/ScrollSnapOffsetsInfo.cpp

    r283100 r283360  
    306306
    307307    auto maxScrollOffset = scrollableArea.maximumScrollOffset();
     308    maxScrollOffset.clampNegativeToZero();
    308309    auto scrollPosition = LayoutPoint { scrollableArea.scrollPosition() };
    309310
Note: See TracChangeset for help on using the changeset viewer.