Title: [245832] trunk/Source/WebKit
Revision
245832
Author
timothy_hor...@apple.com
Date
2019-05-28 16:57:27 -0700 (Tue, 28 May 2019)

Log Message

Horizontal scrollbar flashes after scrolling vertically with keyboard
https://bugs.webkit.org/show_bug.cgi?id=197942
<rdar://problem/46169578>

Reviewed by Dean Jackson.

* UIProcess/ios/WKKeyboardScrollingAnimator.mm:
(axesForDelta):
(-[WKKeyboardScrollViewAnimator scrollToContentOffset:animated:]):
Only flash relevant axes.

* Platform/spi/ios/UIKitSPI.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (245831 => 245832)


--- trunk/Source/WebKit/ChangeLog	2019-05-28 23:40:24 UTC (rev 245831)
+++ trunk/Source/WebKit/ChangeLog	2019-05-28 23:57:27 UTC (rev 245832)
@@ -1,3 +1,18 @@
+2019-05-28  Tim Horton  <timothy_hor...@apple.com>
+
+        Horizontal scrollbar flashes after scrolling vertically with keyboard
+        https://bugs.webkit.org/show_bug.cgi?id=197942
+        <rdar://problem/46169578>
+
+        Reviewed by Dean Jackson.
+
+        * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
+        (axesForDelta):
+        (-[WKKeyboardScrollViewAnimator scrollToContentOffset:animated:]):
+        Only flash relevant axes.
+
+        * Platform/spi/ios/UIKitSPI.h:
+
 2019-05-28  Alex Christensen  <achristen...@webkit.org>
 
         Build Fix.

Modified: trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h (245831 => 245832)


--- trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h	2019-05-28 23:40:24 UTC (rev 245831)
+++ trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h	2019-05-28 23:57:27 UTC (rev 245832)
@@ -338,6 +338,13 @@
     UIScrollViewIndicatorInsetAdjustmentNever
 };
 
+typedef enum {
+    UIAxisNeither = 0,
+    UIAxisHorizontal = 1 << 0,
+    UIAxisVertical = 1 << 1,
+    UIAxisBoth = (UIAxisHorizontal | UIAxisVertical),
+} UIAxis;
+
 @interface UIScrollView ()
 - (void)_stopScrollingAndZoomingAnimations;
 - (void)_zoomToCenter:(CGPoint)center scale:(CGFloat)scale duration:(CFTimeInterval)duration force:(BOOL)force;
@@ -344,7 +351,7 @@
 - (void)_zoomToCenter:(CGPoint)center scale:(CGFloat)scale duration:(CFTimeInterval)duration;
 - (double)_horizontalVelocity;
 - (double)_verticalVelocity;
-- (void)_flashScrollIndicatorsPersistingPreviousFlashes;
+- (void)_flashScrollIndicatorsForAxes:(UIAxis)axes persistingPreviousFlashes:(BOOL)persisting;
 @property (nonatomic, getter=isZoomEnabled) BOOL zoomEnabled;
 @property (nonatomic, readonly, getter=_isAnimatingZoom) BOOL isAnimatingZoom;
 @property (nonatomic, readonly, getter=_isAnimatingScroll) BOOL isAnimatingScroll;

Modified: trunk/Source/WebKit/UIProcess/ios/WKKeyboardScrollingAnimator.mm (245831 => 245832)


--- trunk/Source/WebKit/UIProcess/ios/WKKeyboardScrollingAnimator.mm	2019-05-28 23:40:24 UTC (rev 245831)
+++ trunk/Source/WebKit/UIProcess/ios/WKKeyboardScrollingAnimator.mm	2019-05-28 23:57:27 UTC (rev 245832)
@@ -589,16 +589,28 @@
     return [_delegate keyboardScrollViewAnimator:self distanceForIncrement:increment inDirection:direction];
 }
 
-- (void)scrollToContentOffset:(WebCore::FloatPoint)contentOffsetDelta animated:(BOOL)animated
+#if HAVE(UI_SCROLL_VIEW_INDICATOR_FLASHING_SPI)
+static UIAxis axesForDelta(WebCore::FloatSize delta)
 {
+    UIAxis axes = UIAxisNeither;
+    if (delta.width())
+        axes = static_cast<UIAxis>(axes | UIAxisHorizontal);
+    if (delta.height())
+        axes = static_cast<UIAxis>(axes | UIAxisVertical);
+    return axes;
+}
+#endif
+
+- (void)scrollToContentOffset:(WebCore::FloatPoint)contentOffset animated:(BOOL)animated
+{
     auto scrollView = _scrollView.getAutoreleased();
     if (!scrollView)
         return;
     if (_delegateRespondsToWillScroll)
         [_delegate keyboardScrollViewAnimatorWillScroll:self];
-    [scrollView setContentOffset:contentOffsetDelta animated:animated];
+    [scrollView setContentOffset:contentOffset animated:animated];
 #if HAVE(UI_SCROLL_VIEW_INDICATOR_FLASHING_SPI)
-    [scrollView _flashScrollIndicatorsPersistingPreviousFlashes];
+    [scrollView _flashScrollIndicatorsForAxes:axesForDelta(WebCore::FloatPoint(scrollView.contentOffset) - contentOffset) persistingPreviousFlashes:YES];
 #else
     [scrollView _flashScrollIndicatorsPersistingPreviousFlashes:YES];
 #endif
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to