2007-03-13 Oliver Hunt <oliver@apple.com>
authoroliver <oliver@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Mar 2007 05:00:07 +0000 (05:00 +0000)
committeroliver <oliver@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Mar 2007 05:00:07 +0000 (05:00 +0000)
        Reviewed by Brady.
WebCore:
        To fix <rdar://problem/5044366> we now pass a NSString
        representation of the URL extracted with _web_originalDataAsString
        instead of relying on [NSURL absoluteString] in the bridge

        * page/mac/WebCoreFrameBridge.h:
        * page/mac/WebCoreFrameBridge.mm:
        (-[WebCoreFrameBridge getData:andResponse:forURL:]):
WebKit:
        Modify subresourceForURL to take NSString argument
        so we can avoid [NSURL absoluteString]

        * WebView/WebDataSource.mm:
        (-[WebDataSource subresourceForURL:]):
LayoutTests:
        Test for <rdar://problem/5044366> make sure we can create
        a WebArchive from a page with a partially decoded url.

        * webarchive/archive-with-unencoded-url-expected.txt: Added.
        * webarchive/archive-with-unencoded-url.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/webarchive/archive-with-unencoded-url-expected.txt [new file with mode: 0644]
LayoutTests/webarchive/archive-with-unencoded-url.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/page/mac/WebCoreFrameBridge.h
WebCore/page/mac/WebCoreFrameBridge.mm
WebKit/ChangeLog
WebKit/WebView/WebDataSource.mm

index d4ca6a5aabfb69d5821d454a34da893dd4ed32fe..f58befc08c550e6cd12a0464f2d515eca7f43142 100644 (file)
@@ -1,3 +1,13 @@
+2007-03-13  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Brady.
+
+        Test for <rdar://problem/5044366> make sure we can create
+        a WebArchive from a page with a partially decoded url.
+
+        * webarchive/archive-with-unencoded-url-expected.txt: Added.
+        * webarchive/archive-with-unencoded-url.html: Added.
+
 2007-03-13  Beth Dakin  <bdakin@apple.com>
 
         Reviewed by Hyatt.
