Title: [195421] trunk/Source
Revision
195421
Author
bda...@apple.com
Date
2016-01-21 13:51:39 -0800 (Thu, 21 Jan 2016)

Log Message

Add the ability to update WebKitAdditions to WK2
https://bugs.webkit.org/show_bug.cgi?id=153320
-and corresponding-
rdar://problem/23639629

Reviewed by Anders Carlsson.

Source/WebCore:

This SPI is un-used now.
* platform/spi/mac/NSSpellCheckerSPI.h:

Source/WebKit2:

* UIProcess/API/Cocoa/WKWebView.mm:
* UIProcess/API/mac/WKView.mm:
* UIProcess/Cocoa/WebViewImpl.h:
(WebKit::WebViewImpl::createWeakPtr):
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::updateWebViewImplAdditions):
(WebKit::WebViewImpl::showCandidates):
(WebKit::WebViewImpl::webViewImplAdditionsWillDestroyView):
(WebKit::trackingAreaOptions):
(WebKit::WebViewImpl::~WebViewImpl):
(WebKit::WebViewImpl::becomeFirstResponder):
(WebKit::WebViewImpl::selectionDidChange):
(WebKit::WebViewImpl::handleRequestedCandidates):
(WebKit::textCheckingResultFromNSTextCheckingResult):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (195420 => 195421)


--- trunk/Source/WebCore/ChangeLog	2016-01-21 21:37:56 UTC (rev 195420)
+++ trunk/Source/WebCore/ChangeLog	2016-01-21 21:51:39 UTC (rev 195421)
@@ -1,3 +1,15 @@
+2016-01-21  Beth Dakin  <bda...@apple.com>
+
+        Add the ability to update WebKitAdditions to WK2
+        https://bugs.webkit.org/show_bug.cgi?id=153320
+        -and corresponding-
+        rdar://problem/23639629
+
+        Reviewed by Anders Carlsson.
+
+        This SPI is un-used now.
+        * platform/spi/mac/NSSpellCheckerSPI.h:
+
 2016-01-21  Simon Fraser  <simon.fra...@apple.com>
 
         GraphicsContext: low quality drawImage and drawImageBuffer should use InterpolationLow

Modified: trunk/Source/WebCore/platform/spi/mac/NSSpellCheckerSPI.h (195420 => 195421)


--- trunk/Source/WebCore/platform/spi/mac/NSSpellCheckerSPI.h	2016-01-21 21:37:56 UTC (rev 195420)
+++ trunk/Source/WebCore/platform/spi/mac/NSSpellCheckerSPI.h	2016-01-21 21:51:39 UTC (rev 195421)
@@ -31,7 +31,6 @@
 
 @interface NSSpellChecker ()
 - (NSInteger)requestCandidatesForSelectedRange:(NSRange)selectedRange inString:(NSString *)stringToCheck types:(NSTextCheckingTypes)checkingTypes options:(NSDictionary<NSString *, id> *)options inSpellDocumentWithTag:(NSInteger)tag completionHandler:(void (^)(NSInteger sequenceNumber, NSArray<NSTextCheckingResult *> *candidates))completionHandler;
-- (void)showCandidates:(NSArray<NSTextCheckingResult *> *)candidates forString:(NSString *)string inRect:(NSRect)rectOfTypedString view:(NSView *)view completionHandler:(void (^)(NSTextCheckingResult *acceptedCandidate))completionBlock;
 @end
 
 #endif // PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 102000

Modified: trunk/Source/WebKit2/ChangeLog (195420 => 195421)


--- trunk/Source/WebKit2/ChangeLog	2016-01-21 21:37:56 UTC (rev 195420)
+++ trunk/Source/WebKit2/ChangeLog	2016-01-21 21:51:39 UTC (rev 195421)
@@ -1,3 +1,27 @@
+2016-01-21  Beth Dakin  <bda...@apple.com>
+
+        Add the ability to update WebKitAdditions to WK2
+        https://bugs.webkit.org/show_bug.cgi?id=153320
+        -and corresponding-
+        rdar://problem/23639629
+
+        Reviewed by Anders Carlsson.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        * UIProcess/API/mac/WKView.mm:
+        * UIProcess/Cocoa/WebViewImpl.h:
+        (WebKit::WebViewImpl::createWeakPtr):
+        * UIProcess/Cocoa/WebViewImpl.mm:
+        (WebKit::WebViewImpl::updateWebViewImplAdditions):
+        (WebKit::WebViewImpl::showCandidates):
+        (WebKit::WebViewImpl::webViewImplAdditionsWillDestroyView):
+        (WebKit::trackingAreaOptions):
+        (WebKit::WebViewImpl::~WebViewImpl):
+        (WebKit::WebViewImpl::becomeFirstResponder):
+        (WebKit::WebViewImpl::selectionDidChange):
+        (WebKit::WebViewImpl::handleRequestedCandidates):
+        (WebKit::textCheckingResultFromNSTextCheckingResult):
+
 2016-01-19  Ada Chan  <adac...@apple.com>
 
         Make it possible to enable VIDEO_PRESENTATION_MODE on other Cocoa platforms.

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (195420 => 195421)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2016-01-21 21:37:56 UTC (rev 195420)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2016-01-21 21:51:39 UTC (rev 195421)
@@ -4347,4 +4347,8 @@
 #import <WebKitAdditions/WKWebViewAdditions.mm>
 #endif
 
