[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 08:19:00 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit b6f6dce7c54bf1dc9239f6061c173ef807d5f9ac
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Dec 15 00:46:46 2003 +0000

    WebCore:
    
            Reviewed by Maciej.
    
            - fixed 3311205: click() on a file input type form element does not work bring up the file chooser as it does in IE
    
            * khtml/html/html_formimpl.cpp:
            (HTMLInputElementImpl::click): Add a case for FILE that calls RenderFileButton's click() function.
            Get rid of the default case and list more cases explicitly.
            (HTMLInputElementImpl::accessKeyAction): Change FILE from just focus to focus/click.
    
            * khtml/rendering/render_form.h: Added a click() function to RenderFileButton.
            * khtml/rendering/render_form.cpp:
            (RenderFileButton::slotTextChanged): Added call to onChange on the element to match text input
            fields; helpful for the test case Adobe supplied.
            (RenderFileButton::click): Added. Calls click() on KWQFileButton.
    
            * kwq/KWQFileButton.h: Added a click function.
            * kwq/KWQFileButton.mm: (KWQFileButton::click): Added. Calls performClick on the file button.
    
            * kwq/WebCoreBridge.h: Add a performClick method to WebCoreFileButton.
    
    WebKit:
    
            Reviewed by Maciej.
    
            - fixed 3311205: click() on a file input type form element does not work bring up the file chooser as it does in IE
    
            * WebCoreSupport.subproj/WebFileButton.m: (-[WebFileButton performClick]):
            Add method for clicking, now part of the WebCoreFileButton protocol.
            The rest of the fix is in WebCore.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5796 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index c67a233..d113cac 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,25 @@
+2003-12-14  Darin Adler  <darin at apple.com>
+
+        Reviewed by Maciej.
+
+        - fixed 3311205: click() on a file input type form element does not work bring up the file chooser as it does in IE
+
+        * khtml/html/html_formimpl.cpp:
+        (HTMLInputElementImpl::click): Add a case for FILE that calls RenderFileButton's click() function.
+        Get rid of the default case and list more cases explicitly.
+        (HTMLInputElementImpl::accessKeyAction): Change FILE from just focus to focus/click.
+
+        * khtml/rendering/render_form.h: Added a click() function to RenderFileButton.
+        * khtml/rendering/render_form.cpp:
+        (RenderFileButton::slotTextChanged): Added call to onChange on the element to match text input
+        fields; helpful for the test case Adobe supplied.
+        (RenderFileButton::click): Added. Calls click() on KWQFileButton.
+
+        * kwq/KWQFileButton.h: Added a click function.
+        * kwq/KWQFileButton.mm: (KWQFileButton::click): Added. Calls performClick on the file button.
+
+        * kwq/WebCoreBridge.h: Add a performClick method to WebCoreFileButton.
+
 2003-12-13  Maciej Stachowiak  <mjs at apple.com>
 
         Reviewed by Darin.
diff --git a/WebCore/khtml/html/html_formimpl.cpp b/WebCore/khtml/html/html_formimpl.cpp
index 38a0945..7f3f200 100644
--- a/WebCore/khtml/html/html_formimpl.cpp
+++ b/WebCore/khtml/html/html_formimpl.cpp
@@ -1309,13 +1309,25 @@ void HTMLInputElementImpl::click()
             if (renderer() && (widget = static_cast<RenderWidget *>(renderer())->widget())) {
                 // using this method gives us nice Cocoa user interface feedback
                 static_cast<QButton *>(widget)->click();
+                break;
             }
-            else
-                HTMLGenericFormElementImpl::click();
-            break;
         }
 #endif
-        default:
+            HTMLGenericFormElementImpl::click();
+            break;
+        case FILE:
+#if APPLE_CHANGES
+            if (renderer()) {
+                static_cast<RenderFileButton *>(renderer())->click();
+                break;
+            }
+#endif
+            HTMLGenericFormElementImpl::click();
+            break;
+        case IMAGE:
+        case ISINDEX:
+        case PASSWORD:
+        case TEXT:
             HTMLGenericFormElementImpl::click();
             break;
     }
@@ -1330,7 +1342,6 @@ void HTMLInputElementImpl::accessKeyAction()
         case TEXT:
         case PASSWORD:
         case ISINDEX:
-        case FILE:
             focus();
             break;
         case CHECKBOX:
@@ -1339,6 +1350,7 @@ void HTMLInputElementImpl::accessKeyAction()
         case RESET:
         case IMAGE:
         case BUTTON:
+        case FILE:
             // focus and click
             focus();
             click();