diff --git a/LayoutTests/webarchive/archive-with-unencoded-url-expected.txt b/LayoutTests/webarchive/archive-with-unencoded-url-expected.txt
new file mode 100644 (file)
index 0000000..3439613
--- /dev/null
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//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;html&gt;&lt;head&gt;
+&lt;script&gt;
+    if (window.layoutTestController)
+        layoutTestController.dumpDOMAsWebArchive();
+&lt;/script&gt;
+&lt;/head&gt;&lt;body&gt;
+&lt;form&gt;
+    &lt;input type="image" src="resources/apple.gif?foo|bar"&gt;
+&lt;/form&gt;
+
+&lt;/body&gt;&lt;/html&gt;</string>
+               <key>WebResourceFrameName</key>
+               <string></string>
+               <key>WebResourceMIMEType</key>
+               <string>text/html</string>
+               <key>WebResourceTextEncodingName</key>
+               <string>UTF-8</string>
+               <key>WebResourceURL</key>
+               <string>file:///LayoutTests/webarchive/archive-with-unencoded-url.html</string>
+       </dict>
+       <key>WebSubresources</key>
+       <array>
+               <dict>
+                       <key>WebResourceData</key>
+                       <data>
+                       R0lGODlhNABAAMQfAGJiYvLz9ImKitvb2/39/cnJyaSkpOPj49TU
+                       1MHBwbW1terq7Lu7u/X19uXm5+3u7+fo6eDg4e/w8t7e3/n5+RcX
+                       F87Oz/f398fHx9fX16+vr9HR0fDw8Pj4+MzMzAAAACH5BAEAAB8A
+                       LAAAAAA0AEAAQAX/4CeOZGme5iFUlYC+cCwKD7FAxxElAiTDnATA
+                       cCEYj8aABiBIDCIbjQCgqBEojUCjQSEEpoXTAUCQLB4PiZoTaG/f
+                       jcuFgj1kBrnIZDLoDzIIgRsTAgYmBk8TEQ4OEGdpbBQLDAUQEA55
+                       e32AGxsWHh4FBRgJCQgFAhQoCwIDlgsSFxyFOnt8foAInp+jpQkM
+                       wArCGsQaCg0KBgEoDwAAHoHRgroW1aEYpL7A28LDxcUGGgalhi8I
+                       AAgYoOvrn5/soL2lwcThEBQAAz/7JxYAXVcCPNjggp/BEwIYOHNm
+                       wMHBErMSEMgCR47FC3EwwnlzocOFBxMy3NHkp88EBwU///gjcKCR
+                       o0cPOEhwM6fDgUGWMuHKtQvUBgBhThhQ4CBCSwhoJDToQKxljlq4
+                       BPHCNo+bggXEXnwZMNMAupJ/ckm9RvUXg27dvqllkEFADxMQAKir
+                       Zs3Du1CiRpX1ZfasN3EGAlsYIIADv3MCDnBowKEAQwSGSRzAMEVA
+                       BIwTmCB4yHkEQQMACQDY0LmzgAlXZF0ac6D0QwUJOAxAkMArgAyu
+                       T3gQ5zYwBh8jBmhgoG9EBgYG3BbSQHpfBAEKjHSYTt3jxQ4BH3DB
+                       2EaLnAYLIgC6EyGuBhMDyDSI2X3jlu8Vay7480TPrU250p8n0SrA
+                       SzQxsTGTFu9hF4B45WESgf8e+EWzy0/NlTBOeDk0AtNMcVAQQCcH
+                       5LTgLSJJ9c4ooQiwjFAI7GGUhWkE0AFWv+GQB4N/6OJJPNnMY0EA
+                       ACyAgmMSLIKUBBxQgEoGRX0IIk8j5hiMNwxQkBAKDAhgxgMdeCBX
+                       BGCJFGInvMhj1V/fJMCjmSVEAEBcAFiQS4jS9HSNNk+mpZZaBmAw
+                       WgmZUeNJJ4DWJUqOdI6JZ2DjEHKiCRwEBg88BbCTl15O+lUPoo3u
+                       94MCAERAijrx+NQHBuIo4EGNgBRQigcRdAFAArl9EAAbBnWgRayl
+                       ObCEiQQIECGu+2i5gBEaxgUcsDJk1sAVtp4xJbIy6JkdJhBAB63/
+                       DCstoOAGXhV3LQxeubWQZd/+kBBDuF17AKcAaDDAAuEp1G4GDZiA
+                       gBRMYODAAgdYYBsD+zjgFUAUVGedERf8NO49AQ2YkX85ZNDuCyoU
+                       cEVGBlunEUVbuBHHdBwcMNtIfkwQFwYlUMDDRA5v9B18FRUMHn22
+                       gBUWIZp+QEGeBKShRnceu5cRHbLdodNO0aSngAlV2vCIBD4PSOB7
+                       c0hidCb31TgNDyfEdcElLz3Cwdgt07HAHY0crbWN7iiQUgluN7Di
+                       K2eQ3cYcFwywQYcy0ggnmLx48FNrQllQ1FGvxIQhBQ+o0wgmUIU1
+                       Fl7YbEBZByggskeFjiQVAAUQKFDJ/2p5REUNjlSx1dYFmWOgh5Bi
+                       azhcTlhvMpZedMIm2q8kuE1h5zNRkMxJM97HJI65D7NBBz2ekNkD
+                       LZ0hQQeEJZAkjbafPmdVdhKDQAMAEC5hAg8g9XlyeNRs+o1kVeWX
+                       AncywDwD9ZKQmSMBLDAEl13ydCPu3CPTnRKgPwP4aARVuoBjEBGW
+                       8fivSdkYE/zudCcPCMADvUOXNOIEJtQVCi0CxFN6HlCCKgFqA4II
+                       1F0A6L46kQlRgRkDBk0ghV3Q5YYQxAahtvGkb8DQgM94gWPuAoq6
+                       xCMvGKDUDl8YmOigIwYyjNSjpriOQUXQUpfilwAc8gMhZCABc8Hh
+                       NSJlgTkOgoIUZykG+UQTFIMohBEIKGN9BmCbQgRmCq+awAIwgh0b
+                       vMo1C6hNZfJ0wBdMwG29KQAJy/WtEAAAO1BvbG9udXMK
+                       </data>
+                       <key>WebResourceMIMEType</key>
+                       <string>image/gif</string>
+                       <key>WebResourceResponse</key>
+                       <data>
+                       YnBsaXN0MDDUAQIDBAUGBwpZJGFyY2hpdmVyWCR2ZXJzaW9uVCR0
+                       b3BYJG9iamVjdHNfEA9OU0tleWVkQXJjaGl2ZXISAAGGoNEICV8Q
+                       E1dlYlJlc291cmNlUmVzcG9uc2WAAaQLDBscVSRudWxs1w0ODxAR
+                       EhMUFRYXGBkVUiQyUiQzUiQ0UiQwViRjbGFzc1IkNVIkMYACgAAR
+                       BcQQB4ADI3/v////////gABZaW1hZ2UvZ2lm0h0eHyBYJGNsYXNz
+                       ZXNaJGNsYXNzbmFtZaIgIV1OU1VSTFJlc3BvbnNlWE5TT2JqZWN0
+                       CBEbJCkyRElMYmRpb36BhIeKkZSXmZueoKKrrbe8xdDT4QAAAAAA
+                       AAEBAAAAAAAAACIAAAAAAAAAAAAAAAAAAADq
+                       </data>
+                       <key>WebResourceURL</key>
+                       <string>file:///LayoutTests/webarchive/resources/apple.gif?foo|bar</string>
+               </dict>
+       </array>
+</dict>
+</plist>
diff --git a/LayoutTests/webarchive/archive-with-unencoded-url.html b/LayoutTests/webarchive/archive-with-unencoded-url.html
new file mode 100644 (file)
index 0000000..1350083
--- /dev/null
@@ -0,0 +1,13 @@
+<html>
+<head>
+<script>
+    if (window.layoutTestController)
+        layoutTestController.dumpDOMAsWebArchive();
+</script>
+</head>
+<body>
+<form>
+    <input type="image" src="resources/apple.gif?foo|bar">
+</form>
+</body>
+</html>
\ No newline at end of file
index bd8e9bcb679a850e3c82b79442043915c91c2a5e..df93b1b7b7cb6351fee5d91020bb4d707fb58195 100644 (file)
@@ -1,3 +1,15 @@
+2007-03-13  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Brady.
+
+        To fix <rdar://problem/5044366> we now pass a NSString
+        representation of the URL extracted with _web_originalDataAsString
+        instead of relying on [NSURL absoluteString] in the bridge
+
+        * page/mac/WebCoreFrameBridge.h:
+        * page/mac/WebCoreFrameBridge.mm:
+        (-[WebCoreFrameBridge getData:andResponse:forURL:]):
+
 2007-03-13  Brady Eidson  <beidson@apple.com>
 
         Reviewed by Anders
