Reviewed by Darin.
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Apr 2006 23:50:17 +0000 (23:50 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Apr 2006 23:50:17 +0000 (23:50 +0000)
        - simplify archive loading

        * WebView/WebDataSource.m:
        (-[WebDataSource representation]): fix whitespace
        * WebView/WebHTMLRepresentation.m:
        (-[WebHTMLRepresentation loadArchive]): Use WebFrame's loadArchive: instead
        of trying to do a manual load here.
        (-[WebHTMLRepresentation documentSource]): No more special case for WebArchive.

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

WebKit/ChangeLog
WebKit/WebView/WebDataSource.m
WebKit/WebView/WebHTMLRepresentation.m

index 79e03a964a13c78b2a0b49efbf09dc05646abc89..be595bb4db81a90b143d434716e8c07d3a88dfe4 100644 (file)
@@ -1,3 +1,16 @@
+2006-04-07  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Darin.
+        
+        - simplify archive loading
+
+        * WebView/WebDataSource.m:
+        (-[WebDataSource representation]): fix whitespace
+        * WebView/WebHTMLRepresentation.m:
+        (-[WebHTMLRepresentation loadArchive]): Use WebFrame's loadArchive: instead
+        of trying to do a manual load here.
+        (-[WebHTMLRepresentation documentSource]): No more special case for WebArchive.
+
 2006-04-07  John Sullivan  <sullivan@apple.com>
 
         Reviewed by Tim Omernick.
index c6a2d2732722f0cd7c99ce92a3141786b1e835ad..bd7066e52de9dd255c6a2aea12336e73d590712c 100644 (file)
@@ -969,7 +969,7 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class class,
     return _private->resourceData != nil ? _private->resourceData : [_private->mainResourceLoader resourceData];
 }
 
-- (id <WebDocumentRepresentation>) representation
+- (id <WebDocumentRepresentation>)representation
 {
     return _private->representation;
 }
index dbc8dbb5641459ba5eb8bb972be55940e98b15f9..3784b90b01f20cb6b546aeb38fdffa5932dbadca 100644 (file)
 - (void)loadArchive
 {
     WebArchive *archive = [[WebArchive alloc] initWithData:[_private->dataSource data]];
-    WebResource *mainResource = [archive mainResource];
-    if (!mainResource) {
-        [archive release];
-        return;
-    }
-    
-    NSData *data = [mainResource data];
-    [data retain];
-    [_private->parsedArchiveData release];
-    _private->parsedArchiveData = data;
-    
-    [_private->dataSource _addToUnarchiveState:archive];
-    [archive release];
-
-    [_private->bridge closeURL];
-    [_private->bridge openURL:[mainResource URL]
-                       reload:NO 
-                  contentType:[mainResource MIMEType]
-                      refresh:NO
-                 lastModified:nil
-                    pageCache:nil];
-    [_private->bridge receivedData:data textEncodingName:[mainResource textEncodingName]];
+    [[_private->dataSource webFrame] loadArchive:archive];
 }
 
 - (void)finishedLoadingWithDataSource:(WebDataSource *)dataSource
 
 - (NSString *)documentSource
 {
-    if ([self _isDisplayingWebArchive]) {
-        return [[[NSString alloc] initWithData:_private->parsedArchiveData encoding:NSUTF8StringEncoding] autorelease];
-    } else {
-        return [WebFrameBridge stringWithData:[_private->dataSource data] textEncoding:[_private->bridge textEncoding]];
-    }
+    NSData *data = [_private->dataSource data];
+    CFStringEncoding encoding = [_private->bridge textEncoding];
+    return [WebFrameBridge stringWithData:data textEncoding:encoding];
 }
 
 - (NSString *)title