WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-213571-20210320132056.patch (text/plain), 6.66 KB, created by
Martin Robinson
on 2021-03-20 05:20:58 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Martin Robinson
Created:
2021-03-20 05:20:58 PDT
Size:
6.66 KB
patch
obsolete
>Subversion Revision: 274750 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index ad92269981d79d2b1ff7028fde28a00e7c4437f2..431922db40ac353c689a59ce05221214bb9e75ff 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,23 @@ >+2021-03-19 Martin Robinson <mrobinson@igalia.com> >+ >+ No scrolling momentum with 'scroll-snap-type: x mandatory' if the scroller scrolls vertically >+ https://bugs.webkit.org/show_bug.cgi?id=213571 >+ <rdar://problem/64715507> >+ >+ Reviewed by Simon Fraser. >+ >+ When handling momentum scrolling for scroll containers that snap, use the >+ predicted momentum scroll destination for axes that do not snap. Using >+ the initial scroll offset here was causing momentum scrolling in these axes >+ to end prematurely. >+ >+ Test: tiled-drawing/scrolling/scroll-snap/scroll-snap-momentum-in-non-snapping-axis.html >+ >+ * platform/ScrollSnapAnimatorState.cpp: >+ (WebCore::ScrollSnapAnimatorState::targetOffsetForStartOffset const): Use the predicted >+ scroll offset. Even though the startOffset parameter is no longer used, do not remove >+ it because it will be used in the fix for https://bugs.webkit.org/show_bug.cgi?id=223406. >+ > 2021-03-19 Dean Jackson <dino@apple.com> > > Link against the ANGLE Shared Library >diff --git a/Source/WebCore/platform/ScrollSnapAnimatorState.cpp b/Source/WebCore/platform/ScrollSnapAnimatorState.cpp >index 57f299ad45f0fa1433f696c7ae7170bb3a815c1a..da9792d0758fd1c5772f7f63d126927ec006572e 100644 >--- a/Source/WebCore/platform/ScrollSnapAnimatorState.cpp >+++ b/Source/WebCore/platform/ScrollSnapAnimatorState.cpp >@@ -96,7 +96,7 @@ float ScrollSnapAnimatorState::targetOffsetForStartOffset(ScrollEventAxis axis, > const auto& snapOffsets = m_snapOffsetsInfo.offsetsForAxis(axis); > if (snapOffsets.isEmpty()) { > outActiveSnapIndex = invalidSnapOffsetIndex; >- return clampTo<float>(startOffset, 0, maxScrollOffset); >+ return clampTo<float>(predictedOffset, 0, maxScrollOffset); > } > > float targetOffset = m_snapOffsetsInfo.closestSnapOffset(axis, LayoutUnit(predictedOffset / pageScale), initialDelta, LayoutUnit(startOffset / pageScale)).first; >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 567ba48360ad7122bdd4d852da22ad5ae02b4e0e..a68c15d45157a66f9d749b8b57af35ccf07d087a 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,14 @@ >+2021-03-19 Martin Robinson <mrobinson@igalia.com> >+ >+ No scrolling momentum with 'scroll-snap-type: x mandatory' if the scroller scrolls vertically >+ https://bugs.webkit.org/show_bug.cgi?id=213571 >+ <rdar://problem/64715507> >+ >+ Reviewed by Simon Fraser. >+ >+ * tiled-drawing/scrolling/scroll-snap/scroll-snap-momentum-in-non-snapping-axis-expected.txt: Added. >+ * tiled-drawing/scrolling/scroll-snap/scroll-snap-momentum-in-non-snapping-axis.html: Added. >+ > 2021-03-19 Chris Dumez <cdumez@apple.com> > > Resync webaudio web-platform-tests from upstream >diff --git a/LayoutTests/tiled-drawing/scrolling/scroll-snap/scroll-snap-momentum-in-non-snapping-axis-expected.txt b/LayoutTests/tiled-drawing/scrolling/scroll-snap/scroll-snap-momentum-in-non-snapping-axis-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..ad0e5d20767622f64a5e27ef319e3d34b21a3c88 >--- /dev/null >+++ b/LayoutTests/tiled-drawing/scrolling/scroll-snap/scroll-snap-momentum-in-non-snapping-axis-expected.txt >@@ -0,0 +1,5 @@ >+PASS scrolling momentum the same in snapping and non-snapping axes. >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/tiled-drawing/scrolling/scroll-snap/scroll-snap-momentum-in-non-snapping-axis.html b/LayoutTests/tiled-drawing/scrolling/scroll-snap/scroll-snap-momentum-in-non-snapping-axis.html >new file mode 100644 >index 0000000000000000000000000000000000000000..3f596189bf3a49a26909c318e75793dcfea0bcfd >--- /dev/null >+++ b/LayoutTests/tiled-drawing/scrolling/scroll-snap/scroll-snap-momentum-in-non-snapping-axis.html >@@ -0,0 +1,68 @@ >+<!DOCTYPE HTML> >+<html> >+ <head> >+ <style> >+ .container { >+ width: 200px; >+ height: 200px; >+ overflow: scroll; >+ } >+ #vertical-snapping-container { scroll-snap-type: y proximity; } >+ #bidirectional-snapping-container { scroll-snap-type: both proximity; } >+ .box { >+ height: 100vh; >+ width: 100vw; >+ float: left; >+ scroll-snap-align: start; >+ } >+ </style> >+ <script src="../../../resources/js-test.js"></script> >+ <script src="../../../resources/ui-helper.js"></script> >+ <script src="resources/mainframe-scroll-snap-test.js"></script> >+ <script> >+ window.jsTestIsAsync = true; >+ >+ async function runTests() >+ { >+ try { >+ const containerNotSnappingOnAxis = document.getElementById("vertical-snapping-container"); >+ await doScrollGlide(containerNotSnappingOnAxis, HORIZONTAL); >+ const containerSnappingOnAxis = document.getElementById("bidirectional-snapping-container"); >+ await doScrollGlide(containerSnappingOnAxis, HORIZONTAL); >+ expectTrue(containerSnappingOnAxis.scrollLeft == containerNotSnappingOnAxis.scrollLeft, "scrolling momentum the same in snapping and non-snapping axes."); >+ } catch (e) { >+ console.log(e); >+ } finally { >+ finishJSTest(); >+ } >+ } >+ >+ function onLoad() >+ { >+ if (window.eventSender) { >+ internals.setPlatformMomentumScrollingPredictionEnabled(false); >+ runTests(); >+ } else { >+ var messageLocation = document.getElementById('console'); >+ messageLocation.innerHTML = "<p>To run this test manually, scroll the page vertically. The page should " >+ + "snap between uniform colors which fill the view.<p>"; >+ } >+ } >+ </script> >+ </head> >+ <body onload="onLoad();"> >+ <div id="console"></div> >+ <div id="vertical-snapping-container" class="container"> >+ <div style="width: 200vw"> >+ <div class="box"></div> >+ <div class="box"></div> >+ </div> >+ </div> >+ <div id="bidirectional-snapping-container" class="container"> >+ <div style="width: 200vw"> >+ <div class="box" style="float: left"></div> >+ <div class="box" style="float: left"></div> >+ </div> >+ </div> >+ </body> >+</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 213571
:
402673
|
423727
|
423751
|
423752
| 423816