Title: [284097] trunk
Revision
284097
Author
[email protected]
Date
2021-10-13 09:54:18 -0700 (Wed, 13 Oct 2021)

Log Message

[WK1] Tests for smooth scrolling of a window fail
https://bugs.webkit.org/show_bug.cgi?id=191357

Reviewed by Sam Weinig.
Source/WebCore:

The scrolling functions around ScrollView are a maze of twisty passages, with no clear
bottleneck functions, and aliasing of scroll position between ScrollableArea, ScrollAnimator
and the platform widget in WK1.

Fallout from this was that animation-driven scrolling, which ends up in
ScrollView::scrollTo(), did nothing if there was a platform widget.

In addition, there was no feedback that updated ScrollAnimator's notion of scroll position
when the platform widget scrolled, causing repeated animated scrolls to fail.

Cleaning up the mess will take time; for now, just patch ScrollView::scrollTo() to do
something if there's a platform widget, and have ScrollView::scrollOffsetChangedViaPlatformWidget()
push the new position to the scroll animator.

Tested by tests in imported/w3c/web-platform-tests/css/cssom-view/

* platform/ScrollView.cpp:
(WebCore::ScrollView::scrollOffsetChangedViaPlatformWidget):
(WebCore::ScrollView::scrollTo):
(WebCore::ScrollView::setScrollPosition):
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::scrollPositionChanged): Just some auto.

LayoutTests:

Some cssom-view tests pass now in WK1.

* platform/mac-wk1/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (284096 => 284097)


--- trunk/LayoutTests/ChangeLog	2021-10-13 16:47:03 UTC (rev 284096)
+++ trunk/LayoutTests/ChangeLog	2021-10-13 16:54:18 UTC (rev 284097)
@@ -1,3 +1,14 @@
+2021-10-13  Simon Fraser  <[email protected]>
+
+        [WK1] Tests for smooth scrolling of a window fail
+        https://bugs.webkit.org/show_bug.cgi?id=191357
+
+        Reviewed by Sam Weinig.
+
+        Some cssom-view tests pass now in WK1.
+
+        * platform/mac-wk1/TestExpectations:
+
 2021-10-13  Alan Bujtas  <[email protected]>
 
         [LFC][IFC] Do not break at the inline box boundary when wrapping is not allowed

Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (284096 => 284097)


--- trunk/LayoutTests/platform/mac-wk1/TestExpectations	2021-10-13 16:47:03 UTC (rev 284096)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations	2021-10-13 16:54:18 UTC (rev 284097)
@@ -819,12 +819,6 @@
 
 webkit.org/b/189594 imported/w3c/web-platform-tests/css/css-animations/pending-style-changes-001.html [ Pass Failure ]
 
-# Tests for smooth scroll behavior do not all work and they are slow, so let's just skip them.
-webkit.org/b/191357 imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-root.html [ Skip ]
-webkit.org/b/191357 imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-window.html [ Skip ]
-webkit.org/b/191357 imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-root.html [ Skip ]
-webkit.org/b/191357 imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-window.html [ Skip ]
-
 webkit.org/b/189756 compositing/filters/opacity-change-on-filtered-paints-into-ancestor.html [ Pass ImageOnlyFailure ]
 
 webkit.org/b/189723 http/tests/security/cross-origin-xsl-redirect-BLOCKED.html [ Pass Failure ]

Modified: trunk/Source/WebCore/ChangeLog (284096 => 284097)