index 8920091fc621cd71f2a26b3164b484a0c09d7f1b..ae6fcad52825be027505dc1f7d397ea198330a47 100644 (file)
@@ -244,7 +244,7 @@ typedef enum ObjectElementType {
 
 - (BOOL)isCharacterSmartReplaceExempt:(unichar)c isPreviousCharacter:(BOOL)isPreviousCharacter;
 
-- (BOOL)getData:(NSData **)data andResponse:(NSURLResponse **)response forURL:(NSURL *)URL;
+- (BOOL)getData:(NSData **)data andResponse:(NSURLResponse **)response forURL:(NSString *)URL;
 - (void)getAllResourceDatas:(NSArray **)datas andResponses:(NSArray **)responses;
 
 - (BOOL)canProvideDocumentSource;
index 7042bc84afb84cb02c59e77f63587f6054bea95a..05cdaee38fd28979997e1bdf453e3f803a762eb3 100644 (file)
@@ -1398,13 +1398,13 @@ static NSCharacterSet *_getPostSmartSet(void)
     return [isPreviousCharacter ? _getPreSmartSet() : _getPostSmartSet() characterIsMember:c];
 }
 
-- (BOOL)getData:(NSData **)data andResponse:(NSURLResponse **)response forURL:(NSURL *)URL
+- (BOOL)getData:(NSData **)data andResponse:(NSURLResponse **)response forURL:(NSString *)URL
 {
     Document* doc = m_frame->document();
     if (!doc)
         return NO;
 
-    CachedResource* resource = doc->docLoader()->cachedResource([URL absoluteString]);
+    CachedResource* resource = doc->docLoader()->cachedResource(URL);
     if (!resource)
         return NO;
 
index da53aa0d22b0233690ee97c4280d89a6298d4d64..ec76a0f33ffb3e5046c60eb8f49130008a0ff9b2 100644 (file)
@@ -1,3 +1,13 @@
+2007-03-13  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Brady.
+
+        Modify subresourceForURL to take NSString argument 
+        so we can avoid [NSURL absoluteString]
+
+        * WebView/WebDataSource.mm:
+        (-[WebDataSource subresourceForURL:]):
+
 2007-03-13  Brady Eidson  <beidson@apple.com>
 
         Rubberstamped by Alice
index a632bc090db023e68af7cdf395d74ec521f8c789..582e68bfbcf8901ca80bb5530aefe922331e8f9f 100644 (file)
@@ -483,7 +483,7 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
 
     NSData *data;
     NSURLResponse *response;
-    if (![[self _bridge] getData:&data andResponse:&response forURL:URL])
+    if (![[self _bridge] getData:&data andResponse:&response forURL:[URL _web_originalDataAsString]])
         return [self _archivedSubresourceForURL:URL];
 
     return [[[WebResource alloc] _initWithData:data URL:URL response:response] autorelease];