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

kocienda kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:17:36 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 11bb1581154c43a0d7a5a168a92394948cd228b4
Author: kocienda <kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Dec 28 23:30:01 2002 +0000

    WebCore:
    
            Reviewed by Gramps and Richard.
    
    	Fix for this bug:
    
    	Radar 3112233 (400 response when attaching files at mail.yahoo.com)
    
    	KHTML multipart form code called into KMimeType class to determine
    	the mime type for file attachments, however, our implementation of
    	KMimeType has only stubs which call ERROR.
    
    	I added some code into KWQKHTMLPart and WebCoreBridge so that the
    	code in html_formimpl can call through to the WebFoundation mime
    	file map we maintain.
    
            * khtml/html/html_formimpl.cpp:
            (HTMLFormElementImpl::formData)
            * kwq/KWQKHTMLPart.h:
            * kwq/KWQKHTMLPart.mm:
            (KWQKHTMLPart::mimeTypeForFileName)
            * kwq/WebCoreBridge.h:
    
    WebKit:
    
             Reviewed by Gramps and Richard
    
             Fix for this bug:
    
             Radar 3112233 (400 response when attaching files at mail.yahoo.com)
    
             I added the MIMETypeForPath method which accesses the WebFoundation mime
             file map we maintain. KHTML can now access this map by using the bridge.
    
             * WebCoreSupport.subproj/WebBridge.m:
             (-[WebBridge MIMETypeForPath:])
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3195 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 4f9b54c..e63c717 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,26 @@
+2002-12-28  Ken Kocienda  <kocienda at apple.com>
+
+        Reviewed by Gramps and Richard.
+
+	Fix for this bug:
+
+	Radar 3112233 (400 response when attaching files at mail.yahoo.com)
+
+	KHTML multipart form code called into KMimeType class to determine
+	the mime type for file attachments, however, our implementation of
+	KMimeType has only stubs which call ERROR.
+
+	I added some code into KWQKHTMLPart and WebCoreBridge so that the
+	code in html_formimpl can call through to the WebFoundation mime
+	file map we maintain.
+
+        * khtml/html/html_formimpl.cpp:
+        (HTMLFormElementImpl::formData)
+        * kwq/KWQKHTMLPart.h:
+        * kwq/KWQKHTMLPart.mm:
+        (KWQKHTMLPart::mimeTypeForFileName)
+        * kwq/WebCoreBridge.h:
+
 2002-12-26  Darin Adler  <darin at apple.com>
 
         Reviewed by Don.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 4f9b54c..e63c717 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,26 @@
+2002-12-28  Ken Kocienda  <kocienda at apple.com>
+
+        Reviewed by Gramps and Richard.
+
+	Fix for this bug:
+
+	Radar 3112233 (400 response when attaching files at mail.yahoo.com)
+
+	KHTML multipart form code called into KMimeType class to determine
+	the mime type for file attachments, however, our implementation of
+	KMimeType has only stubs which call ERROR.
+
+	I added some code into KWQKHTMLPart and WebCoreBridge so that the
+	code in html_formimpl can call through to the WebFoundation mime
+	file map we maintain.
+
+        * khtml/html/html_formimpl.cpp:
+        (HTMLFormElementImpl::formData)
+        * kwq/KWQKHTMLPart.h:
+        * kwq/KWQKHTMLPart.mm:
+        (KWQKHTMLPart::mimeTypeForFileName)
+        * kwq/WebCoreBridge.h:
+
 2002-12-26  Darin Adler  <darin at apple.com>
 
         Reviewed by Don.
