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

darin darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:35:30 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 43c08d6c1f98ea0176e53cbe8ab3f2c5909f8004
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Apr 8 23:29:59 2003 +0000

            Reviewed by Maciej.
    
    	- fixed 3221400 -- REGRESSION: password field with onfocus handler that does select causes focus/typing trouble
    
            * kwq/KWQTextField.mm:
            (-[KWQTextField selectText:]): Rearrange slightly.
            (-[KWQTextField becomeFirstResponder]): Add code to make the secure field first responder
            when in password mode. The old code did this indirectly through the call to setDocumentFocus,
            which caused minor trouble.
            (-[KWQSecureTextField selectText:]): Correct the current editor check to use a technique
            that works even for the secure text field's editor (which does not get returned by currentEditor).
    
            * kwq/KWQWidget.mm: (QWidget::hasFocus): Update the logic here so it works for the secure text
            field and the secure text field's editor.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4049 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index d1ef97d..5a390ad 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,20 @@
+2003-04-08  Darin Adler  <darin at apple.com>
+
+        Reviewed by Maciej.
+
+	- fixed 3221400 -- REGRESSION: password field with onfocus handler that does select causes focus/typing trouble
+
+        * kwq/KWQTextField.mm:
+        (-[KWQTextField selectText:]): Rearrange slightly.
+        (-[KWQTextField becomeFirstResponder]): Add code to make the secure field first responder
+        when in password mode. The old code did this indirectly through the call to setDocumentFocus,
+        which caused minor trouble.
+        (-[KWQSecureTextField selectText:]): Correct the current editor check to use a technique
+        that works even for the secure text field's editor (which does not get returned by currentEditor).
+        
+        * kwq/KWQWidget.mm: (QWidget::hasFocus): Update the logic here so it works for the secure text
+        field and the secure text field's editor.
+
 2003-04-08  David Hyatt  <hyatt at apple.com>
 
 	Fix for 3166374.  Making the nudie blog work.  My loop for
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index d1ef97d..5a390ad 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,20 @@
+2003-04-08  Darin Adler  <darin at apple.com>
+
+        Reviewed by Maciej.
+
+	- fixed 3221400 -- REGRESSION: password field with onfocus handler that does select causes focus/typing trouble
+
+        * kwq/KWQTextField.mm:
+        (-[KWQTextField selectText:]): Rearrange slightly.
+        (-[KWQTextField becomeFirstResponder]): Add code to make the secure field first responder
+        when in password mode. The old code did this indirectly through the call to setDocumentFocus,
+        which caused minor trouble.
+        (-[KWQSecureTextField selectText:]): Correct the current editor check to use a technique
+        that works even for the secure text field's editor (which does not get returned by currentEditor).
+        
+        * kwq/KWQWidget.mm: (QWidget::hasFocus): Update the logic here so it works for the secure text
+        field and the secure text field's editor.
+
 2003-04-08  David Hyatt  <hyatt at apple.com>
 
 	Fix for 3166374.  Making the nudie blog work.  My loop for
diff --git a/WebCore/kwq/KWQTextField.mm b/WebCore/kwq/KWQTextField.mm
index 9dbf966..ecb0676 100644
--- a/WebCore/kwq/KWQTextField.mm
+++ b/WebCore/kwq/KWQTextField.mm
@@ -161,9 +161,10 @@
     NSText *editor = [self currentEditor];
     if (editor) {
         [editor setSelectedRange:NSMakeRange(0, [[editor string] length])];
-    } else {
-        [super selectText:sender];
+        return;
     }
+    
+    [super selectText:sender];
 }
 
 - (BOOL)isEditable
@@ -323,10 +324,10 @@
 
 - (BOOL)becomeFirstResponder
 {
-    KWQKHTMLPart::setDocumentFocus(widget);
-    if (!widget->hasFocus()) {
-        return NO;
+    if ([self passwordMode]) {
+        return [[self window] makeFirstResponder:secureField];
     }
+    KWQKHTMLPart::setDocumentFocus(widget);
     [self _KWQ_scrollFrameToVisible];
     return [super becomeFirstResponder];
 }
@@ -446,15 +447,20 @@
         return;
     }
     
-    // Don't call the NSTextField's selectText if the field is already first responder.
+    // Don't call the NSSecureTextField's selectText if the field is already first responder.
     // If we do, we'll end up deactivating and then reactivating, which will send
-    // unwanted onBlur events.
-    NSText *editor = [self currentEditor];
-    if (editor) {
-        [editor setSelectedRange:NSMakeRange(0, [[editor string] length])];
-    } else {
-        [super selectText:sender];
+    // unwanted onBlur events and wreak havoc in other ways as well by setting the focus
+    // back to the window.
+    NSResponder *firstResponder = [[self window] firstResponder];
+    if ([firstResponder isKindOfClass:[NSTextView class]]) {
+        NSTextView *textView = (NSTextView *)firstResponder;
+        if ([textView delegate] == self) {
+            [textView setSelectedRange:NSMakeRange(0, [[textView string] length])];
+            return;
+        }
     }
+
+    [super selectText:sender];
 }
 
 - (void)setFrameSize:(NSSize)size
diff --git a/WebCore/kwq/KWQWidget.mm b/WebCore/kwq/KWQWidget.mm
index 4e02cc3..c265214 100644
--- a/WebCore/kwq/KWQWidget.mm
+++ b/WebCore/kwq/KWQWidget.mm
@@ -171,11 +171,11 @@ bool QWidget::hasFocus() const
     if (firstResponder == view) {
         return true;
     }
-    if ([view isKindOfClass:[NSControl class]]) {
-        NSControl *control = view;
-        if (firstResponder == [control currentEditor]) {
-            return true;
-        }
+    // The following check handles both text field editors and the secure text field
+    // that goes inside the KWQTextField (and its editor). We have to check the class
+    // of the view because we don't want to be fooled by subviews of NSScrollView, for example.
+    if ([view isKindOfClass:[NSTextField class]] && [firstResponder isDescendantOf:view]) {
+        return true;
     }
     return false;
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list