<!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>[260225] trunk</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/260225">260225</a></dd>
<dt>Author</dt> <dd>dbates@webkit.org</dd>
<dt>Date</dt> <dd>2020-04-16 16:23:19 -0700 (Thu, 16 Apr 2020)</dd>
</dl>

<h3>Log Message</h3>
<pre>Remove unused -_focusTextInputContext
https://bugs.webkit.org/show_bug.cgi?id=210619

Reviewed by Darin Adler.

Source/WebKit:

While this function was in the "SPI" header, there is no software at Apple that was using
this funciton and I will assume no non-Apple software was using it either.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _focusTextInputContext:completionHandler:]): Deleted.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/WebPageProxy.cpp:
* UIProcess/WebPageProxy.h:

Tools:

Remove test now that the SPI was removed.

* TestWebKitAPI/Tests/WebKitCocoa/RequestTextInputContext.mm:
(-[TestWKWebView synchronouslyFocusTextInputContext:]): Deleted.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPICocoaWKWebViewmm">trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPICocoaWKWebViewPrivateh">trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.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="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKitCocoaRequestTextInputContextmm">trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/RequestTextInputContext.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (260224 => 260225)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2020-04-16 23:05:28 UTC (rev 260224)
+++ trunk/Source/WebKit/ChangeLog       2020-04-16 23:23:19 UTC (rev 260225)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2020-04-16  Daniel Bates  <dabates@apple.com>
+
+        Remove unused -_focusTextInputContext
+        https://bugs.webkit.org/show_bug.cgi?id=210619
+
+        Reviewed by Darin Adler.
+
+        While this function was in the "SPI" header, there is no software at Apple that was using
+        this funciton and I will assume no non-Apple software was using it either.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _focusTextInputContext:completionHandler:]): Deleted.
+        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
+        * UIProcess/WebPageProxy.cpp:
+        * UIProcess/WebPageProxy.h:
+
</ins><span class="cx"> 2020-04-16  Brent Fulgham  <bfulgham@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [macOS] Switch unused IOKit classes from allow-with-report to deny-with-report
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPICocoaWKWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (260224 => 260225)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm     2020-04-16 23:05:28 UTC (rev 260224)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm        2020-04-16 23:23:19 UTC (rev 260225)
</span><span class="lines">@@ -2071,26 +2071,6 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)_focusTextInputContext:(_WKTextInputContext *)textInputContext completionHandler:(void(^)(BOOL))completionHandler
-{
-#if PLATFORM(IOS_FAMILY)
-    if (![self usesStandardContentView]) {
-        completionHandler(NO);
-        return;
-    }
-#endif
-
-    auto webContext = [textInputContext _textInputContext];
-    if (webContext.webPageIdentifier != _page->webPageID())
-        [NSException raise:NSInvalidArgumentException format:@"The provided _WKTextInputContext was not created by this WKWebView."];
-
-    [self becomeFirstResponder];
-
-    _page->focusTextInputContext(webContext, [capturedCompletionHandler = makeBlockPtr(completionHandler)](bool success) {
-        capturedCompletionHandler(success);
-    });
-}
-
</del><span class="cx"> - (void)_takePDFSnapshotWithConfiguration:(WKSnapshotConfiguration *)snapshotConfiguration completionHandler:(void (^)(NSData *, NSError *))completionHandler
</span><span class="cx"> {
</span><span class="cx">     WKPDFConfiguration *pdfConfiguration = nil;
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPICocoaWKWebViewPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h (260224 => 260225)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h       2020-04-16 23:05:28 UTC (rev 260224)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h  2020-04-16 23:23:19 UTC (rev 260225)
</span><span class="lines">@@ -335,8 +335,6 @@
</span><span class="cx"> - (void)_resumeAllMediaPlayback;
</span><span class="cx"> - (void)_closeAllMediaPresentations;
</span><span class="cx"> 
</span><del>-- (void)_focusTextInputContext:(_WKTextInputContext *)textInputElement completionHandler:(void(^)(BOOL))completionHandler WK_API_AVAILABLE(macos(10.15), ios(13.0));
-
</del><span class="cx"> - (void)_takePDFSnapshotWithConfiguration:(WKSnapshotConfiguration *)snapshotConfiguration completionHandler:(void (^)(NSData *pdfSnapshotData, NSError *error))completionHandler WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
</span><span class="cx"> 
</span><span class="cx"> - (void)_getProcessDisplayNameWithCompletionHandler:(void (^)(NSString *))completionHandler WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (260224 => 260225)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp   2020-04-16 23:05:28 UTC (rev 260224)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp      2020-04-16 23:23:19 UTC (rev 260225)
</span><span class="lines">@@ -9957,16 +9957,6 @@
</span><span class="cx">     sendWithAsyncReply(Messages::WebPage::TextInputContextsInRect(rect), WTFMove(completionHandler));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageProxy::focusTextInputContext(const WebCore::ElementContext& context, CompletionHandler<void(bool)>&& completionHandler)
-{
-    if (!hasRunningProcess()) {
-        completionHandler(false);
-        return;
-    }
-
-    sendWithAsyncReply(Messages::WebPage::FocusTextInputContext(context), WTFMove(completionHandler));
-}
-
</del><span class="cx"> void WebPageProxy::setCanShowPlaceholder(const WebCore::ElementContext& context, bool canShowPlaceholder)
</span><span class="cx"> {
</span><span class="cx">     if (hasRunningProcess())
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (260224 => 260225)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebPageProxy.h     2020-04-16 23:05:28 UTC (rev 260224)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h        2020-04-16 23:23:19 UTC (rev 260225)
</span><span class="lines">@@ -705,7 +705,6 @@
</span><span class="cx">     void fontAttributesCallback(const WebCore::FontAttributes&, CallbackID);
</span><span class="cx"> 
</span><span class="cx">     void textInputContextsInRect(WebCore::FloatRect, CompletionHandler<void(const Vector<WebCore::ElementContext>&)>&&);
</span><del>-    void focusTextInputContext(const WebCore::ElementContext&, CompletionHandler<void(bool)>&&);
</del><span class="cx">     void setCanShowPlaceholder(const WebCore::ElementContext&, bool);
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(UI_SIDE_COMPOSITING)
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (260224 => 260225)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog    2020-04-16 23:05:28 UTC (rev 260224)
+++ trunk/Tools/ChangeLog       2020-04-16 23:23:19 UTC (rev 260225)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2020-04-16  Daniel Bates  <dabates@apple.com>
+
+        Remove unused -_focusTextInputContext
+        https://bugs.webkit.org/show_bug.cgi?id=210619
+
+        Reviewed by Darin Adler.
+
+        Remove test now that the SPI was removed.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/RequestTextInputContext.mm:
+        (-[TestWKWebView synchronouslyFocusTextInputContext:]): Deleted.
+
</ins><span class="cx"> 2020-04-16  Yusuke Suzuki  <ysuzuki@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Add slack-aware WKR implementation
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKitCocoaRequestTextInputContextmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/RequestTextInputContext.mm (260224 => 260225)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/RequestTextInputContext.mm   2020-04-16 23:05:28 UTC (rev 260224)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/RequestTextInputContext.mm      2020-04-16 23:23:19 UTC (rev 260225)
</span><span class="lines">@@ -51,18 +51,6 @@
</span><span class="cx">     return result.autorelease();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (BOOL)synchronouslyFocusTextInputContext:(_WKTextInputContext *)context
-{
-    __block bool finished = false;
-    __block bool success = false;
-    [self _focusTextInputContext:context completionHandler:^(BOOL innerSuccess) {
-        success = innerSuccess;
-        finished = true;
-    }];
-    TestWebKitAPI::Util::run(&finished);
-    return success;
-}
-
</del><span class="cx"> - (UIResponder<UITextInput> *)synchronouslyFocusTextInputContext:(_WKTextInputContext *)context placeCaretAt:(CGPoint)point
</span><span class="cx"> {
</span><span class="cx">     __block bool finished = false;
</span><span class="lines">@@ -252,41 +240,6 @@
</span><span class="cx">     EXPECT_EQ(1UL, contexts.count);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-TEST(RequestTextInputContext, DISABLED_FocusTextInputContext)
-{
-    RetainPtr<WKWebViewConfiguration> configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
-    WKPreferencesSetThreadedScrollingEnabled((WKPreferencesRef)[configuration preferences], false);
-    RetainPtr<TestWKWebView> webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]);
-
-    NSArray<_WKTextInputContext *> *contexts;
-
-    [webView synchronouslyLoadHTMLString:applyStyle(@"<input id='test' type='text' style='width: 50px; height: 50px;'>")];
-    contexts = [webView synchronouslyRequestTextInputContextsInRect:[webView bounds]];
-    EXPECT_EQ(1UL, contexts.count);
-    RetainPtr<_WKTextInputContext> originalInput = contexts[0];
-    EXPECT_TRUE([webView synchronouslyFocusTextInputContext:originalInput.get()]);
-    EXPECT_WK_STREQ("test", [webView objectByEvaluatingJavaScript:@"document.activeElement.id"]);
-
-    // The _WKTextInputContext should still work even after another request.
-    contexts = [webView synchronouslyRequestTextInputContextsInRect:[webView bounds]];
-    EXPECT_TRUE([contexts[0] isEqual:originalInput.get()]);
-    EXPECT_TRUE([webView synchronouslyFocusTextInputContext:originalInput.get()]);
-
-    // Replace the <input> with a <textarea> with script; the <input> should no longer be focusable.
-    [webView objectByEvaluatingJavaScript:@"document.body.innerHTML = '<textarea id=\"area\">';"];
-    contexts = [webView synchronouslyRequestTextInputContextsInRect:[webView bounds]];
-    EXPECT_EQ(1UL, contexts.count);
-    RetainPtr<_WKTextInputContext> textArea = contexts[0];
-    EXPECT_FALSE([textArea isEqual:originalInput.get()]);
-    EXPECT_FALSE([webView synchronouslyFocusTextInputContext:originalInput.get()]);
-    EXPECT_TRUE([webView synchronouslyFocusTextInputContext:textArea.get()]);
-    EXPECT_WK_STREQ("area", [webView objectByEvaluatingJavaScript:@"document.activeElement.id"]);
-
-    // Destroy the <textarea> by navigating away; we can no longer focus it.
-    [webView synchronouslyLoadHTMLString:@""];
-    EXPECT_FALSE([webView synchronouslyFocusTextInputContext:textArea.get()]);
-}
-
</del><span class="cx"> TEST(RequestTextInputContext, ReadOnlyField)
</span><span class="cx"> {
</span><span class="cx">     auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
</span></span></pre>
</div>
</div>

</body>
</html>