Fix layout test results for webarchive/test-xml-stylesheet.xml
authorddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 31 Jul 2008 21:21:30 +0000 (21:21 +0000)
committerddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 31 Jul 2008 21:21:30 +0000 (21:21 +0000)
WebKit:

        Fix layout test results for webarchive/test-xml-stylesheet.xml

        Reviewed by Darin.

        * WebKit.xcodeproj/project.pbxproj: Added WebHTMLRepresentationInternal.h.
        Changed WebHTMLRepresentationInternal.h and WebHTMLRepresentationPrivate.h
        to private so they're copied into PrivateHeaders.

WebKit/mac:

        Fix layout test results for webarchive/test-xml-stylesheet.xml

        Reviewed by Darin.

        Needed to expose -[WebHTMLRepresentation supportedNonImageMIMETypes]
        for DumpRenderTree.

        * WebView/WebHTMLRepresentationInternal.h: Added.

WebKitTools:

        Fix layout test results for webarchive/test-xml-stylesheet.xml

        Reviewed by Darin.

        * DumpRenderTree/mac/DumpRenderTree.mm:
        (convertMIMEType): Work around the "text/xml" local file type
        regression in Leopard using the BUILDING_ON_LEOPARD macro.  Also
        stop mangling "application/x-javascript" into "text/javascript".
        (convertWebResourceDataToString): When checking whether to dump a
        resource as text, also check to see if the MIME type is in the
        -[WebHTMLRepresentation supportedNonImageMIMETypes] array.
        * DumpRenderTree/mac/DumpRenderTreeMac.h: Added BUILDING_ON_LEOPARD
        macro.

LayoutTests:

        Fix layout test results for webarchive/test-xml-stylesheet.xml

        Reviewed by Darin.

        * platform/mac/webarchive/test-xml-stylesheet-expected.txt:
        Removed unused test results.

        * webarchive/test-duplicate-resources-expected.webarchive: Updated
        results now that we don't mangle application/x-javascript into
        text/javascript.
        * webarchive/test-script-src-expected.webarchive: Ditto.

        * webarchive/test-xml-stylesheet-expected.webarchive: Updated
        results now that we handle application/xml correctly.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@35497 268f45cc-cd09-0410-ab3c-d52691b4dbfc

12 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac/webarchive/test-xml-stylesheet-expected.txt [deleted file]
LayoutTests/webarchive/test-duplicate-resources-expected.webarchive
LayoutTests/webarchive/test-script-src-expected.webarchive
LayoutTests/webarchive/test-xml-stylesheet-expected.webarchive
WebKit/ChangeLog
WebKit/WebKit.xcodeproj/project.pbxproj
WebKit/mac/ChangeLog
WebKit/mac/WebView/WebHTMLRepresentationInternal.h [new file with mode: 0644]
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
WebKitTools/DumpRenderTree/mac/DumpRenderTreeMac.h

index 422940b..15c54fb 100644 (file)
@@ -1,3 +1,20 @@
+2008-07-31  David D. Kilzer  <ddkilzer@webkit.org>
+
+        Fix layout test results for webarchive/test-xml-stylesheet.xml
+
+        Reviewed by Darin.
+
+        * platform/mac/webarchive/test-xml-stylesheet-expected.txt:
+        Removed unused test results.
+
+        * webarchive/test-duplicate-resources-expected.webarchive: Updated
+        results now that we don't mangle application/x-javascript into
+        text/javascript.
+        * webarchive/test-script-src-expected.webarchive: Ditto.
+
+        * webarchive/test-xml-stylesheet-expected.webarchive: Updated
+        results now that we handle application/xml correctly.
+
 2008-07-31  chris fleizach  <cfleizach@apple.com>
 
         Reviewed by Alice Liu