--- trunk/Source/WebCore/ChangeLog	2021-10-13 16:47:03 UTC (rev 284096)
+++ trunk/Source/WebCore/ChangeLog	2021-10-13 16:54:18 UTC (rev 284097)
@@ -1,3 +1,33 @@
+2021-10-13  Simon Fraser  <[email protected]>
+
+        [WK1] Tests for smooth scrolling of a window fail
+        https://bugs.webkit.org/show_bug.cgi?id=191357
+
+        Reviewed by Sam Weinig.
+        
+        The scrolling functions around ScrollView are a maze of twisty passages, with no clear
+        bottleneck functions, and aliasing of scroll position between ScrollableArea, ScrollAnimator
+        and the platform widget in WK1.
+
+        Fallout from this was that animation-driven scrolling, which ends up in
+        ScrollView::scrollTo(), did nothing if there was a platform widget.
+
+        In addition, there was no feedback that updated ScrollAnimator's notion of scroll position
+        when the platform widget scrolled, causing repeated animated scrolls to fail.
+
+        Cleaning up the mess will take time; for now, just patch ScrollView::scrollTo() to do
+        something if there's a platform widget, and have ScrollView::scrollOffsetChangedViaPlatformWidget()
+        push the new position to the scroll animator.
+
+        Tested by tests in imported/w3c/web-platform-tests/css/cssom-view/
+
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::scrollOffsetChangedViaPlatformWidget):
+        (WebCore::ScrollView::scrollTo):
+        (WebCore::ScrollView::setScrollPosition):
+        * platform/ScrollableArea.cpp:
+        (WebCore::ScrollableArea::scrollPositionChanged): Just some auto.
+
 2021-10-12  Alexey Proskuryakov  <[email protected]>
 
         Invoke build scripts with python3 explicitly

Modified: trunk/Source/WebCore/platform/ScrollView.cpp (284096 => 284097)


--- trunk/Source/WebCore/platform/ScrollView.cpp	2021-10-13 16:47:03 UTC (rev 284096)
+++ trunk/Source/WebCore/platform/ScrollView.cpp	2021-10-13 16:54:18 UTC (rev 284097)
@@ -454,6 +454,7 @@
     }
 
     scrollOffsetChangedViaPlatformWidgetImpl(oldOffset, newOffset);
+    scrollAnimator().setCurrentPosition(scrollPosition());
 }
 
 void ScrollView::handleDeferredScrollUpdateAfterContentSizeChange()
@@ -482,6 +483,11 @@
     if (scrollDelta.isZero())
         return;
 
+    if (platformWidget()) {
+        platformSetScrollPosition(newPosition);
+        return;
+    }
+
     m_scrollPosition = newPosition;
 
     if (scrollbarsSuppressed())
@@ -518,16 +524,16 @@
     if (prohibitsScrolling())
         return;
 
+    if (scrollAnimationStatus() == ScrollAnimationStatus::Animating) {
+        scrollAnimator().cancelAnimations();
+        stopAsyncAnimatedScroll();
+    }
+
     if (platformWidget()) {
         platformSetScrollPosition(scrollPosition);
         return;
     }
 
-    if (scrollAnimationStatus() == ScrollAnimationStatus::Animating) {
-        scrollAnimator().cancelAnimations();
-        stopAsyncAnimatedScroll();
-    }
-
     ScrollPosition newScrollPosition = (!delegatesScrolling() && options.clamping == ScrollClamping::Clamped) ? adjustScrollPositionWithinRange(scrollPosition) : scrollPosition;
     if ((!delegatesScrolling() || currentScrollType() == ScrollType::User) && newScrollPosition == this->scrollPosition()) {
         LOG_WITH_STREAM(Scrolling, stream << "ScrollView::setScrollPosition " << scrollPosition << " return for no change");

Modified: trunk/Source/WebCore/platform/ScrollableArea.cpp (284096 => 284097)


--- trunk/Source/WebCore/platform/ScrollableArea.cpp	2021-10-13 16:47:03 UTC (rev 284096)
+++ trunk/Source/WebCore/platform/ScrollableArea.cpp	2021-10-13 16:54:18 UTC (rev 284097)
@@ -181,10 +181,10 @@
     // Tell the derived class to scroll its contents.
     setScrollOffset(scrollOffsetFromPosition(position));
 
-    Scrollbar* verticalScrollbar = this->verticalScrollbar();
+    auto* verticalScrollbar = this->verticalScrollbar();
 
     // Tell the scrollbars to update their thumb postions.
-    if (Scrollbar* horizontalScrollbar = this->horizontalScrollbar()) {
+    if (auto* horizontalScrollbar = this->horizontalScrollbar()) {
         horizontalScrollbar->offsetDidChange();
         if (horizontalScrollbar->isOverlayScrollbar() && !hasLayerForHorizontalScrollbar()) {
             if (!verticalScrollbar)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to