+#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200 && USE(APPLE_INTERNAL_SDK)
+#import <WebKitAdditions/WKWebViewAdditionsMac.mm>
+#endif
+
 #endif // WK_API_ENABLED

Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (195420 => 195421)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm	2016-01-21 21:37:56 UTC (rev 195420)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm	2016-01-21 21:51:39 UTC (rev 195421)
@@ -1447,4 +1447,8 @@
 
 @end
 
+#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200 && USE(APPLE_INTERNAL_SDK)
+#import <WebKitAdditions/WKViewAdditions.mm>
+#endif
+
 #endif // PLATFORM(MAC)

Modified: trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h (195420 => 195421)


--- trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h	2016-01-21 21:37:56 UTC (rev 195420)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h	2016-01-21 21:51:39 UTC (rev 195421)
@@ -50,6 +50,10 @@
 OBJC_CLASS WKWindowVisibilityObserver;
 OBJC_CLASS _WKThumbnailView;
 
+#if USE(APPLE_INTERNAL_SDK) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
+#import <WebKitAdditions/WebViewImplAdditionsDeclarations.h>
+#endif
+
 @protocol WebViewImplDelegate
 
 - (NSTextInputContext *)_web_superInputContext;
@@ -470,6 +474,14 @@
     void rightMouseDragged(NSEvent *);
     void rightMouseUp(NSEvent *);
 
+    void updateWebViewImplAdditions();
+    void showCandidates(NSArray *candidates, NSString *, NSRect rectOfTypedString, NSView *, void (^completionHandler)(NSTextCheckingResult *acceptedCandidate));
+    void webViewImplAdditionsWillDestroyView();
+
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200 && USE(APPLE_INTERNAL_SDK)
+#import <WebKitAdditions/WebViewImplAdditions.h>
+#endif
+
 private:
     WeakPtr<WebViewImpl> createWeakPtr() { return m_weakPtrFactory.createWeakPtr(); }
 

Modified: trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm (195420 => 195421)


--- trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm	2016-01-21 21:37:56 UTC (rev 195420)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm	2016-01-21 21:51:39 UTC (rev 195421)
@@ -419,8 +419,28 @@
 
 @end
 
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200 && USE(APPLE_INTERNAL_SDK)
+#import <WebKitAdditions/WebViewImplAdditions.mm>
+#else
 namespace WebKit {
 
+void WebViewImpl::updateWebViewImplAdditions()
+{
+}
+
+void WebViewImpl::showCandidates(NSArray *candidates, NSString *string, NSRect rectOfTypedString, NSView *view, void (^completionHandler)(NSTextCheckingResult *acceptedCandidate))
+{
+}
+
+void WebViewImpl::webViewImplAdditionsWillDestroyView()
+{
+}
+
+} // namespace WebKit
+#endif // __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200 && USE(APPLE_INTERNAL_SDK)
+
+namespace WebKit {
+
 static NSTrackingAreaOptions trackingAreaOptions()
 {
     // Legacy style scrollbars have design details that rely on tracking the mouse all the time.
@@ -493,6 +513,7 @@
     [m_layoutStrategy invalidate];
 
     [m_immediateActionController willDestroyView:m_view];
+    webViewImplAdditionsWillDestroyView();
 
     m_page->close();
 
@@ -567,6 +588,8 @@
 
     m_inBecomeFirstResponder = false;
 
+    updateWebViewImplAdditions();
+
     if (direction != NSDirectSelection) {
         NSEvent *event = [NSApp currentEvent];
         NSEvent *keyboardEvent = nil;
@@ -1725,6 +1748,7 @@
 {
     updateFontPanelIfNeeded();
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
+    updateWebViewImplAdditions();
     if (!m_page->editorState().isMissingPostLayoutData)
         requestCandidatesForSelectionIfNeeded();
 #endif
@@ -2134,13 +2158,13 @@
         return;
 
     auto weakThis = createWeakPtr();
-    [[NSSpellChecker sharedSpellChecker] showCandidates:candidates forString:postLayoutData.stringForCandidateRequest inRect:postLayoutData.selectionClipRect view:m_view completionHandler:[weakThis](NSTextCheckingResult *acceptedCandidate) {
+    showCandidates(candidates, postLayoutData.stringForCandidateRequest, postLayoutData.selectionClipRect, m_view, [weakThis](NSTextCheckingResult *acceptedCandidate) {
         dispatch_async(dispatch_get_main_queue(), ^{
             if (!weakThis)
                 return;
             weakThis->handleAcceptedCandidate(acceptedCandidate);
         });
-    }];
+    });
 }
 
 static WebCore::TextCheckingResult textCheckingResultFromNSTextCheckingResult(NSTextCheckingResult *nsResult)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to