diff --git a/LayoutTests/platform/mac/webarchive/test-xml-stylesheet-expected.txt b/LayoutTests/platform/mac/webarchive/test-xml-stylesheet-expected.txt
deleted file mode 100644 (file)
index 0155098..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-       <key>WebMainResource</key>
-       <dict>
-               <key>WebResourceData</key>
-               <string>&lt;?xml-stylesheet href="resources/test-xml-stylesheet.css" type="text/css"?&gt;&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
-  &lt;script&gt;
-    if (window.layoutTestController)
-        layoutTestController.dumpDOMAsWebArchive();
-  &lt;/script&gt;
-  &lt;style&gt;
-    div { background: red; width: 100px; height: 100px; }
-  &lt;/style&gt;
-  &lt;div id="test"&gt;
-  &lt;/div&gt;
-&lt;/html&gt;</string>
-               <key>WebResourceFrameName</key>
-               <string></string>
-               <key>WebResourceMIMEType</key>
-               <string>text/xml</string>
-               <key>WebResourceTextEncodingName</key>
-               <string>UTF-8</string>
-               <key>WebResourceURL</key>
-               <string>file:///LayoutTests/webarchive/test-xml-stylesheet.xml</string>
-       </dict>
-       <key>WebSubresources</key>
-       <array>
-               <dict>
-                       <key>WebResourceData</key>
-                       <string>#test {
-  background: green;
-}
-</string>
-                       <key>WebResourceMIMEType</key>
-                       <string>text/css</string>
-                       <key>WebResourceResponse</key>
-                       <dict>
-                               <key>MIMEType</key>
-                               <string>text/css</string>
-                               <key>URL</key>
-                               <string>file:///LayoutTests/webarchive/resources/test-xml-stylesheet.css</string>
-                               <key>expectedContentLength</key>
-                               <integer>31</integer>
-                       </dict>
-                       <key>WebResourceURL</key>
-                       <string>file:///LayoutTests/webarchive/resources/test-xml-stylesheet.css</string>
-               </dict>
-       </array>
-</dict>
-</plist>
index 103785a..ab7b62c 100644 (file)
     layoutTestController.dumpDOMAsWebArchive();
 </string>
                        <key>WebResourceMIMEType</key>
-                       <string>text/javascript</string>
+                       <string>application/x-javascript</string>
                        <key>WebResourceResponse</key>
                        <dict>
                                <key>MIMEType</key>
-                               <string>text/javascript</string>
+                               <string>application/x-javascript</string>
                                <key>URL</key>
                                <string>file:///LayoutTests/webarchive/resources/dump-webarchive.js</string>
                                <key>expectedContentLength</key>
index 2e3b365..57a90f3 100644 (file)
     layoutTestController.dumpDOMAsWebArchive();
 </string>
                        <key>WebResourceMIMEType</key>
-                       <string>text/javascript</string>
+                       <string>application/x-javascript</string>
                        <key>WebResourceResponse</key>
                        <dict>
                                <key>MIMEType</key>
-                               <string>text/javascript</string>
+                               <string>application/x-javascript</string>
                                <key>URL</key>
                                <string>file:///LayoutTests/webarchive/resources/dump-webarchive.js</string>
                                <key>expectedContentLength</key>
index d86ecb3..2410065 100644 (file)
@@ -5,16 +5,17 @@
        <key>WebMainResource</key>
        <dict>
                <key>WebResourceData</key>
-               <data>
-               PD94bWwtc3R5bGVzaGVldCBocmVmPSJyZXNvdXJjZXMvdGVzdC14bWwtc3R5
-               bGVzaGVldC5jc3MiIHR5cGU9InRleHQvY3NzIj8+PGh0bWwgeG1sbnM9Imh0
-               dHA6Ly93d3cudzMub3JnLzE5OTkveGh0bWwiPgogIDxzY3JpcHQ+CiAgICBp
-               ZiAod2luZG93LmxheW91dFRlc3RDb250cm9sbGVyKQogICAgICAgIGxheW91
-               dFRlc3RDb250cm9sbGVyLmR1bXBET01Bc1dlYkFyY2hpdmUoKTsKICA8L3Nj
-               cmlwdD4KICA8c3R5bGU+CiAgICBkaXYgeyBiYWNrZ3JvdW5kOiByZWQ7IHdp
-               ZHRoOiAxMDBweDsgaGVpZ2h0OiAxMDBweDsgfQogIDwvc3R5bGU+CiAgPGRp
-               diBpZD0idGVzdCI+CiAgPC9kaXY+CjwvaHRtbD4=
-               </data>
+               <string>&lt;?xml-stylesheet href="resources/test-xml-stylesheet.css" type="text/css"?&gt;&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
+  &lt;script&gt;
+    if (window.layoutTestController)
+        layoutTestController.dumpDOMAsWebArchive();
+  &lt;/script&gt;
+  &lt;style&gt;
+    div { background: red; width: 100px; height: 100px; }
+  &lt;/style&gt;
+  &lt;div id="test"&gt;
+  &lt;/div&gt;
+&lt;/html&gt;</string>
                <key>WebResourceFrameName</key>
                <string></string>
                <key>WebResourceMIMEType</key>
index d80e200..7367642 100644 (file)
@@ -1,3 +1,13 @@
+2008-07-31  David D. Kilzer  <ddkilzer@webkit.org>
+
+        Fix layout test results for webarchive/test-xml-stylesheet.xml
+
+        Reviewed by Darin.
+
+        * WebKit.xcodeproj/project.pbxproj: Added WebHTMLRepresentationInternal.h.
+        Changed WebHTMLRepresentationInternal.h and WebHTMLRepresentationPrivate.h
+        to private so they're copied into PrivateHeaders.
+
 2008-07-11  Stephanie Lewis  <slewis@apple.com>
 
         Reviewed by Darin Adler.
