Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: dc3e66efee5b3ab0c2be1def4e3539a9dd178c66
      
https://github.com/WebKit/WebKit/commit/dc3e66efee5b3ab0c2be1def4e3539a9dd178c66
  Author: Wenson Hsieh <[email protected]>
  Date:   2023-04-19 (Wed, 19 Apr 2023)

  Changed paths:
    M LayoutTests/TestExpectations
    A 
LayoutTests/css3/scroll-snap/ios/scroll-snap-mainframe-scroll-deceleration-with-obscured-inset-expected.txt
    A 
LayoutTests/css3/scroll-snap/ios/scroll-snap-mainframe-scroll-deceleration-with-obscured-inset.html
    M LayoutTests/platform/ios-wk2/TestExpectations
    M 
Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm
    M Tools/WebKitTestRunner/TestOptions.cpp
    M Tools/WebKitTestRunner/TestOptions.h
    M Tools/WebKitTestRunner/ios/TestControllerIOS.mm

  Log Message:
  -----------
  [iOS] Scrolling snaps to previous snap point when tapping during a scroll 
snap in mainframe
https://bugs.webkit.org/show_bug.cgi?id=255670
rdar://108008480

Reviewed by Tim Horton.

When interrupting scroll view deceleration with a tap gesture, we re-run logic 
to retarget the snap
offset given the current scroll offset and the projected (original) scroll 
offset where we would've
ended up scrolling. In an overflow region where this bug does *not* reproduce, 
the current offset is
equal to the projected offset, so we simply retarget to the closest snap point.

However, in a mainframe scroll snapping context where the bug reproduces, the 
projected snap offset
is off by an amount equal to the top obscured inset, which means that instead 
of defaulting to the
closest snap position, we'll instead always retarget the previous snap point. 
To fix this, we simply
apply this same adjustment to this projected offset.

Test: 
css3/scroll-snap/ios/scroll-snap-mainframe-scroll-deceleration-with-obscured-inset.html

* LayoutTests/TestExpectations:
* 
LayoutTests/css3/scroll-snap/ios/scroll-snap-mainframe-scroll-deceleration-with-obscured-inset-expected.txt:
 Added.
* 
LayoutTests/css3/scroll-snap/ios/scroll-snap-mainframe-scroll-deceleration-with-obscured-inset.html:
 Added.

Add a layout test to exercise this change, by scrolling via a swipe gesture, 
tapping, and verifying
that we don't snap back to the start.

* LayoutTests/platform/ios-wk2/TestExpectations:
* 
Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxyIOS::adjustTargetContentOffsetForSnapping):

Offset the projected offset by the top obscured inset, for consistency with the 
current offset.

* Tools/WebKitTestRunner/TestOptions.cpp:
(WTR::TestOptions::defaults):
(WTR::TestOptions::keyTypeMapping):
* Tools/WebKitTestRunner/TestOptions.h:
(WTR::TestOptions::obscuredInsetTop const):
* Tools/WebKitTestRunner/ios/TestControllerIOS.mm:
(WTR::TestController::platformResetStateToConsistentValues):

Add a new test option to specify a top obscured inset value on the web view.

Canonical link: https://commits.webkit.org/263158@main


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to