Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e4e149e651c9263641b85591dbb8b7d9373d27d1
      
https://github.com/WebKit/WebKit/commit/e4e149e651c9263641b85591dbb8b7d9373d27d1
  Author: Tim Horton <[email protected]>
  Date:   2025-10-02 (Thu, 02 Oct 2025)

  Changed paths:
    A 
LayoutTests/http/tests/scroll-to-text-fragment/dynamic-content-is-found-expected.txt
    A 
LayoutTests/http/tests/scroll-to-text-fragment/dynamic-content-is-found.html
    M Source/WebCore/dom/FragmentDirectiveUtilities.cpp
    M Source/WebCore/dom/FragmentDirectiveUtilities.h
    M Source/WebCore/page/LocalFrameView.cpp
    M Source/WebCore/page/LocalFrameView.h

  Log Message:
  -----------
  bsky.app: No highlight when navigating to text fragment link generated by 
Safari
https://bugs.webkit.org/show_bug.cgi?id=300059
rdar://150880542

Reviewed by Abrar Rahman Protyasha.

When we successfully parse a text fragment out of the URL, but fail to find
the referenced content, start a 500ms repeating timer, and re-try finding
the content each time it fires, up to 3 seconds, or when the user scrolls, or
the content is found, whichever comes first.

New test: http/tests/scroll-to-text-fragment/dynamic-content-is-found.html

* Source/WebCore/dom/FragmentDirectiveUtilities.cpp:
(WebCore::operator<<):
* Source/WebCore/dom/FragmentDirectiveUtilities.h:
Add overloads to dump parsed text fragments, for ease of debugging.

* Source/WebCore/page/LocalFrameView.cpp:
(WebCore::LocalFrameView::LocalFrameView):
(WebCore::LocalFrameView::reset):
(WebCore::LocalFrameView::scrollToFragment):
Factor scrollToTextFragment out of scrollToFragment to make the flow a bit more 
clear.

(WebCore::LocalFrameView::scrollToTextFragment):
Invert the logic to be early-return-y.
When we fail, start the retry timer, with the rules explained above.

(WebCore::LocalFrameView::scrollToTextFragmentRetryTimerFired):
Retry the scroll when the timer fires.

(WebCore::LocalFrameView::scrollToAnchorFragment):
Rename this from scrollToFragmentInternal to scrollToAnchorFragment to better 
explain
which subset of the fragment scrolling mechanism it covers.

(WebCore::LocalFrameView::maintainScrollPositionAtScrollToTextFragmentRange):
(WebCore::LocalFrameView::scrollToAnchorAndTextFragmentNowIfNeeded):
(WebCore::LocalFrameView::scrollToPendingTextFragmentRange):
Another clarity-related rename.

(WebCore::LocalFrameView::scrollToFragmentInternal): Deleted.
(WebCore::LocalFrameView::scrollToTextFragmentRange): Deleted.
* Source/WebCore/page/LocalFrameView.h:

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



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

Reply via email to