Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 841a09adfc066cbb41e6ada9896b82f52c875844
      
https://github.com/WebKit/WebKit/commit/841a09adfc066cbb41e6ada9896b82f52c875844
  Author: Megan Gardner <megan_gard...@apple.com>
  Date:   2025-07-07 (Mon, 07 Jul 2025)

  Changed paths:
    A 
LayoutTests/http/tests/scroll-to-text-fragment/no-scroll-loop-with-scroll-style-change-expected.txt
    A 
LayoutTests/http/tests/scroll-to-text-fragment/no-scroll-loop-with-scroll-style-change.html
    M Source/WebCore/editing/Editor.cpp
    M Source/WebCore/editing/Editor.h
    M Source/WebCore/editing/FrameSelection.cpp
    M Source/WebCore/editing/FrameSelection.h
    M Source/WebCore/page/LocalFrameView.cpp
    M Source/WebCore/page/ScrollBehavior.h
    M Source/WebCore/rendering/RenderLayer.h

  Log Message:
  -----------
  codeweavers.com: REGRESSION (294860@main): STTF highlight flickers when 
opening link. (293912)
https://bugs.webkit.org/show_bug.cgi?id=295320
rdar://151939787

Reviewed by Simon Fraser.

If a page changes style based on scroll position, it's possible
for a Scroll To Text Fragment fragment to get into a situation
where the code to center the fragment gets into a cycle where
centering the fragment will cause a layout change that will force
the fragment to not be center, causing the fragment to be re-center
and then that layout will also un-center the fragment and so forth.
In order to combat this cycle, only allow Scroll To Text Fragment centering
to increase the value of Y. This should account for content loading in from
the top, and make it impossible to cycle in this manner.

* Source/WebCore/editing/Editor.cpp:
(WebCore::TemporarySelectionChange::setSelection):
* Source/WebCore/editing/Editor.h:
* Source/WebCore/editing/FrameSelection.cpp:
(WebCore::FrameSelection::setSelection):
(WebCore::FrameSelection::updateAndRevealSelection):
(WebCore::FrameSelection::revealSelection):
* Source/WebCore/editing/FrameSelection.h:
* Source/WebCore/page/LocalFrameView.cpp:
(WebCore::LocalFrameView::maintainScrollPositionAtScrollToTextFragmentRange):
(WebCore::LocalFrameView::scrollToFocusedElementInternal):
(WebCore::LocalFrameView::scrollRectToVisibleInTopLevelView):
(WebCore::LocalFrameView::scrollToTextFragmentRange):
* Source/WebCore/page/ScrollBehavior.h:
* Source/WebCore/rendering/RenderLayer.h:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to