diff --git a/WebCore/khtml/html/html_formimpl.cpp b/WebCore/khtml/html/html_formimpl.cpp
index f5f1c1b..e71f756 100644
--- a/WebCore/khtml/html/html_formimpl.cpp
+++ b/WebCore/khtml/html/html_formimpl.cpp
@@ -314,8 +314,14 @@ QByteArray HTMLFormElementImpl::formData(bool& ok)
                         if(!static_cast<HTMLInputElementImpl*>(current)->value().isEmpty())
                         {
                             hstr += "\r\nContent-Type: ";
+#if APPLE_CHANGES
+                            KWQKHTMLPart *part = KWQ(current->getDocument()->view()->part());
+                            QString mimeType = part->mimeTypeForFileName(onlyfilename);
+                            hstr += mimeType.ascii();
+#else /* APPLE_CHANGES not defined */
                             KMimeType::Ptr ptr = KMimeType::findByURL(KURL(path));
                             hstr += ptr->name().ascii();
+#endif /* APPLE_CHANGES not defined */
                         }
                     }
 
diff --git a/WebCore/kwq/KWQKHTMLPart.h b/WebCore/kwq/KWQKHTMLPart.h
index 895e918..8801f10 100644
--- a/WebCore/kwq/KWQKHTMLPart.h
+++ b/WebCore/kwq/KWQKHTMLPart.h
@@ -133,6 +133,8 @@ public:
     QString requestedURLString() const;
     QString referrer() const;    
     QString userAgent() const;
+
+    QString mimeTypeForFileName(const QString &) const;
     
     DOM::NodeImpl *selectionStart() const;
     int selectionStartOffset() const;
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index 69eb441..e9c62cd 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -356,6 +356,13 @@ QString KWQKHTMLPart::userAgent() const
     return QString();
 }
 
+QString KWQKHTMLPart::mimeTypeForFileName(const QString &fileName) const
+{
+    NSString *ns = fileName.getNSString();
+    NSString *mimeType = [_bridge MIMETypeForPath:ns];
+    return QString::fromNSString(mimeType);
+}
+
 NSView *KWQKHTMLPart::nextKeyViewInFrame(NodeImpl *node, KWQSelectionDirection direction)
 {
     DocumentImpl *doc = xmlDocImpl();
diff --git a/WebCore/kwq/WebCoreBridge.h b/WebCore/kwq/WebCoreBridge.h
index 2353139..8692d2d 100644
--- a/WebCore/kwq/WebCoreBridge.h
+++ b/WebCore/kwq/WebCoreBridge.h
@@ -251,6 +251,8 @@ enum FrameBorderStyle {
 
 - (void)loadEmptyDocumentSynchronously;
 
+- (NSString *)MIMETypeForPath:(NSString *)path;
+
 @end
 
 // This interface definition allows those who hold a WebCoreBridge * to call all the methods
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 8b1607d..dea8ecb 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,17 @@
+2002-12-28  Ken Kocienda  <kocienda at apple.com>
+
+         Reviewed by Gramps and Richard
+
+         Fix for this bug:
+
+         Radar 3112233 (400 response when attaching files at mail.yahoo.com)
+
+         I added the MIMETypeForPath method which accesses the WebFoundation mime
+         file map we maintain. KHTML can now access this map by using the bridge.
+
+         * WebCoreSupport.subproj/WebBridge.m:
+         (-[WebBridge MIMETypeForPath:])
+
 2002-12-28  Darin Adler  <darin at apple.com>
 
         Reviewed by Gramps and Ken
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.m b/WebKit/WebCoreSupport.subproj/WebBridge.m
index 96a025b..4e2e2d3 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.m
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.m
@@ -41,6 +41,7 @@
 #import <WebFoundation/WebResourceHandle.h>
 #import <WebFoundation/WebResourceResponse.h>
 #import <WebFoundation/WebSystemBits.h>
+#import <WebFoundation/WebFileTypeMappings.h>
 
 
 @interface NSApplication (DeclarationStolenFromAppKit)
@@ -563,4 +564,11 @@ static BOOL loggedObjectCacheSize = NO;
     [url release];
 }
 
+- (NSString *)MIMETypeForPath:(NSString *)path
+{
+    ASSERT(path);
+    NSString *extension = [path pathExtension];
+    return [[WebFileTypeMappings sharedMappings] MIMETypeForExtension:extension];
+}
+
 @end

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list