diff --git a/WebCore/khtml/rendering/render_form.cpp b/WebCore/khtml/rendering/render_form.cpp
index e482816..07f0bd0 100644
--- a/WebCore/khtml/rendering/render_form.cpp
+++ b/WebCore/khtml/rendering/render_form.cpp
@@ -904,7 +904,8 @@ void RenderFileButton::slotReturnPressed()
 
 void RenderFileButton::slotTextChanged(const QString &string)
 {
-   element()->m_value = DOMString(string);
+    element()->m_value = DOMString(string);
+    element()->onChange();
 }
 
 void RenderFileButton::select()
@@ -914,6 +915,14 @@ void RenderFileButton::select()
 #endif
 }
 
+#if APPLE_CHANGES
+
+void RenderFileButton::click()
+{
+    static_cast<KWQFileButton *>(widget())->click();
+}
+
+#endif
 
 // -------------------------------------------------------------------------
 
diff --git a/WebCore/khtml/rendering/render_form.h b/WebCore/khtml/rendering/render_form.h
index 38068ea..0a85b17 100644
--- a/WebCore/khtml/rendering/render_form.h
+++ b/WebCore/khtml/rendering/render_form.h
@@ -327,6 +327,10 @@ public:
     KLineEdit* lineEdit() const { return m_edit; }
 #endif
 
+#if APPLE_CHANGES
+    void click();
+#endif
+
 public slots:
     virtual void slotClicked();
     virtual void slotReturnPressed();
diff --git a/WebCore/kwq/KWQFileButton.h b/WebCore/kwq/KWQFileButton.h
index c67a54e..0d7bf26 100644
--- a/WebCore/kwq/KWQFileButton.h
+++ b/WebCore/kwq/KWQFileButton.h
@@ -41,6 +41,7 @@ public:
     ~KWQFileButton();
     
     void setFilename(const QString &);
+    void click();
     
     QSize sizeForCharacterWidth(int characters) const;
     QRect frameGeometry() const;
diff --git a/WebCore/kwq/KWQFileButton.mm b/WebCore/kwq/KWQFileButton.mm
index d814231..8665637 100644
--- a/WebCore/kwq/KWQFileButton.mm
+++ b/WebCore/kwq/KWQFileButton.mm
@@ -74,6 +74,15 @@ void KWQFileButton::setFilename(const QString &f)
     KWQ_UNBLOCK_EXCEPTIONS;
 }
 
+void KWQFileButton::click()
+{
+    NSView <WebCoreFileButton> *button = getView();
+
+    KWQ_BLOCK_EXCEPTIONS;
+    [button performClick];
+    KWQ_UNBLOCK_EXCEPTIONS;
+}
+
 QSize KWQFileButton::sizeForCharacterWidth(int characters) const
 {
     ASSERT(characters > 0);
diff --git a/WebCore/kwq/WebCoreBridge.h b/WebCore/kwq/WebCoreBridge.h
index 95cc605..ddca20b 100644
--- a/WebCore/kwq/WebCoreBridge.h
+++ b/WebCore/kwq/WebCoreBridge.h
@@ -40,7 +40,6 @@ namespace khtml {
     class RenderObject;
 }
 
-
 typedef khtml::RenderPart KHTMLRenderPart;
 
 #else
@@ -392,6 +391,7 @@ typedef enum {
 
 @protocol WebCoreFileButton <NSObject>
 - (void)setFilename:(NSString *)filename;
+- (void)performClick;
 - (NSString *)filename;
 - (float)baseline;
 - (void)setVisualFrame:(NSRect)rect;
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index eb2627d..ae91055 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,13 @@
+2003-12-14  Darin Adler  <darin at apple.com>
+
+        Reviewed by Maciej.
+
+        - fixed 3311205: click() on a file input type form element does not work bring up the file chooser as it does in IE
+
+        * WebCoreSupport.subproj/WebFileButton.m: (-[WebFileButton performClick]):
+        Add method for clicking, now part of the WebCoreFileButton protocol.
+        The rest of the fix is in WebCore.
+
 2003-12-13  Darin Adler  <darin at apple.com>
 
         Fixed by Ed Voas, reviewed by me.
diff --git a/WebKit/WebCoreSupport.subproj/WebFileButton.m b/WebKit/WebCoreSupport.subproj/WebFileButton.m
index ab20008..d285863 100644
--- a/WebKit/WebCoreSupport.subproj/WebFileButton.m
+++ b/WebKit/WebCoreSupport.subproj/WebFileButton.m
@@ -289,6 +289,11 @@
     return view;
 }
 
+- (void)performClick
+{
+    [_button performClick:nil];
+}
+
 @end
 
 @implementation WebFileChooserButton

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list