Title: [201592] trunk
Revision
201592
Author
[email protected]
Date
2016-06-01 22:21:30 -0700 (Wed, 01 Jun 2016)

Log Message

REGRESSION(r191907): Can't enter combining diacritic marks in Web Inspector fields
https://bugs.webkit.org/show_bug.cgi?id=158227
<rdar://problem/26232464>

Source/WebKit2:

Reviewed by Darin Adler and Alexey Proskuryakov.

Web Inspector uses a WKWebView subclass for the inspector frontend interface.
Since r191907, WKWebView does not have an inner WKView, and instead shares
a WebViewImpl to implement the same methods as WKView. So, WKView is no longer
involved at all when delivering keystrokes to the Web Inspector interface.

This caused a subtle regression where some keystrokes were not being interpreted
in the same way by AppKit because WKWebView does not conform to NSTextInputClient
but WKView does. AppKit won't automatically create a NSTextInputContext for a NSView
unless the subclass is declared as conforming to NSTextInputClient. Thus, the keystroke
never goes through NSTextInputContext machinery which converts the keystroke into
a combining diacritic character.

This regression is covered by a new API test.

* UIProcess/API/Cocoa/WKWebView.mm: mark WKWebView as conforming to NSTextInputClient.

Tools:

Reviewed by Alexey Proskuryakov.

Add a regression test that runs on Mac only.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/WKWebViewTextInput.mm: Added.
(-[DummyNavigationDelegate webView:didFinishNavigation:]):
(TEST):
* TestWebKitAPI/Tests/WebKit2Cocoa/editable-body.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (201591 => 201592)


--- trunk/Source/WebKit2/ChangeLog	2016-06-02 04:38:46 UTC (rev 201591)
+++ trunk/Source/WebKit2/ChangeLog	2016-06-02 05:21:30 UTC (rev 201592)
@@ -1,3 +1,27 @@
+2016-05-31  Brian Burg  <[email protected]>
+  
+        REGRESSION(r191907): Can't enter combining diacritic marks in Web Inspector fields
+        https://bugs.webkit.org/show_bug.cgi?id=158227
+        <rdar://problem/26232464>
+
+        Reviewed by Darin Adler and Alexey Proskuryakov.
+
+        Web Inspector uses a WKWebView subclass for the inspector frontend interface.
+        Since r191907, WKWebView does not have an inner WKView, and instead shares
+        a WebViewImpl to implement the same methods as WKView. So, WKView is no longer
+        involved at all when delivering keystrokes to the Web Inspector interface.
+
+        This caused a subtle regression where some keystrokes were not being interpreted
+        in the same way by AppKit because WKWebView does not conform to NSTextInputClient
+        but WKView does. AppKit won't automatically create a NSTextInputContext for a NSView
+        unless the subclass is declared as conforming to NSTextInputClient. Thus, the keystroke
+        never goes through NSTextInputContext machinery which converts the keystroke into
+        a combining diacritic character.
+
+        This regression is covered by a new API test.
+
+        * UIProcess/API/Cocoa/WKWebView.mm: mark WKWebView as conforming to NSTextInputClient.
+
 2016-06-01  Dan Bernstein  <[email protected]>
 
         Try to fix ENABLE(IOS_TOUCH_EVENTS) builds.

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


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2016-06-02 04:38:46 UTC (rev 201591)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2016-06-02 05:21:30 UTC (rev 201592)
@@ -168,7 +168,7 @@
 #import "WKViewInternal.h"
 #import <WebCore/ColorMac.h>
 
-@interface WKWebView () <WebViewImplDelegate>
+@interface WKWebView () <WebViewImplDelegate, NSTextInputClient>
 @end
 #endif
 

Modified: trunk/Tools/ChangeLog (201591 => 201592)


