<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[285973] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/285973">285973</a></dd>
<dt>Author</dt> <dd>wenson_hsieh@apple.com</dd>
<dt>Date</dt> <dd>2021-11-17 19:13:16 -0800 (Wed, 17 Nov 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>[Live Text] Plumb an identifier string through `ChromeClient::requestTextRecognition()`
https://bugs.webkit.org/show_bug.cgi?id=233210

Reviewed by Dean Jackson.

Source/WebCore:

See WebKit/ChangeLog for more details.

* accessibility/AXImage.cpp:
(WebCore::AXImage::imageOverlayElements):
* page/ChromeClient.h:
(WebCore::ChromeClient::requestTextRecognition):
* page/ImageAnalysisQueue.cpp:
(WebCore::ImageAnalysisQueue::resumeProcessing):
* testing/Internals.cpp:
(WebCore::Internals::requestTextRecognition):

Source/WebCore/PAL:

Add another WebKitAdditions extension point.

* pal/spi/cocoa/VisionKitCoreSPI.h:

Source/WebKit:

Add an optional (i.e. null-by-default) identifier string to the `requestTextRecognition()` WebKit client hook,
and call into a new helper function in TextRecognitionUtilities.h, that's implemented in WebKitAdditions (with
an empty stub in open source code).

See corresponding radar for more information.

