Title: [93844] trunk/Source/WebKit2
Revision
93844
Author
[email protected]
Date
2011-08-25 17:54:43 -0700 (Thu, 25 Aug 2011)

Log Message

Correctly handle events in the updated Cocoa text input model
https://bugs.webkit.org/show_bug.cgi?id=67005

Reviewed by Sam Weinig.

* UIProcess/API/mac/WKTextInputWindowController.mm:
(-[WKTextInputPanel _interpretKeyEvent:usingLegacyCocoaTextInput:string:]):
When using the updated model, always return a string even for 'simple' characters.

* UIProcess/API/mac/WKView.mm:
(-[WKView _tryHandlePluginComplexTextInputKeyDown:]):
Only let the input method have a crack at the event in the legacy model.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (93843 => 93844)


--- trunk/Source/WebKit2/ChangeLog	2011-08-26 00:51:06 UTC (rev 93843)
+++ trunk/Source/WebKit2/ChangeLog	2011-08-26 00:54:43 UTC (rev 93844)
@@ -1,3 +1,18 @@
+2011-08-25  Anders Carlsson  <[email protected]>
+
+        Correctly handle events in the updated Cocoa text input model
+        https://bugs.webkit.org/show_bug.cgi?id=67005
+
+        Reviewed by Sam Weinig.
+
+        * UIProcess/API/mac/WKTextInputWindowController.mm:
+        (-[WKTextInputPanel _interpretKeyEvent:usingLegacyCocoaTextInput:string:]):
+        When using the updated model, always return a string even for 'simple' characters.
+
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView _tryHandlePluginComplexTextInputKeyDown:]):
+        Only let the input method have a crack at the event in the legacy model.
+
 2011-08-25  Jeff Miller  <[email protected]>
 
         Move Windows-specific WebPageProxy code to WebPageProxyWin.cpp

Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKTextInputWindowController.mm (93843 => 93844)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKTextInputWindowController.mm	2011-08-26 00:51:06 UTC (rev 93843)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKTextInputWindowController.mm	2011-08-26 00:54:43 UTC (rev 93844)
@@ -107,8 +107,14 @@
 
         return YES;
     }
-    
-    if (hadMarkedText) {
+
+    bool shouldReturnTextString = hadMarkedText;
+
+    // In the updated Cocoa text input model spec, we always want to return the text even if the text view didn't have marked text.
+    if (!usingLegacyCocoaTextInput)
+        shouldReturnTextString = true;
+
+    if (shouldReturnTextString) {
         [self orderOut:nil];
 
         NSString *text = [[_inputTextView textStorage] string];

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


--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm	2011-08-26 00:51:06 UTC (rev 93843)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm	2011-08-26 00:54:43 UTC (rev 93844)
@@ -1304,7 +1304,10 @@
     [self _disableComplexTextInputIfNecessary];
 
     // Try feeding the keyboard event directly to the plug-in.
-    return [self _handlePluginComplexTextInputKeyDown:event];
+    if (_data->_pluginComplexTextInputState == PluginComplexTextInputEnabledLegacy)
+        return [self _handlePluginComplexTextInputKeyDown:event];
+
+    return NO;
 }
 
 - (void)keyDown:(NSEvent *)theEvent
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to