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

Changeset 245743 in webkit


Ignore:
Timestamp:
May 23, 2019, 10:27:33 PM (7 years ago)
Author:
bshafiei@apple.com
Message:

Cherry-pick r245742. rdar://problem/49720087

With async overflow scrolling, programmatic scroll to a negative offset fails to clamp the scroll offset
https://bugs.webkit.org/show_bug.cgi?id=198208
<rdar://problem/49720087>

Reviewed by Zalan Bujtas.

Source/WebCore:

RenderLayer::scrollToOffset() needs to pass the clamped offset to scrollingCoordinator->requestScrollPositionUpdate(),
otherwise the scrolling tree will round-trip a negative value and scrollLeft will end up negative.

Test: fast/scrolling/programmatic-scroll-to-negative-offset.html

  • rendering/RenderLayer.cpp: (WebCore::RenderLayer::scrollToOffset):

LayoutTests:

  • fast/scrolling/programmatic-scroll-to-negative-offset-expected.txt: Added.
  • fast/scrolling/programmatic-scroll-to-negative-offset.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245742 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-608.1.24.20-branch
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-608.1.24.20-branch/LayoutTests/ChangeLog

    r245690 r245743  
     12019-05-23  Babak Shafiei  <bshafiei@apple.com>
     2
     3        Cherry-pick r245742. rdar://problem/49720087
     4
     5    With async overflow scrolling, programmatic scroll to a negative offset fails to clamp the scroll offset
     6    https://bugs.webkit.org/show_bug.cgi?id=198208
     7    <rdar://problem/49720087>
     8   
     9    Reviewed by Zalan Bujtas.
     10   
     11    Source/WebCore:
     12   
     13    RenderLayer::scrollToOffset() needs to pass the clamped offset to scrollingCoordinator->requestScrollPositionUpdate(),
     14    otherwise the scrolling tree will round-trip a negative value and scrollLeft will end up negative.
     15   
     16    Test: fast/scrolling/programmatic-scroll-to-negative-offset.html
     17   
     18    * rendering/RenderLayer.cpp:
     19    (WebCore::RenderLayer::scrollToOffset):
     20   
     21    LayoutTests:
     22   
     23    * fast/scrolling/programmatic-scroll-to-negative-offset-expected.txt: Added.
     24    * fast/scrolling/programmatic-scroll-to-negative-offset.html: Added.
     25   
     26   
     27    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245742 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     28
     29    2019-05-23  Simon Fraser  <simon.fraser@apple.com>
     30
     31            With async overflow scrolling, programmatic scroll to a negative offset fails to clamp the scroll offset
     32            https://bugs.webkit.org/show_bug.cgi?id=198208
     33            <rdar://problem/49720087>
     34
     35            Reviewed by Zalan Bujtas.
     36
     37            * fast/scrolling/programmatic-scroll-to-negative-offset-expected.txt: Added.
     38            * fast/scrolling/programmatic-scroll-to-negative-offset.html: Added.
     39
    1402019-05-23  Kocsen Chung  <kocsen_chung@apple.com>
    241
  • branches/safari-608.1.24.20-branch/Source/WebCore/ChangeLog

    r245632 r245743  
     12019-05-23  Babak Shafiei  <bshafiei@apple.com>
     2
     3        Cherry-pick r245742. rdar://problem/49720087
     4
     5    With async overflow scrolling, programmatic scroll to a negative offset fails to clamp the scroll offset
     6    https://bugs.webkit.org/show_bug.cgi?id=198208
     7    <rdar://problem/49720087>
     8   
     9    Reviewed by Zalan Bujtas.
     10   
     11    Source/WebCore:
     12   
     13    RenderLayer::scrollToOffset() needs to pass the clamped offset to scrollingCoordinator->requestScrollPositionUpdate(),
     14    otherwise the scrolling tree will round-trip a negative value and scrollLeft will end up negative.
     15   
     16    Test: fast/scrolling/programmatic-scroll-to-negative-offset.html
     17   
     18    * rendering/RenderLayer.cpp:
     19    (WebCore::RenderLayer::scrollToOffset):
     20   
     21    LayoutTests:
     22   
     23    * fast/scrolling/programmatic-scroll-to-negative-offset-expected.txt: Added.
     24    * fast/scrolling/programmatic-scroll-to-negative-offset.html: Added.
     25   
     26   
     27    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245742 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     28
     29    2019-05-23  Simon Fraser  <simon.fraser@apple.com>
     30
     31            With async overflow scrolling, programmatic scroll to a negative offset fails to clamp the scroll offset
     32            https://bugs.webkit.org/show_bug.cgi?id=198208
     33            <rdar://problem/49720087>
     34
     35            Reviewed by Zalan Bujtas.
     36
     37            RenderLayer::scrollToOffset() needs to pass the clamped offset to scrollingCoordinator->requestScrollPositionUpdate(),
     38            otherwise the scrolling tree will round-trip a negative value and scrollLeft will end up negative.
     39
     40            Test: fast/scrolling/programmatic-scroll-to-negative-offset.html
     41
     42            * rendering/RenderLayer.cpp:
     43            (WebCore::RenderLayer::scrollToOffset):
     44
    1452019-05-22  Kocsen Chung  <kocsen_chung@apple.com>
    246
  • branches/safari-608.1.24.20-branch/Source/WebCore/rendering/RenderLayer.cpp

    r245630 r245743  
    24222422void RenderLayer::scrollToOffset(const ScrollOffset& scrollOffset, ScrollType scrollType, ScrollClamping clamping)
    24232423{
    2424     ScrollOffset newScrollOffset = clamping == ScrollClamping::Clamped ? clampScrollOffset(scrollOffset) : scrollOffset;
    2425     if (newScrollOffset == this->scrollOffset())
     2424    ScrollOffset clampedScrollOffset = clamping == ScrollClamping::Clamped ? clampScrollOffset(scrollOffset) : scrollOffset;
     2425    if (clampedScrollOffset == this->scrollOffset())
    24262426        return;
    24272427
     
    24322432#if ENABLE(ASYNC_SCROLLING)
    24332433    if (ScrollingCoordinator* scrollingCoordinator = page().scrollingCoordinator())
    2434         handled = scrollingCoordinator->requestScrollPositionUpdate(*this, scrollPositionFromOffset(scrollOffset));
     2434        handled = scrollingCoordinator->requestScrollPositionUpdate(*this, scrollPositionFromOffset(clampedScrollOffset));
    24352435#endif
    24362436
    24372437    if (!handled)
    2438         scrollToOffsetWithoutAnimation(newScrollOffset, clamping);
     2438        scrollToOffsetWithoutAnimation(clampedScrollOffset, clamping);
    24392439
    24402440    setCurrentScrollType(previousScrollType);
Note: See TracChangeset for help on using the changeset viewer.