* Platform/cocoa/TextRecognitionUtilities.h:
* Platform/cocoa/TextRecognitionUtilities.mm:
(WebKit::requestImageAnalysisWithIdentifier):
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::requestTextRecognition):
* UIProcess/PageClient.h:
(WebKit::PageClient::requestTextRecognition):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::requestTextRecognition):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::requestTextRecognition):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView requestTextRecognition:imageData:identifier:completionHandler:]):
(-[WKContentView requestTextRecognition:imageData:completionHandler:]): Deleted.
* UIProcess/mac/PageClientImplMac.h:
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::requestTextRecognition):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::requestTextRecognition):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::requestTextRecognition):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::requestTextRecognition):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorePALChangeLog">trunk/Source/WebCore/PAL/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorePALpalspicocoaVisionKitCoreSPIh">trunk/Source/WebCore/PAL/pal/spi/cocoa/VisionKitCoreSPI.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAXImagecpp">trunk/Source/WebCore/accessibility/AXImage.cpp</a></li>
<li><a href="#trunkSourceWebCorepageChromeClienth">trunk/Source/WebCore/page/ChromeClient.h</a></li>
<li><a href="#trunkSourceWebCorepageImageAnalysisQueuecpp">trunk/Source/WebCore/page/ImageAnalysisQueue.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingInternalscpp">trunk/Source/WebCore/testing/Internals.cpp</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitPlatformcocoaTextRecognitionUtilitiesh">trunk/Source/WebKit/Platform/cocoa/TextRecognitionUtilities.h</a></li>
<li><a href="#trunkSourceWebKitPlatformcocoaTextRecognitionUtilitiesmm">trunk/Source/WebKit/Platform/cocoa/TextRecognitionUtilities.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessCocoaWebViewImplh">trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessCocoaWebViewImplmm">trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessPageClienth">trunk/Source/WebKit/UIProcess/PageClient.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessWebPageProxycpp">trunk/Source/WebKit/UIProcess/WebPageProxy.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessWebPageProxyh">trunk/Source/WebKit/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessWebPageProxymessagesin">trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in</a></li>
<li><a href="#trunkSourceWebKitUIProcessiosPageClientImplIOSh">trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessiosPageClientImplIOSmm">trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessiosWKContentViewInteractionh">trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessiosWKContentViewInteractionmm">trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessmacPageClientImplMach">trunk/Source/WebKit/UIProcess/mac/PageClientImplMac.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessmacPageClientImplMacmm">trunk/Source/WebKit/UIProcess/mac/PageClientImplMac.mm</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebCoreSupportWebChromeClientcpp">trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebCoreSupportWebChromeClienth">trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageWebPagecpp">trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageWebPageh">trunk/Source/WebKit/WebProcess/WebPage/WebPage.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (285972 => 285973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-11-18 03:05:08 UTC (rev 285972)
+++ trunk/Source/WebCore/ChangeLog      2021-11-18 03:13:16 UTC (rev 285973)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2021-11-17  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        [Live Text] Plumb an identifier string through `ChromeClient::requestTextRecognition()`
+        https://bugs.webkit.org/show_bug.cgi?id=233210
+
+        Reviewed by Dean Jackson.
+
+        See WebKit/ChangeLog for more details.
+
+        * accessibility/AXImage.cpp:
+        (WebCore::AXImage::imageOverlayElements):
+        * page/ChromeClient.h:
+        (WebCore::ChromeClient::requestTextRecognition):
+        * page/ImageAnalysisQueue.cpp:
+        (WebCore::ImageAnalysisQueue::resumeProcessing):
+        * testing/Internals.cpp:
+        (WebCore::Internals::requestTextRecognition):
+
</ins><span class="cx"> 2021-11-17  Takashi Komori  <Takashi.Komori@sony.com>
</span><span class="cx"> 
</span><span class="cx">         [Curl] Remove unnecessary option setting
</span></span></pre></div>
<a id="trunkSourceWebCorePALChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PAL/ChangeLog (285972 => 285973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PAL/ChangeLog       2021-11-18 03:05:08 UTC (rev 285972)
+++ trunk/Source/WebCore/PAL/ChangeLog  2021-11-18 03:13:16 UTC (rev 285973)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2021-11-17  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        [Live Text] Plumb an identifier string through `ChromeClient::requestTextRecognition()`
+        https://bugs.webkit.org/show_bug.cgi?id=233210
+
+        Reviewed by Dean Jackson.
+
+        Add another WebKitAdditions extension point.
+
+        * pal/spi/cocoa/VisionKitCoreSPI.h:
+
</ins><span class="cx"> 2021-11-16  Devin Rousso  <drousso@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [Apple Pay] handle unknown setup features
</span></span></pre></div>
<a id="trunkSourceWebCorePALpalspicocoaVisionKitCoreSPIh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PAL/pal/spi/cocoa/VisionKitCoreSPI.h (285972 => 285973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PAL/pal/spi/cocoa/VisionKitCoreSPI.h        2021-11-18 03:05:08 UTC (rev 285972)
+++ trunk/Source/WebCore/PAL/pal/spi/cocoa/VisionKitCoreSPI.h   2021-11-18 03:13:16 UTC (rev 285973)
</span><span class="lines">@@ -146,4 +146,8 @@
</span><span class="cx"> 
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if USE(APPLE_INTERNAL_SDK)
+#include <WebKitAdditions/VisionKitCoreSPIAdditions.h>
+#endif
+
</ins><span class="cx"> #endif // HAVE(VK_IMAGE_ANALYSIS)
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAXImagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AXImage.cpp (285972 => 285973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AXImage.cpp   2021-11-18 03:05:08 UTC (rev 285972)
+++ trunk/Source/WebCore/accessibility/AXImage.cpp      2021-11-18 03:13:16 UTC (rev 285973)
</span><span class="lines">@@ -72,7 +72,7 @@
</span><span class="cx">     if (!element)
</span><span class="cx">         return std::nullopt;
</span><span class="cx"> 
</span><del>-    page->chrome().client().requestTextRecognition(*element, [] (RefPtr<Element>&& imageOverlayHost) {
</del><ins>+    page->chrome().client().requestTextRecognition(*element, { }, [] (RefPtr<Element>&& imageOverlayHost) {
</ins><span class="cx">         if (!imageOverlayHost)
</span><span class="cx">             return;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageChromeClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/ChromeClient.h (285972 => 285973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/ChromeClient.h 2021-11-18 03:05:08 UTC (rev 285972)
+++ trunk/Source/WebCore/page/ChromeClient.h    2021-11-18 03:13:16 UTC (rev 285973)
</span><span class="lines">@@ -585,7 +585,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(IMAGE_ANALYSIS)
</span><del>-    virtual void requestTextRecognition(Element&, CompletionHandler<void(RefPtr<Element>&&)>&& completion = { })
</del><ins>+    virtual void requestTextRecognition(Element&, const String& = { }, CompletionHandler<void(RefPtr<Element>&&)>&& completion = { })
</ins><span class="cx">     {
</span><span class="cx">         if (completion)
</span><span class="cx">             completion({ });
</span></span></pre></div>
<a id="trunkSourceWebCorepageImageAnalysisQueuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/ImageAnalysisQueue.cpp (285972 => 285973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/ImageAnalysisQueue.cpp 2021-11-18 03:05:08 UTC (rev 285972)
+++ trunk/Source/WebCore/page/ImageAnalysisQueue.cpp    2021-11-18 03:13:16 UTC (rev 285973)
</span><span class="lines">@@ -93,7 +93,7 @@
</span><span class="cx"> 
</span><span class="cx">         m_pendingRequestCount++;
</span><span class="cx">         m_page->resetTextRecognitionResult(*element);
</span><del>-        m_page->chrome().client().requestTextRecognition(*element, [this, page = m_page] (auto&&) {
</del><ins>+        m_page->chrome().client().requestTextRecognition(*element, identifier, [this, page = m_page] (auto&&) {
</ins><span class="cx">             if (!page)
</span><span class="cx">                 return;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (285972 => 285973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.cpp       2021-11-18 03:05:08 UTC (rev 285972)
+++ trunk/Source/WebCore/testing/Internals.cpp  2021-11-18 03:13:16 UTC (rev 285973)
</span><span class="lines">@@ -5791,7 +5791,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(IMAGE_ANALYSIS)
</span><del>-    page->chrome().client().requestTextRecognition(element, [callback = WTFMove(callback)] (auto&&) {
</del><ins>+    page->chrome().client().requestTextRecognition(element, { }, [callback = WTFMove(callback)] (auto&&) {
</ins><span class="cx">         if (callback)
</span><span class="cx">             callback->handleEvent();
</span><span class="cx">     });
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (285972 => 285973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2021-11-18 03:05:08 UTC (rev 285972)
+++ trunk/Source/WebKit/ChangeLog       2021-11-18 03:13:16 UTC (rev 285973)
</span><span class="lines">@@ -1,3 +1,46 @@
</span><ins>+2021-11-17  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        [Live Text] Plumb an identifier string through `ChromeClient::requestTextRecognition()`
+        https://bugs.webkit.org/show_bug.cgi?id=233210
+
+        Reviewed by Dean Jackson.
+
+        Add an optional (i.e. null-by-default) identifier string to the `requestTextRecognition()` WebKit client hook,
+        and call into a new helper function in TextRecognitionUtilities.h, that's implemented in WebKitAdditions (with
+        an empty stub in open source code).
+
+        See corresponding radar for more information.
+
+        * Platform/cocoa/TextRecognitionUtilities.h:
+        * Platform/cocoa/TextRecognitionUtilities.mm:
+        (WebKit::requestImageAnalysisWithIdentifier):
+        * UIProcess/Cocoa/WebViewImpl.h:
+        * UIProcess/Cocoa/WebViewImpl.mm:
+        (WebKit::WebViewImpl::requestTextRecognition):
+        * UIProcess/PageClient.h:
+        (WebKit::PageClient::requestTextRecognition):
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::requestTextRecognition):
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:
+        * UIProcess/ios/PageClientImplIOS.h:
+        * UIProcess/ios/PageClientImplIOS.mm:
+        (WebKit::PageClientImpl::requestTextRecognition):
+        * UIProcess/ios/WKContentViewInteraction.h:
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView requestTextRecognition:imageData:identifier:completionHandler:]):
+        (-[WKContentView requestTextRecognition:imageData:completionHandler:]): Deleted.
+        * UIProcess/mac/PageClientImplMac.h:
+        * UIProcess/mac/PageClientImplMac.mm:
+        (WebKit::PageClientImpl::requestTextRecognition):
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        (WebKit::WebChromeClient::requestTextRecognition):
+        * WebProcess/WebCoreSupport/WebChromeClient.h:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::requestTextRecognition):
+        * WebProcess/WebPage/WebPage.h:
+        (WebKit::WebPage::requestTextRecognition):
+
</ins><span class="cx"> 2021-11-17  John Wilander  <wilander@apple.com>
</span><span class="cx"> 
</span><span class="cx">         PCM: Add capability for click destination to fire triggering event without cross-site requests to the click source
</span></span></pre></div>
<a id="trunkSourceWebKitPlatformcocoaTextRecognitionUtilitiesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Platform/cocoa/TextRecognitionUtilities.h (285972 => 285973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Platform/cocoa/TextRecognitionUtilities.h    2021-11-18 03:05:08 UTC (rev 285972)
+++ trunk/Source/WebKit/Platform/cocoa/TextRecognitionUtilities.h       2021-11-18 03:13:16 UTC (rev 285973)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> #if ENABLE(IMAGE_ANALYSIS)
</span><span class="cx"> 
</span><span class="cx"> #import <pal/spi/cocoa/VisionKitCoreSPI.h>
</span><ins>+#import <wtf/CompletionHandler.h>
</ins><span class="cx"> #import <wtf/RetainPtr.h>
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -43,6 +44,10 @@
</span><span class="cx"> RetainPtr<VKImageAnalyzer> createImageAnalyzer();
</span><span class="cx"> RetainPtr<VKImageAnalyzerRequest> createImageAnalyzerRequest(CGImageRef, VKAnalysisTypes);
</span><span class="cx"> 
</span><ins>+#if ENABLE(IMAGE_ANALYSIS_ENHANCEMENTS)
+void requestImageAnalysisWithIdentifier(VKImageAnalyzer *, const String& identifier, CGImageRef, CompletionHandler<void(WebCore::TextRecognitionResult&&)>&&);
+#endif
+
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(IMAGE_ANALYSIS)
</span></span></pre></div>
<a id="trunkSourceWebKitPlatformcocoaTextRecognitionUtilitiesmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Platform/cocoa/TextRecognitionUtilities.mm (285972 => 285973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Platform/cocoa/TextRecognitionUtilities.mm   2021-11-18 03:05:08 UTC (rev 285972)
+++ trunk/Source/WebKit/Platform/cocoa/TextRecognitionUtilities.mm      2021-11-18 03:13:16 UTC (rev 285973)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(IMAGE_ANALYSIS)
</span><span class="cx"> 
</span><ins>+#import "Logging.h"
</ins><span class="cx"> #import <WebCore/TextRecognitionResult.h>
</span><span class="cx"> #import <pal/cocoa/VisionKitCoreSoftLink.h>
</span><span class="cx"> #import <pal/spi/cocoa/FeatureFlagsSPI.h>
</span><span class="lines">@@ -138,6 +139,15 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if ENABLE(IMAGE_ANALYSIS_ENHANCEMENTS)
+
+void requestImageAnalysisWithIdentifier(VKImageAnalyzer *, const String&, CGImageRef, CompletionHandler<void(TextRecognitionResult&&)>&& completion)
+{
+    completion({ });
+}
+
+#endif // ENABLE(IMAGE_ANALYSIS_ENHANCEMENTS)
+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> bool isLiveTextAvailableAndEnabled()
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessCocoaWebViewImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h (285972 => 285973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h        2021-11-18 03:05:08 UTC (rev 285972)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h   2021-11-18 03:13:16 UTC (rev 285973)
</span><span class="lines">@@ -598,7 +598,7 @@
</span><span class="cx">     bool shouldRequestCandidates() const;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(IMAGE_ANALYSIS)
</span><del>-    void requestTextRecognition(const URL& imageURL, const ShareableBitmap::Handle& imageData, CompletionHandler<void(WebCore::TextRecognitionResult&&)>&&);
</del><ins>+    void requestTextRecognition(const URL& imageURL, const ShareableBitmap::Handle& imageData, const String& identifier, CompletionHandler<void(WebCore::TextRecognitionResult&&)>&&);
</ins><span class="cx">     void computeHasImageAnalysisResults(const URL& imageURL, ShareableBitmap& imageBitmap, ImageAnalysisType, CompletionHandler<void(bool)>&&);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessCocoaWebViewImplmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm (285972 => 285973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm       2021-11-18 03:05:08 UTC (rev 285972)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm  2021-11-18 03:13:16 UTC (rev 285973)
</span><span class="lines">@@ -204,7 +204,7 @@
</span><span class="cx">     return request;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebViewImpl::requestTextRecognition(const URL& imageURL, const ShareableBitmap::Handle& imageData, CompletionHandler<void(WebCore::TextRecognitionResult&&)>&& completion)
</del><ins>+void WebViewImpl::requestTextRecognition(const URL& imageURL, const ShareableBitmap::Handle& imageData, const String& identifier, CompletionHandler<void(TextRecognitionResult&&)>&& completion)
</ins><span class="cx"> {
</span><span class="cx">     if (!isLiveTextAvailableAndEnabled()) {
</span><span class="cx">         completion({ });
</span><span class="lines">@@ -218,6 +218,14 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     auto cgImage = imageBitmap->makeCGImage();
</span><ins>+
+#if ENABLE(IMAGE_ANALYSIS_ENHANCEMENTS)
+    if (!identifier.isEmpty())
+        return requestImageAnalysisWithIdentifier(ensureImageAnalyzer(), identifier, cgImage.get(), WTFMove(completion));
+#else
+    UNUSED_PARAM(identifier);
+#endif
+
</ins><span class="cx">     auto request = createImageAnalyzerRequest(cgImage.get(), imageURL, [NSURL _web_URLWithWTFString:m_page->currentURL()], VKAnalysisTypeText);
</span><span class="cx">     auto startTime = MonotonicTime::now();
</span><span class="cx">     [ensureImageAnalyzer() processRequest:request.get() progressHandler:nil completionHandler:makeBlockPtr([completion = WTFMove(completion), startTime] (VKImageAnalysis *analysis, NSError *) mutable {
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessPageClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/PageClient.h (285972 => 285973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/PageClient.h       2021-11-18 03:05:08 UTC (rev 285972)
+++ trunk/Source/WebKit/UIProcess/PageClient.h  2021-11-18 03:13:16 UTC (rev 285973)
</span><span class="lines">@@ -547,7 +547,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(IMAGE_ANALYSIS)
</span><del>-    virtual void requestTextRecognition(const URL& imageURL, const ShareableBitmap::Handle& imageData, CompletionHandler<void(WebCore::TextRecognitionResult&&)>&& completion) { completion({ }); }
</del><ins>+    virtual void requestTextRecognition(const URL& imageURL, const ShareableBitmap::Handle& imageData, const String& identifier, CompletionHandler<void(WebCore::TextRecognitionResult&&)>&& completion) { completion({ }); }
</ins><span class="cx">     virtual void computeHasImageAnalysisResults(const URL&, ShareableBitmap&, ImageAnalysisType, CompletionHandler<void(bool)>&& completion) { completion(false); }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (285972 => 285973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp   2021-11-18 03:05:08 UTC (rev 285972)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp      2021-11-18 03:13:16 UTC (rev 285973)
</span><span class="lines">@@ -8616,9 +8616,9 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(IMAGE_ANALYSIS)
</span><span class="cx"> 
</span><del>-void WebPageProxy::requestTextRecognition(const URL& imageURL, const ShareableBitmap::Handle& imageData, CompletionHandler<void(WebCore::TextRecognitionResult&&)>&& completionHandler)
</del><ins>+void WebPageProxy::requestTextRecognition(const URL& imageURL, const ShareableBitmap::Handle& imageData, const String& identifier, CompletionHandler<void(TextRecognitionResult&&)>&& completionHandler)
</ins><span class="cx"> {
</span><del>-    pageClient().requestTextRecognition(imageURL, imageData, WTFMove(completionHandler));
</del><ins>+    pageClient().requestTextRecognition(imageURL, imageData, identifier, WTFMove(completionHandler));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPageProxy::computeHasImageAnalysisResults(const URL& imageURL, ShareableBitmap& imageBitmap, ImageAnalysisType type, CompletionHandler<void(bool)>&& completion)
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (285972 => 285973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebPageProxy.h     2021-11-18 03:05:08 UTC (rev 285972)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h        2021-11-18 03:13:16 UTC (rev 285973)
</span><span class="lines">@@ -1698,7 +1698,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(IMAGE_ANALYSIS)
</span><del>-    void requestTextRecognition(const URL& imageURL, const ShareableBitmap::Handle& imageData, CompletionHandler<void(WebCore::TextRecognitionResult&&)>&&);
</del><ins>+    void requestTextRecognition(const URL& imageURL, const ShareableBitmap::Handle& imageData, const String& identifier, CompletionHandler<void(WebCore::TextRecognitionResult&&)>&&);
</ins><span class="cx">     void updateWithTextRecognitionResult(WebCore::TextRecognitionResult&&, const WebCore::ElementContext&, const WebCore::FloatPoint& location, CompletionHandler<void(TextRecognitionUpdateResult)>&&);
</span><span class="cx">     void computeHasImageAnalysisResults(const URL& imageURL, ShareableBitmap& imageBitmap, ImageAnalysisType, CompletionHandler<void(bool)>&&);
</span><span class="cx">     void startImageAnalysis(const String& identifier);
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebPageProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in (285972 => 285973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in   2021-11-18 03:05:08 UTC (rev 285972)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in      2021-11-18 03:13:16 UTC (rev 285973)
</span><span class="lines">@@ -216,7 +216,7 @@
</span><span class="cx">     SetHasHadSelectionChangesFromUserInteraction(bool hasHadUserSelectionChanges)
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(IMAGE_ANALYSIS)
</span><del>-    RequestTextRecognition(URL imageURL, WebKit::ShareableBitmap::Handle imageData) -> (struct WebCore::TextRecognitionResult result) Async
</del><ins>+    RequestTextRecognition(URL imageURL, WebKit::ShareableBitmap::Handle imageData, String identifier) -> (struct WebCore::TextRecognitionResult result) Async
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if HAVE(TRANSLATION_UI_SERVICES) && ENABLE(CONTEXT_MENUS)
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessiosPageClientImplIOSh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h (285972 => 285973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h    2021-11-18 03:05:08 UTC (rev 285972)
+++ trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h       2021-11-18 03:13:16 UTC (rev 285973)
</span><span class="lines">@@ -121,7 +121,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(IMAGE_ANALYSIS)
</span><del>-    void requestTextRecognition(const URL& imageURL, const ShareableBitmap::Handle& imageData, CompletionHandler<void(WebCore::TextRecognitionResult&&)>&&) final;
</del><ins>+    void requestTextRecognition(const URL& imageURL, const ShareableBitmap::Handle& imageData, const String& identifier, CompletionHandler<void(WebCore::TextRecognitionResult&&)>&&) final;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     RefPtr<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy&) override;
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessiosPageClientImplIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm (285972 => 285973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm   2021-11-18 03:05:08 UTC (rev 285972)
+++ trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm      2021-11-18 03:13:16 UTC (rev 285973)
</span><span class="lines">@@ -463,9 +463,9 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(IMAGE_ANALYSIS)
</span><span class="cx"> 
</span><del>-void PageClientImpl::requestTextRecognition(const URL& imageURL, const ShareableBitmap::Handle& imageData, CompletionHandler<void(WebCore::TextRecognitionResult&&)>&& completion)
</del><ins>+void PageClientImpl::requestTextRecognition(const URL& imageURL, const ShareableBitmap::Handle& imageData, const String& identifier, CompletionHandler<void(TextRecognitionResult&&)>&& completion)
</ins><span class="cx"> {
</span><del>-    [m_contentView requestTextRecognition:imageURL imageData:imageData completionHandler:WTFMove(completion)];
</del><ins>+    [m_contentView requestTextRecognition:imageURL imageData:imageData identifier:identifier completionHandler:WTFMove(completion)];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(IMAGE_ANALYSIS)
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessiosWKContentViewInteractionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h (285972 => 285973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h     2021-11-18 03:05:08 UTC (rev 285972)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h        2021-11-18 03:13:16 UTC (rev 285973)
</span><span class="lines">@@ -758,7 +758,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(IMAGE_ANALYSIS)
</span><span class="cx"> - (void)_endImageAnalysisGestureDeferral:(WebKit::ShouldPreventGestures)shouldPreventGestures;
</span><del>-- (void)requestTextRecognition:(NSURL *)imageURL imageData:(const WebKit::ShareableBitmap::Handle&)imageData completionHandler:(CompletionHandler<void(WebCore::TextRecognitionResult&&)>&&)completion;
</del><ins>+- (void)requestTextRecognition:(NSURL *)imageURL imageData:(const WebKit::ShareableBitmap::Handle&)imageData identifier:(NSString *)identifier completionHandler:(CompletionHandler<void(WebCore::TextRecognitionResult&&)>&&)completion;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> @end
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessiosWKContentViewInteractionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (285972 => 285973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm    2021-11-18 03:05:08 UTC (rev 285972)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm       2021-11-18 03:13:16 UTC (rev 285973)
</span><span class="lines">@@ -10150,7 +10150,7 @@
</span><span class="cx">     return NO;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)requestTextRecognition:(NSURL *)imageURL imageData:(const WebKit::ShareableBitmap::Handle&)imageData completionHandler:(CompletionHandler<void(WebCore::TextRecognitionResult&&)>&&)completion
</del><ins>+- (void)requestTextRecognition:(NSURL *)imageURL imageData:(const WebKit::ShareableBitmap::Handle&)imageData identifier:(NSString *)identifier completionHandler:(CompletionHandler<void(WebCore::TextRecognitionResult&&)>&&)completion
</ins><span class="cx"> {
</span><span class="cx">     auto imageBitmap = WebKit::ShareableBitmap::create(imageData);
</span><span class="cx">     if (!imageBitmap) {
</span><span class="lines">@@ -10164,8 +10164,15 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+#if ENABLE(IMAGE_ANALYSIS_ENHANCEMENTS)
+    if (identifier.length)
+        return WebKit::requestImageAnalysisWithIdentifier(self.imageAnalyzer, identifier, cgImage.get(), WTFMove(completion));
+#else
+    UNUSED_PARAM(identifier);
+#endif
+
</ins><span class="cx">     auto request = [self createImageAnalyzerRequest:VKAnalysisTypeText image:cgImage.get()];
</span><del>-    [[self imageAnalyzer] processRequest:request.get() progressHandler:nil completionHandler:makeBlockPtr([completion = WTFMove(completion)] (VKImageAnalysis *result, NSError *) mutable {
</del><ins>+    [self.imageAnalyzer processRequest:request.get() progressHandler:nil completionHandler:makeBlockPtr([completion = WTFMove(completion)] (VKImageAnalysis *result, NSError *) mutable {
</ins><span class="cx">         completion(WebKit::makeTextRecognitionResult(result));
</span><span class="cx">     }).get()];
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessmacPageClientImplMach"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/mac/PageClientImplMac.h (285972 => 285973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/mac/PageClientImplMac.h    2021-11-18 03:05:08 UTC (rev 285972)
+++ trunk/Source/WebKit/UIProcess/mac/PageClientImplMac.h       2021-11-18 03:13:16 UTC (rev 285973)
</span><span class="lines">@@ -131,7 +131,7 @@
</span><span class="cx">     void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool wasEventHandled) override;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(IMAGE_ANALYSIS)
</span><del>-    void requestTextRecognition(const URL& imageURL, const ShareableBitmap::Handle& imageData, CompletionHandler<void(WebCore::TextRecognitionResult&&)>&&) override;
</del><ins>+    void requestTextRecognition(const URL& imageURL, const ShareableBitmap::Handle& imageData, const String& identifier, CompletionHandler<void(WebCore::TextRecognitionResult&&)>&&) override;
</ins><span class="cx">     void computeHasImageAnalysisResults(const URL&, ShareableBitmap&, ImageAnalysisType, CompletionHandler<void(bool)>&&) override;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessmacPageClientImplMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/mac/PageClientImplMac.mm (285972 => 285973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/mac/PageClientImplMac.mm   2021-11-18 03:05:08 UTC (rev 285972)
+++ trunk/Source/WebKit/UIProcess/mac/PageClientImplMac.mm      2021-11-18 03:13:16 UTC (rev 285973)
</span><span class="lines">@@ -480,9 +480,9 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(IMAGE_ANALYSIS)
</span><span class="cx"> 
</span><del>-void PageClientImpl::requestTextRecognition(const URL& imageURL, const ShareableBitmap::Handle& imageData, CompletionHandler<void(TextRecognitionResult&&)>&& completion)
</del><ins>+void PageClientImpl::requestTextRecognition(const URL& imageURL, const ShareableBitmap::Handle& imageData, const String& identifier, CompletionHandler<void(TextRecognitionResult&&)>&& completion)
</ins><span class="cx"> {
</span><del>-    m_impl->requestTextRecognition(imageURL, imageData, WTFMove(completion));
</del><ins>+    m_impl->requestTextRecognition(imageURL, imageData, identifier, WTFMove(completion));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PageClientImpl::computeHasImageAnalysisResults(const URL& imageURL, ShareableBitmap& imageBitmap, ImageAnalysisType type, CompletionHandler<void(bool)>&& completion)
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebCoreSupportWebChromeClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp (285972 => 285973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp        2021-11-18 03:05:08 UTC (rev 285972)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp   2021-11-18 03:13:16 UTC (rev 285973)
</span><span class="lines">@@ -1492,9 +1492,9 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(IMAGE_ANALYSIS)
</span><span class="cx"> 
</span><del>-void WebChromeClient::requestTextRecognition(Element& element, CompletionHandler<void(RefPtr<Element>&&)>&& completion)
</del><ins>+void WebChromeClient::requestTextRecognition(Element& element, const String& identifier, CompletionHandler<void(RefPtr<Element>&&)>&& completion)
</ins><span class="cx"> {
</span><del>-    m_page.requestTextRecognition(element, WTFMove(completion));
</del><ins>+    m_page.requestTextRecognition(element, identifier, WTFMove(completion));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebCoreSupportWebChromeClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h (285972 => 285973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h  2021-11-18 03:05:08 UTC (rev 285972)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h     2021-11-18 03:13:16 UTC (rev 285973)
</span><span class="lines">@@ -431,7 +431,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(IMAGE_ANALYSIS)
</span><del>-    void requestTextRecognition(WebCore::Element&, CompletionHandler<void(RefPtr<WebCore::Element>&&)>&& = { }) final;
</del><ins>+    void requestTextRecognition(WebCore::Element&, const String& identifier = { }, CompletionHandler<void(RefPtr<WebCore::Element>&&)>&& = { }) final;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     bool needsImageOverlayControllerForSelectionPainting() const final
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (285972 => 285973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp       2021-11-18 03:05:08 UTC (rev 285972)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp  2021-11-18 03:13:16 UTC (rev 285973)
</span><span class="lines">@@ -7502,7 +7502,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(IMAGE_ANALYSIS)
</span><span class="cx"> 
</span><del>-void WebPage::requestTextRecognition(WebCore::Element& element, CompletionHandler<void(RefPtr<WebCore::Element>&&)>&& completion)
</del><ins>+void WebPage::requestTextRecognition(Element& element, const String& identifier, CompletionHandler<void(RefPtr<Element>&&)>&& completion)
</ins><span class="cx"> {
</span><span class="cx">     if (!is<HTMLElement>(element)) {
</span><span class="cx">         if (completion)
</span><span class="lines">@@ -7561,7 +7561,7 @@
</span><span class="cx"> 
</span><span class="cx">     auto cachedImage = renderImage.cachedImage();
</span><span class="cx">     auto imageURL = cachedImage ? element.document().completeURL(cachedImage->url().string()) : URL { };
</span><del>-    sendWithAsyncReply(Messages::WebPageProxy::RequestTextRecognition(WTFMove(imageURL), WTFMove(bitmapHandle)), [webPage = WeakPtr { *this }, weakElement = WeakPtr { element }] (auto&& result) {
</del><ins>+    sendWithAsyncReply(Messages::WebPageProxy::RequestTextRecognition(WTFMove(imageURL), WTFMove(bitmapHandle), identifier), [webPage = WeakPtr { *this }, weakElement = WeakPtr { element }] (auto&& result) {
</ins><span class="cx">         RefPtr protectedPage { webPage.get() };
</span><span class="cx">         if (!protectedPage)
</span><span class="cx">             return;
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.h (285972 => 285973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.h 2021-11-18 03:05:08 UTC (rev 285972)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.h    2021-11-18 03:13:16 UTC (rev 285973)
</span><span class="lines">@@ -1430,7 +1430,7 @@
</span><span class="cx">     void isPlayingMediaDidChange(WebCore::MediaProducerMediaStateFlags);
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(IMAGE_ANALYSIS)
</span><del>-    void requestTextRecognition(WebCore::Element&, CompletionHandler<void(RefPtr<WebCore::Element>&&)>&&);
</del><ins>+    void requestTextRecognition(WebCore::Element&, const String& identifier = { }, CompletionHandler<void(RefPtr<WebCore::Element>&&)>&& = { });
</ins><span class="cx">     void updateWithTextRecognitionResult(const WebCore::TextRecognitionResult&, const WebCore::ElementContext&, const WebCore::FloatPoint& location, CompletionHandler<void(TextRecognitionUpdateResult)>&&);
</span><span class="cx">     void startImageAnalysis(const String& identifier);
</span><span class="cx"> #endif
</span></span></pre>
</div>
</div>

</body>
</html>