index ffd032b..474e62b 100644 (file)
@@ -42,6 +42,7 @@
                226E9E6A09D0AA8200F3A2BC /* WebNetscapeDeprecatedFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = 226E9E6809D0AA8200F3A2BC /* WebNetscapeDeprecatedFunctions.h */; };
                226E9E6B09D0AA8200F3A2BC /* WebNetscapeDeprecatedFunctions.c in Sources */ = {isa = PBXBuildFile; fileRef = 226E9E6909D0AA8200F3A2BC /* WebNetscapeDeprecatedFunctions.c */; settings = {COMPILER_FLAGS = "-Wno-deprecated-declarations"; }; };
                22F219CC08D236730030E078 /* WebBackForwardListPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 22F219CB08D236730030E078 /* WebBackForwardListPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               441793A60E34EE150055E1AE /* WebHTMLRepresentationInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 441793A50E34EE150055E1AE /* WebHTMLRepresentationInternal.h */; settings = {ATTRIBUTES = (Private, ); }; };
                4BF99F900AE050BC00815C2B /* WebEditorClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF99F8E0AE050BC00815C2B /* WebEditorClient.h */; settings = {ATTRIBUTES = (); }; };
                4BF99F910AE050BC00815C2B /* WebEditorClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4BF99F8F0AE050BC00815C2B /* WebEditorClient.mm */; };
                51079D170CED11B00077247D /* WebSecurityOrigin.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51079D140CED11B00077247D /* WebSecurityOrigin.mm */; };
                939810530824BF01008DF038 /* WebFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 39446074020F50ED0ECA1767 /* WebFrame.h */; settings = {ATTRIBUTES = (Public, ); }; };
                939810540824BF01008DF038 /* WebFramePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 9CF0E249021361B00ECA16EA /* WebFramePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
                939810550824BF01008DF038 /* WebHTMLRepresentation.h in Headers */ = {isa = PBXBuildFile; fileRef = 35081D9202B6D4D80ACA2ACA /* WebHTMLRepresentation.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               939810560824BF01008DF038 /* WebHTMLRepresentationPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = F5A55DC702BAA2E8018635CC /* WebHTMLRepresentationPrivate.h */; };
+               939810560824BF01008DF038 /* WebHTMLRepresentationPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = F5A55DC702BAA2E8018635CC /* WebHTMLRepresentationPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
                939810570824BF01008DF038 /* WebHTMLView.h in Headers */ = {isa = PBXBuildFile; fileRef = 35081D9402B6D4D80ACA2ACA /* WebHTMLView.h */; settings = {ATTRIBUTES = (Private, ); }; };
                939810580824BF01008DF038 /* WebHTMLViewPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 35081D9602B6D4D80ACA2ACA /* WebHTMLViewPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
                9398105B0824BF01008DF038 /* WebFrameLoadDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 5152FAE5033FC52200CA2ACD /* WebFrameLoadDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
                3944607E020F50ED0ECA1767 /* WebBackForwardList.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebBackForwardList.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                3944607F020F50ED0ECA1767 /* WebHistoryItem.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebHistoryItem.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                39446080020F50ED0ECA1767 /* WebHistoryItem.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebHistoryItem.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+               441793A50E34EE150055E1AE /* WebHTMLRepresentationInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebHTMLRepresentationInternal.h; sourceTree = "<group>"; };
                4BF99F8E0AE050BC00815C2B /* WebEditorClient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebEditorClient.h; sourceTree = "<group>"; };
                4BF99F8F0AE050BC00815C2B /* WebEditorClient.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebEditorClient.mm; sourceTree = "<group>"; };
                51079D140CED11B00077247D /* WebSecurityOrigin.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebSecurityOrigin.mm; sourceTree = "<group>"; };
                        children = (
                                35081D9202B6D4D80ACA2ACA /* WebHTMLRepresentation.h */,
                                35081D9302B6D4D80ACA2ACA /* WebHTMLRepresentation.mm */,
+                               441793A50E34EE150055E1AE /* WebHTMLRepresentationInternal.h */,
                                F5A55DC702BAA2E8018635CC /* WebHTMLRepresentationPrivate.h */,
                                35081D9402B6D4D80ACA2ACA /* WebHTMLView.h */,
                                35081D9502B6D4D80ACA2ACA /* WebHTMLView.mm */,
                                939810AF0824BF01008DF038 /* WebFrameViewPrivate.h in Headers */,
                                1CA57D620AED6A470009BDD0 /* WebGraphicsExtras.h in Headers */,
                                939810550824BF01008DF038 /* WebHTMLRepresentation.h in Headers */,