--- trunk/Tools/ChangeLog	2016-06-02 04:38:46 UTC (rev 201591)
+++ trunk/Tools/ChangeLog	2016-06-02 05:21:30 UTC (rev 201592)
@@ -1,3 +1,19 @@
+2016-06-01  Brian Burg  <[email protected]>
+
+        REGRESSION(r191907): Can't enter combining diacritic marks in Web Inspector fields
+        https://bugs.webkit.org/show_bug.cgi?id=158227
+        <rdar://problem/26232464>
+
+        Reviewed by Alexey Proskuryakov.
+
+        Add a regression test that runs on Mac only.
+
+        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+        * TestWebKitAPI/Tests/WebKit2Cocoa/WKWebViewTextInput.mm: Added.
+        (-[DummyNavigationDelegate webView:didFinishNavigation:]):
+        (TEST):
+        * TestWebKitAPI/Tests/WebKit2Cocoa/editable-body.html: Added.
+
 2016-06-01  Chris Fleizach  <[email protected]>
 
         AX: iOS: VoiceOver can't access attachments in mail messages

Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (201591 => 201592)


--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj	2016-06-02 04:38:46 UTC (rev 201591)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj	2016-06-02 05:21:30 UTC (rev 201592)
@@ -307,6 +307,8 @@
 		93F1DB3414DA20870024C362 /* NewFirstVisuallyNonEmptyLayout_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93F1DB3314DA20870024C362 /* NewFirstVisuallyNonEmptyLayout_Bundle.cpp */; };
 		93F1DB5714DB1B840024C362 /* NewFirstVisuallyNonEmptyLayoutFails_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93F1DB5614DB1B840024C362 /* NewFirstVisuallyNonEmptyLayoutFails_Bundle.cpp */; };
 		93F7E86F14DC8E5C00C84A99 /* NewFirstVisuallyNonEmptyLayoutFrames_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93F7E86E14DC8E5B00C84A99 /* NewFirstVisuallyNonEmptyLayoutFrames_Bundle.cpp */; };
+		9984FACC1CFFAF60008D198C /* WKWebViewTextInput.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9984FACA1CFFAEEE008D198C /* WKWebViewTextInput.mm */; };
+		9984FACE1CFFB090008D198C /* editable-body.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 9984FACD1CFFB038008D198C /* editable-body.html */; };
 		9B0786A31C58830F00D159E3 /* InjectedBundleMakeAllShadowRootsOpen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9B0786A21C58830F00D159E3 /* InjectedBundleMakeAllShadowRootsOpen.cpp */; };
 		9B0786A51C5885C300D159E3 /* InjectedBundleMakeAllShadowRootOpen_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9B0786A41C5885C300D159E3 /* InjectedBundleMakeAllShadowRootOpen_Bundle.cpp */; };
 		9B26FCCA159D16DE00CC3765 /* HTMLFormCollectionNamedItem.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 9B26FCB4159D15E700CC3765 /* HTMLFormCollectionNamedItem.html */; };
@@ -429,6 +431,7 @@
 			dstPath = TestWebKitAPI.resources;
 			dstSubfolderSpec = 7;
 			files = (
+				9984FACE1CFFB090008D198C /* editable-body.html in Copy Resources */,
 				51714EB41CF8C78C004723C4 /* WebProcessKillIDBCleanup-1.html in Copy Resources */,
 				51714EB51CF8C78C004723C4 /* WebProcessKillIDBCleanup-2.html in Copy Resources */,
 				CDE195B51CFE0B880053D256 /* FullscreenTopContentInset.html in Copy Resources */,
@@ -767,6 +770,8 @@
 		93F1DB5614DB1B840024C362 /* NewFirstVisuallyNonEmptyLayoutFails_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NewFirstVisuallyNonEmptyLayoutFails_Bundle.cpp; sourceTree = "<group>"; };
 		93F7E86B14DC8E4D00C84A99 /* NewFirstVisuallyNonEmptyLayoutFrames.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NewFirstVisuallyNonEmptyLayoutFrames.cpp; sourceTree = "<group>"; };
 		93F7E86E14DC8E5B00C84A99 /* NewFirstVisuallyNonEmptyLayoutFrames_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NewFirstVisuallyNonEmptyLayoutFrames_Bundle.cpp; sourceTree = "<group>"; };
+		9984FACA1CFFAEEE008D198C /* WKWebViewTextInput.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKWebViewTextInput.mm; sourceTree = "<group>"; };
+		9984FACD1CFFB038008D198C /* editable-body.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "editable-body.html"; sourceTree = "<group>"; };
 		9B0786A21C58830F00D159E3 /* InjectedBundleMakeAllShadowRootsOpen.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleMakeAllShadowRootsOpen.cpp; sourceTree = "<group>"; };
 		9B0786A41C5885C300D159E3 /* InjectedBundleMakeAllShadowRootOpen_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleMakeAllShadowRootOpen_Bundle.cpp; sourceTree = "<group>"; };
 		9B26FC6B159D061000CC3765 /* HTMLFormCollectionNamedItem.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HTMLFormCollectionNamedItem.mm; sourceTree = "<group>"; };
@@ -1093,6 +1098,7 @@
 				93E943F11CD3E87E00AC08C2 /* VideoControlsManager.mm */,
 				2D00065D1C1F58940088E6A7 /* WKPDFViewResizeCrash.mm */,
 				0F3B94A51A77266C00DE3272 /* WKWebViewEvaluateJavaScript.mm */,
+				9984FACA1CFFAEEE008D198C /* WKWebViewTextInput.mm */,
 				51714EB61CF8C7A4004723C4 /* WebProcessKillIDBCleanup.mm */,
 			);
 			name = "WebKit2 Cocoa";
