Title: [283360] trunk/Source/WebCore
Revision
283360
Author
[email protected]
Date
2021-10-01 02:10:30 -0700 (Fri, 01 Oct 2021)

Log 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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (283359 => 283360)


--- trunk/Source/WebCore/ChangeLog	2021-10-01 07:58:12 UTC (rev 283359)
+++ trunk/Source/WebCore/ChangeLog	2021-10-01 09:10:30 UTC (rev 283360)
@@ -1,3 +1,17 @@
+2021-09-30  Sergio Villar Senin  <[email protected]>
+
+        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):
+
 2021-10-01  Kevin Turner  <[email protected]>
 
         Add support for pow(), sqrt() and hypot()

Modified: trunk/Source/WebCore/page/scrolling/ScrollSnapOffsetsInfo.cpp (283359 => 283360)


--- trunk/Source/WebCore/page/scrolling/ScrollSnapOffsetsInfo.cpp	2021-10-01 07:58:12 UTC (rev 283359)
+++ trunk/Source/WebCore/page/scrolling/ScrollSnapOffsetsInfo.cpp	2021-10-01 09:10:30 UTC (rev 283360)
@@ -305,6 +305,7 @@
     Vector<LayoutRect> snapAreas;
 
     auto maxScrollOffset = scrollableArea.maximumScrollOffset();
+    maxScrollOffset.clampNegativeToZero();
     auto scrollPosition = LayoutPoint { scrollableArea.scrollPosition() };
 
     auto [scrollerXAxisFlipped, scrollerYAxisFlipped] = axesFlippedForWritingModeAndDirection(writingMode, textDirection);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to