[webkit-changes] [WebKit/WebKit] 7f5541: TextIndicator does not move when page layout changes.

megangardner noreply at github.com
Wed Mar 26 15:48:39 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7f55413e7a0da809f84ed89ba62d2ed4bcf941db
      https://github.com/WebKit/WebKit/commit/7f55413e7a0da809f84ed89ba62d2ed4bcf941db
  Author: Megan Gardner <megan_gardner at apple.com>
  Date:   2025-03-26 (Wed, 26 Mar 2025)

  Changed paths:
    M Source/WebCore/loader/EmptyClients.cpp
    M Source/WebCore/loader/EmptyClients.h
    M Source/WebCore/page/ChromeClient.h
    M Source/WebCore/page/LocalFrameView.cpp
    M Source/WebCore/page/LocalFrameView.h
    M Source/WebCore/page/cocoa/WebTextIndicatorLayer.h
    M Source/WebCore/page/cocoa/WebTextIndicatorLayer.mm
    M Source/WebCore/page/mac/TextIndicatorWindow.h
    M Source/WebCore/page/mac/TextIndicatorWindow.mm
    M Source/WebKit/UIProcess/PageClient.h
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/UIProcess/WebPageProxy.h
    M Source/WebKit/UIProcess/WebPageProxy.messages.in
    M Source/WebKit/UIProcess/ios/PageClientImplIOS.h
    M Source/WebKit/UIProcess/ios/PageClientImplIOS.mm
    M Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
    M Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
    M Source/WebKit/UIProcess/mac/PageClientImplMac.h
    M Source/WebKit/UIProcess/mac/PageClientImplMac.mm
    M Source/WebKit/UIProcess/mac/WebViewImpl.h
    M Source/WebKit/UIProcess/mac/WebViewImpl.mm
    M Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp
    M Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h
    M Source/WebKit/WebProcess/WebPage/WebPage.cpp
    M Source/WebKit/WebProcess/WebPage/WebPage.h
    M Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.h
    M Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.mm

  Log Message:
  -----------
  TextIndicator does not move when page layout changes.
https://bugs.webkit.org/show_bug.cgi?id=290430
rdar://147885631

Reviewed by Wenson Hsieh.

We lacked a way to update the text indicator when the
page layout changed, so it was possible for the text indicator
to become disconnected from the text that is was indicating.
This code adds a way to update the text indicator, but it
only fixes the problems on mac, and when it is related to page
layout. We also have this issue on iOS and in relation to
scrolling, and those will be fixed separately.

Most of this is plumbing code to allow the text indicator to update,
and we just remake the indicator in the window and the layer
when an update is requested. This could be improved to allow
the animation to be completed when the update happens by just
updating the text on the layer instead of remaking the whole thing.

* Source/WebCore/loader/EmptyClients.cpp:
(WebCore::EmptyChromeClient::updateTextIndicator const):
* Source/WebCore/loader/EmptyClients.h:
* Source/WebCore/page/ChromeClient.h:
* Source/WebCore/page/LocalFrameView.cpp:
(WebCore::LocalFrameView::reset):
(WebCore::LocalFrameView::scrollToFragment):
(WebCore::LocalFrameView::textFragmentIndicatorTimerFired):
(WebCore::LocalFrameView::cancelScheduledTextFragmentIndicatorTimer):
(WebCore::LocalFrameView::scheduleScrollToAnchorAndTextFragment):
(WebCore::LocalFrameView::scrollToTextFragmentRange):
* Source/WebCore/page/LocalFrameView.h:
* Source/WebCore/page/cocoa/WebTextIndicatorLayer.h:
* Source/WebCore/page/cocoa/WebTextIndicatorLayer.mm:
(-[WebTextIndicatorLayer updateWithFrame:textIndicator:margin:offset:updatingIndicator:]):
(-[WebTextIndicatorLayer initWithFrame:textIndicator:margin:offset:]):
* Source/WebCore/page/mac/TextIndicatorWindow.h:
* Source/WebCore/page/mac/TextIndicatorWindow.mm:
(WebCore::TextIndicatorWindow::setTextIndicator):
(WebCore::TextIndicatorWindow::updateTextIndicator):
* Source/WebKit/UIProcess/PageClient.h:
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::updateTextIndicatorFromFrame):
(WebKit::WebPageProxy::updateTextIndicator):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/WebPageProxy.messages.in:
* Source/WebKit/UIProcess/ios/PageClientImplIOS.h:
* Source/WebKit/UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::updateTextIndicator):
* Source/WebKit/UIProcess/ios/WKContentViewInteraction.h:
* Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setUpTextIndicator:]):
(-[WKContentView updateTextIndicator:]):
* Source/WebKit/UIProcess/mac/PageClientImplMac.h:
* Source/WebKit/UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::updateTextIndicator):
* Source/WebKit/UIProcess/mac/WebViewImpl.h:
* Source/WebKit/UIProcess/mac/WebViewImpl.mm:
(WebKit::WebViewImpl::setTextIndicator):
(WebKit::WebViewImpl::updateTextIndicator):
* Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::updateTextIndicator const):
* Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h:
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updateTextIndicator):
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.h:
* Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::updateTextIndicator const):

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



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list