[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

mjs mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:11:06 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit a42e8517f4fa36a4ef15a652ac59924172660105
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Nov 11 23:16:10 2003 +0000

            Reviewed by Ken.
    
    	- fixed 3472330 -  REGRESSION: onKeyPress handler not called when hitting keys in <input type=password> field
    
            * kwq/KWQTextField.mm:
            (-[KWQSecureTextField initWithQLineEdit:]): New initializer, so
    	the secure text field knows about the widget.
            (-[KWQTextField setPasswordMode:]): Use new initializer for
    	KWQSecureTextField.
            (-[KWQSecureTextField textView:shouldHandleEvent:]): New method,
    	do the same thing as the non-secure text field to pass the event on.
            (-[KWQSecureTextField textView:didHandleEvent:]): Ditto.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5458 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index e8f9cba..777e85e 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,18 @@
+2003-11-11  Maciej Stachowiak  <mjs at apple.com>
+
+        Reviewed by Ken.
+
+	- fixed 3472330 -  REGRESSION: onKeyPress handler not called when hitting keys in <input type=password> field
+
+        * kwq/KWQTextField.mm:
+        (-[KWQSecureTextField initWithQLineEdit:]): New initializer, so
+	the secure text field knows about the widget.
+        (-[KWQTextField setPasswordMode:]): Use new initializer for
+	KWQSecureTextField.
+        (-[KWQSecureTextField textView:shouldHandleEvent:]): New method,
+	do the same thing as the non-secure text field to pass the event on.
+        (-[KWQSecureTextField textView:didHandleEvent:]): Ditto.
+
 2003-11-11  Ken Kocienda  <kocienda at apple.com>
 
         Reviewed by Maciej
diff --git a/WebCore/kwq/KWQTextField.mm b/WebCore/kwq/KWQTextField.mm
index c0f98d5..dab4294 100644
--- a/WebCore/kwq/KWQTextField.mm
+++ b/WebCore/kwq/KWQTextField.mm
@@ -69,9 +69,13 @@
 // Another is hook up next and previous key views to KHTML.
 @interface KWQSecureTextField : NSSecureTextField <KWQWidgetHolder>
 {
+    QLineEdit *widget;
     BOOL inNextValidKeyView;
     BOOL inSetFrameSize;
 }
+
+- (id)initWithQLineEdit:(QLineEdit *)widget;
+
 @end
 
 // KWQSecureTextFieldCell allows us to tell when we get focus without an editor subclass,
@@ -171,7 +175,7 @@
         [secureField removeFromSuperview];
     } else {
         if (secureField == nil) {
-            secureField = [[KWQSecureTextField alloc] init];
+            secureField = [[KWQSecureTextField alloc] initWithQLineEdit:widget];
             [secureField setFormatter:formatter];
             [secureField setFont:[self font]];
             [secureField setEditable:[self isEditable]];
@@ -704,6 +708,12 @@
 
 @implementation KWQSecureTextField
 
+-(id)initWithQLineEdit:(QLineEdit *)w 
+{
+    widget = w;
+    return [self init];
+}
+
 // Can't use setCellClass: because NSSecureTextField won't let us (for no good reason).
 + (Class)cellClass
 {
@@ -818,6 +828,30 @@
     }
 }
 
+- (BOOL)textView:(NSTextView *)view shouldHandleEvent:(NSEvent *)event
+{
+    if (!widget) {
+	return YES;
+    }
+
+    if ([event type] == NSKeyDown || [event type] == NSKeyUp) {
+        WebCoreBridge *bridge = KWQKHTMLPart::bridgeForWidget(widget);
+        return ![bridge interceptKeyEvent:event toView:view];
+    }
+    return YES;
+}
+
+- (void)textView:(NSTextView *)view didHandleEvent:(NSEvent *)event
+{
+    if (!widget) {
+	return;
+    }
+    if ([event type] == NSLeftMouseUp) {
+        widget->sendConsumedMouseUp();
+        widget->clicked();
+    }
+}
+
 @end
 
 @implementation KWQSecureTextFieldCell

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list