[webkit-changes] [WebKit/WebKit] 663964: Scroll anchoring: naive implementation of selectAn...

Nikos Mouchtaris noreply at github.com
Thu Sep 21 12:38:57 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6639646de774d4333e28e4288a36c5627ac6388f
      https://github.com/WebKit/WebKit/commit/6639646de774d4333e28e4288a36c5627ac6388f
  Author: Nikolaos Mouchtaris <nmouchtaris at apple.com>
  Date:   2023-09-21 (Thu, 21 Sep 2023)

  Changed paths:
    M LayoutTests/accessibility/visible-character-range-width-changes.html
    M LayoutTests/css3/scroll-snap/ios/scroll-snap-mainframe-pinch-out.html
    M LayoutTests/editing/execCommand/insert-line-break-no-scroll.html
    M LayoutTests/editing/selection/ios/autoscroll-with-top-content-inset-2.html
    M LayoutTests/editing/selection/ios/autoscroll-with-top-content-inset.html
    M LayoutTests/fast/dom/Element/body-scrollLeft-basics-quirks.html
    M LayoutTests/fast/dom/Element/body-scrollTop-basics-quirks.html
    M LayoutTests/fast/dom/Window/window-scroll-arguments.html
    M LayoutTests/fast/dom/horizontal-scrollbar-when-dir-change.html
    M LayoutTests/fast/dom/vertical-scrollbar-in-rtl-doesnt-fire-onscroll.html
    M LayoutTests/fast/dom/vertical-scrollbar-when-dir-change.html
    M LayoutTests/fast/events/no-scroll-on-input-text-selection.html
    M LayoutTests/fast/scrolling/ios/click-events-during-momentum-scroll-in-main-frame.html
    M LayoutTests/fast/scrolling/ios/key-command-scroll-to-bottom.html
    M LayoutTests/fast/scrolling/ios/key-command-scroll-to-top.html
    M LayoutTests/fast/scrolling/ios/scroll-to-beginning-and-end-of-document.html
    M LayoutTests/fast/scrolling/latching/latching-and-wheel-events.html
    M LayoutTests/fast/scrolling/latching/overflow-in-iframe-latching.html
    M LayoutTests/fast/scrolling/programmatic-document-rtl-scroll.html
    M LayoutTests/fast/visual-viewport/client-coordinates-relative-to-layout-viewport.html
    M LayoutTests/fast/visual-viewport/rtl-zoomed-rects.html
    M LayoutTests/fullscreen/fullscreen-restore-scroll-position.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-scroll-anchoring/abspos-contributes-to-static-parent-bounds-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-scroll-anchoring/ancestor-change-heuristic-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-scroll-anchoring/anchoring-with-bounds-clamping-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-scroll-anchoring/anonymous-block-box-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-scroll-anchoring/basic-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-scroll-anchoring/descend-into-container-with-overflow-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-scroll-anchoring/image-001-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-scroll-anchoring/inline-block-002-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-scroll-anchoring/inline-block-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-scroll-anchoring/negative-layout-overflow-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-scroll-anchoring/position-change-heuristic-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-scroll-anchoring/position-change-heuristic-ib-split-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-scroll-anchoring/position-change-heuristic-in-nested-scroll-box-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-scroll-anchoring/reading-scroll-forces-anchoring-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-scroll-anchoring/start-edge-in-block-layout-direction-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-scroll-anchoring/subtree-exclusion-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-scroll-anchoring/zero-scroll-offset-expected.txt
    M LayoutTests/jquery/offset.html
    M LayoutTests/platform/ios-wk2/TestExpectations
    M LayoutTests/scrollingcoordinator/mac/latching/main-frame-back-swipe.html
    M LayoutTests/scrollingcoordinator/mac/latching/simple-page-rubberbands.html
    M Source/WebCore/dom/Document.cpp
    M Source/WebCore/page/LocalFrameView.cpp
    M Source/WebCore/page/LocalFrameView.h
    M Source/WebCore/page/scrolling/ScrollAnchoringController.cpp
    M Source/WebCore/page/scrolling/ScrollAnchoringController.h
    M Source/WebCore/platform/ScrollableArea.h

  Log Message:
  -----------
  Scroll anchoring: naive implementation of selectAnchorElement(), implement updateScrollPosition(), hookup to layout
https://bugs.webkit.org/show_bug.cgi?id=243702
<rdar://98695739>

Reviewed by Simon Fraser.

For selectAnchorElement(), select the deepest child element that is within the viewport bounds of the
frame view, or the first fully contined by the viewport bounds. For updateScrollPosition()
calculate the change in offset and set the scroll position of the frame view if necessary.
Finally, in FrameViewLayoutContext::performLayout(), hookup calls to selectAnchorElement()
and updateScrollPosition() in the appropriate area.

* Source/WebCore/page/FrameView.cpp:
(WebCore::FrameView::willDoLayout):
(WebCore::FrameView::performPostLayoutTasks):
* Source/WebCore/page/Page.cpp:
(WebCore::Page::doAfterUpdateRendering):
* Source/WebCore/page/scrolling/ScrollAnchoringController.cpp:
(WebCore::ScrollAnchoringController::invalidateAnchorElement):
(WebCore::ScrollAnchoringController::computeOffset):
(WebCore::ScrollAnchoringController::selectAnchorElement):
(WebCore::ScrollAnchoringController::updateScrollPosition):
* Source/WebCore/page/scrolling/ScrollAnchoringController.h:

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




More information about the webkit-changes mailing list