Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ab02bb4acf18afadbd1b3913a94686e7a47731d8
      
https://github.com/WebKit/WebKit/commit/ab02bb4acf18afadbd1b3913a94686e7a47731d8
  Author: Richard Robinson <[email protected]>
  Date:   2026-03-10 (Tue, 10 Mar 2026)

  Changed paths:
    M Source/WebCore/SaferCPPExpectations/ForwardDeclCheckerExpectations
    M Source/WebCore/dom/DocumentMarker.h
    M Source/WebCore/dom/DocumentMarkerController.cpp
    M Source/WebCore/dom/DocumentMarkerController.h
    M Source/WebCore/rendering/MarkedText.cpp
    M Source/WebCore/rendering/MarkedText.h
    M Source/WebCore/rendering/StyledMarkedText.cpp
    M Source/WebCore/rendering/TextBoxPainter.cpp
    M Source/WebCore/testing/Internals.cpp
    M Source/WebCore/testing/Internals.h
    M Source/WebCore/testing/Internals.idl
    M Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm
    M Source/WebKit/UIProcess/WebPageProxy.h
    M Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
    M Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm
    M Source/WebKit/WebProcess/WebPage/WebPage.h
    M Source/WebKit/WebProcess/WebPage/WebPage.messages.in
    M Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
    M Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
    M Tools/TestWebKitAPI/Tests/WebCore/MarkedText.cpp
    A Tools/TestWebKitAPI/Tests/WebKitCocoa/DictationStreamingOpacity.mm

  Log Message:
  -----------
  [Dictation] Add DictationStreamingOpacity document marker for streaming 
partial results
https://bugs.webkit.org/show_bug.cgi?id=309109
rdar://169476197

Reviewed by Aditya Keerthi.

Make it possible to set a specific opacity value on a range of streaming 
dictation text.

Tests: Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
       Tools/TestWebKitAPI/Tests/WebCore/MarkedText.cpp
       Tools/TestWebKitAPI/Tests/WebKitCocoa/DictationStreamingOpacity.mm

* Source/WebCore/dom/DocumentMarker.h:
(WebCore::DocumentMarker::allMarkers):
* Source/WebCore/dom/DocumentMarkerController.cpp:
(WebCore::DocumentMarkerController::addDictationStreamingOpacityMarker):
(WebCore::DocumentMarkerController::removeAllDictationStreamingOpacityMarkers):
* Source/WebCore/dom/DocumentMarkerController.h:
* Source/WebCore/rendering/MarkedText.cpp:
(WebCore::MarkedText::collectForDictationStreamingOpacity):
* Source/WebCore/rendering/MarkedText.h:
* Source/WebCore/rendering/StyledMarkedText.cpp:
(WebCore::resolveStyleForMarkedText):
* Source/WebCore/rendering/TextBoxPainter.cpp:
(WebCore::TextBoxPainter::paintForegroundAndDecorations):
(WebCore::TextBoxPainter::paintForeground):
(WebCore::TextBoxPainter::createDecorationPainter):
(WebCore::TextBoxPainter::paintPlatformDocumentMarkers):
* Source/WebCore/testing/Internals.cpp:
(WebCore::markerTypeFrom):
(WebCore::Internals::hasDictationStreamingOpacityMarker):
* Source/WebCore/testing/Internals.h:
* Source/WebCore/testing/Internals.idl:

Add a new document marker type to be able to control the opacity of a 
particular piece of text.

* Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::setDictationStreamingOpacity):
(WebKit::WebPageProxy::clearDictationStreamingOpacity):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView 
_setDictationStreamingOpacity:forHypothesisText:streamingRange:]):
(-[WKContentView _clearDictationStreamingOpacity]):
* Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::WebPage::findDictatedTextRangeBeforeCursor):
(WebKit::WebPage::setDictationStreamingOpacity):
(WebKit::WebPage::clearDictationStreamingOpacity):
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKit/WebProcess/WebPage/WebPage.messages.in:
* Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::replaceDictatedText):

Add entry points to be able to set and clear dictation streaming opacity. This 
locates the hypothesis text by walking backward from the cursor and applying 
the marker to the streaming sub-range.

* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/WebCore/MarkedText.cpp:
(WebCore::operator<<):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/DictationStreamingOpacity.mm: Added.
(-[TestWKWebView dictationStreamingOpacityMarkerCount:]):
(TestWebKitAPI::createWebViewForDictationStreamingOpacity):
(TestWebKitAPI::TEST(DictationStreamingOpacity, SetAndClearMarker)):
(TestWebKitAPI::TEST(DictationStreamingOpacity, 
MarkerAppliedToCorrectSubRange)):
(TestWebKitAPI::TEST(DictationStreamingOpacity, UpdateReplacesOldMarker)):
(TestWebKitAPI::TEST(DictationStreamingOpacity, HypothesisTextMismatch)):
(TestWebKitAPI::TEST(DictationStreamingOpacity, NonEditableContent)):
(TestWebKitAPI::TEST(DictationStreamingOpacity, EmptyHypothesisText)):

Add test infrastructure and tests.

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



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

Reply via email to