+                               441793A60E34EE150055E1AE /* WebHTMLRepresentationInternal.h in Headers */,
                                939810560824BF01008DF038 /* WebHTMLRepresentationPrivate.h in Headers */,
                                939810570824BF01008DF038 /* WebHTMLView.h in Headers */,
                                939810A10824BF01008DF038 /* WebHTMLViewInternal.h in Headers */,
index f9dfe64..2d47d9b 100644 (file)
@@ -1,3 +1,14 @@
+2008-07-31  David D. Kilzer  <ddkilzer@webkit.org>
+
+        Fix layout test results for webarchive/test-xml-stylesheet.xml
+
+        Reviewed by Darin.
+
+        Needed to expose -[WebHTMLRepresentation supportedNonImageMIMETypes]
+        for DumpRenderTree.
+
+        * WebView/WebHTMLRepresentationInternal.h: Added.
+
 2008-07-31  Alexey Proskuryakov  <ap@webkit.org>
 
         Release build fix.
diff --git a/WebKit/mac/WebView/WebHTMLRepresentationInternal.h b/WebKit/mac/WebView/WebHTMLRepresentationInternal.h
new file mode 100644 (file)
index 0000000..d42b400
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2008 Apple Computer, Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer. 
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution. 
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission. 
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <WebKit/WebHTMLRepresentationPrivate.h>
+
+@interface WebHTMLRepresentation (WebInternal)
++ (NSArray *)supportedNonImageMIMETypes;
+@end
index a8a7c33..c8efcf3 100644 (file)
@@ -1,3 +1,19 @@
+2008-07-31  David Kilzer  <ddkilzer@apple.com>
+
+        Fix layout test results for webarchive/test-xml-stylesheet.xml
+
+        Reviewed by Darin.
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (convertMIMEType): Work around the "text/xml" local file type
+        regression in Leopard using the BUILDING_ON_LEOPARD macro.  Also
+        stop mangling "application/x-javascript" into "text/javascript".
+        (convertWebResourceDataToString): When checking whether to dump a
+        resource as text, also check to see if the MIME type is in the
+        -[WebHTMLRepresentation supportedNonImageMIMETypes] array.
+        * DumpRenderTree/mac/DumpRenderTreeMac.h: Added BUILDING_ON_LEOPARD
+        macro.
+
 2008-07-31  chris fleizach  <cfleizach@apple.com>
 
         Reviewed by Alice Liu
index ec72a2e..2f4a311 100644 (file)
@@ -59,6 +59,7 @@
 #import <WebKit/WebDocumentPrivate.h>
 #import <WebKit/WebEditingDelegate.h>
 #import <WebKit/WebFrameView.h>
+#import <WebKit/WebHTMLRepresentationInternal.h>
 #import <WebKit/WebHistory.h>
 #import <WebKit/WebHistoryItemPrivate.h>
 #import <WebKit/WebPluginDatabase.h>
@@ -643,8 +644,11 @@ static NSData *dumpFrameAsPDF(WebFrame *frame)
 
 static void convertMIMEType(NSMutableString *mimeType)
 {
-    if ([mimeType isEqualToString:@"application/x-javascript"])
-        [mimeType setString:@"text/javascript"];
+#ifdef BUILDING_ON_LEOPARD
+    // Workaround for <rdar://problem/5539824> on Leopard
+    if ([mimeType isEqualToString:@"text/xml"])
+        [mimeType setString:@"application/xml"];
+#endif
 }
 
 static void convertWebResourceDataToString(NSMutableDictionary *resource)
@@ -652,7 +656,7 @@ static void convertWebResourceDataToString(NSMutableDictionary *resource)
     NSMutableString *mimeType = [resource objectForKey:@"WebResourceMIMEType"];
     convertMIMEType(mimeType);
     
-    if ([mimeType hasPrefix:@"text/"]) {
+    if ([mimeType hasPrefix:@"text/"] || [[WebHTMLRepresentation supportedNonImageMIMETypes] containsObject:mimeType]) {
         NSData *data = [resource objectForKey:@"WebResourceData"];
         NSString *dataAsString = [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease];
         [resource setObject:dataAsString forKey:@"WebResourceData"];
index 3532058..2b64369 100644 (file)
@@ -34,6 +34,8 @@
 
 #if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4
 #define BUILDING_ON_TIGER 1
+#elif MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5
+#define BUILDING_ON_LEOPARD 1
 #endif
 
 @class DumpRenderTreeDraggingInfo;