Skip to content
Permalink
Browse files
Scroll To Text Fragment indicator flash not always apparent.
https://bugs.webkit.org/show_bug.cgi?id=245085
rdar://99668762

Reviewed by Tim Horton.

For some pages, if there is content being loaded in right around the time we scroll
and flash the text indicator, then the indicator will not be on screen and visible
to the user. We should scroll to the right place on the page one last time before we
actually create and display the text indicator to ensure that the page is at the right
location.

* Source/WebCore/page/FrameView.cpp:
(WebCore::FrameView::textFragmentIndicatorTimerFired):

Canonical link: https://commits.webkit.org/254403@main
  • Loading branch information
megangardner committed Sep 12, 2022
1 parent 2f9d01a commit f017f4f3662e09818fbe2dbffe8a5adf51ec8009
Showing 1 changed file with 4 additions and 1 deletion.
@@ -2462,7 +2462,10 @@ void FrameView::textFragmentIndicatorTimerFired()
if (m_pendingTextFragmentIndicatorText != plainText(m_pendingTextFragmentIndicatorRange.value()))
return;

auto textIndicator = TextIndicator::createWithRange(m_pendingTextFragmentIndicatorRange.value(), { TextIndicatorOption::DoNotClipToVisibleRect }, WebCore::TextIndicatorPresentationTransition::Bounce);
auto range = m_pendingTextFragmentIndicatorRange.value();
TemporarySelectionChange selectionChange(document, { range }, { TemporarySelectionOption::DelegateMainFrameScroll, TemporarySelectionOption::RevealSelectionBounds, TemporarySelectionOption::UserTriggered });

auto textIndicator = TextIndicator::createWithRange(range, { TextIndicatorOption::DoNotClipToVisibleRect }, WebCore::TextIndicatorPresentationTransition::Bounce);
if (textIndicator)
document.page()->chrome().client().setTextIndicator(textIndicator->data());

0 comments on commit f017f4f

Please sign in to comment.