@@ -1168,6 +1174,7 @@
 		A16F66B81C40E9E100BD4D24 /* Resources */ = {
 			isa = PBXGroup;
 			children = (
+				9984FACD1CFFB038008D198C /* editable-body.html */,
 				CDE195B21CFE0ADE0053D256 /* FullscreenTopContentInset.html */,
 				A16F66B91C40EA2000BD4D24 /* ContentFiltering.html */,
 				5714ECB81CA8B58800051AC8 /* DownloadRequestOriginalURL.html */,
@@ -1839,6 +1846,7 @@
 				7CCE7EBD1A411A7E00447C4C /* DOMRangeOfString.mm in Sources */,
 				7CCE7EEC1A411AE600447C4C /* DOMWindowExtensionBasic.cpp in Sources */,
 				7CCE7EED1A411AE600447C4C /* DOMWindowExtensionNoCache.cpp in Sources */,
+				9984FACC1CFFAF60008D198C /* WKWebViewTextInput.mm in Sources */,
 				7CCE7F231A411AF600447C4C /* Download.mm in Sources */,
 				7CCE7EEE1A411AE600447C4C /* DownloadDecideDestinationCrash.cpp in Sources */,
 				7CCE7EBE1A411A7E00447C4C /* DynamicDeviceScaleFactor.mm in Sources */,

Added: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WKWebViewTextInput.mm (0 => 201592)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WKWebViewTextInput.mm	                        (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WKWebViewTextInput.mm	2016-06-02 05:21:30 UTC (rev 201592)
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+
+#if WK_API_ENABLED
+#if PLATFORM(MAC)
+
+#import <WebKit/WKFoundation.h>
+#import "PlatformUtilities.h"
+#import "Test.h"
+#import <WebKit/WKWebView.h>
+#import <wtf/RetainPtr.h>
+
+static bool isDone;
+
+@interface DummyNavigationDelegate : NSObject <WKNavigationDelegate>
+@end
+
+@implementation DummyNavigationDelegate
+
+- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation
+{
+    isDone = true;
+}
+
+@end
+
+TEST(WKWebView, ShouldHaveInputContextForEditableContent)
+{
+    RetainPtr<WKWebView> webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600)]);
+    RetainPtr<DummyNavigationDelegate> delegate = adoptNS([[DummyNavigationDelegate alloc] init]);
+    [webView setNavigationDelegate:delegate.get()];
+
+    NSURLRequest *request = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"editable-body" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]];
+    [webView loadRequest:request];
+    TestWebKitAPI::Util::run(&isDone);
+
+    EXPECT_NOT_NULL([webView inputContext]);
+}
+
+#endif
+#endif

Added: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/editable-body.html (0 => 201592)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/editable-body.html	                        (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/editable-body.html	2016-06-02 05:21:30 UTC (rev 201592)
@@ -0,0 +1,7 @@
+<html>
+    <body contenteditable>Lorem Ipsum Et Cetera
+        <script>
+            document.body.focus();
+        </script>
+    </body>
+</html>
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to