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

cblu cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:35:00 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit fa43c5f44d8aaf03bb4bac878a15e445c004f149
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Apr 19 16:55:00 2004 +0000

    	Added support for pasting frames via WebArchives.
    
            Reviewed by kocienda.
    
            * WebView.subproj/WebDataSource.m:
            (-[WebDataSource _addSubframeArchives:]): renamed, now allows subframe archives to be added at anytime
            (-[WebDataSource _popSubframeArchiveWithName:]): renamed, now deletes the returned subframe to consume less memory
            (-[WebDataSource _replaceSelectionWithWebArchive:]): added support for subframes
            * WebView.subproj/WebDataSourcePrivate.h:
            * WebView.subproj/WebFrame.m:
            (-[WebFrame _loadRequest:subresources:subframeArchives:]): call renamed methods
            (-[WebFrame _loadURL:intoChild:]): ditto
            * WebView.subproj/WebHTMLRepresentation.m:
            (-[WebHTMLRepresentation loadArchive]): ditto
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6424 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 2896039..7b05940 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,20 @@
+2004-04-19  Chris Blumenberg  <cblu at apple.com>
+
+	Added support for pasting frames via WebArchives.
+
+        Reviewed by kocienda.
+
+        * WebView.subproj/WebDataSource.m:
+        (-[WebDataSource _addSubframeArchives:]): renamed, now allows subframe archives to be added at anytime
+        (-[WebDataSource _popSubframeArchiveWithName:]): renamed, now deletes the returned subframe to consume less memory
+        (-[WebDataSource _replaceSelectionWithWebArchive:]): added support for subframes
+        * WebView.subproj/WebDataSourcePrivate.h:
+        * WebView.subproj/WebFrame.m:
+        (-[WebFrame _loadRequest:subresources:subframeArchives:]): call renamed methods
+        (-[WebFrame _loadURL:intoChild:]): ditto
+        * WebView.subproj/WebHTMLRepresentation.m:
+        (-[WebHTMLRepresentation loadArchive]): ditto
+
 === Safari-137 ===
 
 2004-04-16  Richard Williamson   <rjw at apple.com>
diff --git a/WebKit/WebView.subproj/WebDataSource.m b/WebKit/WebView.subproj/WebDataSource.m
index 470c54a..33754f8 100644
--- a/WebKit/WebView.subproj/WebDataSource.m
+++ b/WebKit/WebView.subproj/WebDataSource.m
@@ -182,15 +182,12 @@
     }
 }
 
-- (void)_setPendingSubframeArchives:(NSArray *)subframeArchives
+- (void)_addSubframeArchives:(NSArray *)subframeArchives
 {
-    ASSERT(_private->pendingSubframeArchives == nil);
-
-    if (subframeArchives == nil) {
-        return;
+    if (_private->pendingSubframeArchives == nil) {
+        _private->pendingSubframeArchives = [[NSMutableDictionary alloc] init];
     }
     
-    _private->pendingSubframeArchives = [[NSMutableDictionary alloc] init];
     NSEnumerator *enumerator = [subframeArchives objectEnumerator];
     WebArchive *archive;
     while ((archive = [enumerator nextObject]) != nil) {
@@ -201,9 +198,15 @@
     }
 }
 
-- (WebArchive *)_archiveForFrameName:(NSString *)frameName
+- (WebArchive *)_popSubframeArchiveWithName:(NSString *)frameName
 {
-    return [_private->pendingSubframeArchives objectForKey:frameName];
+    ASSERT(frameName != nil);
+    
+    WebArchive *archive = [[[_private->pendingSubframeArchives objectForKey:frameName] retain] autorelease];
+    if (archive != nil) {
+        [_private->pendingSubframeArchives removeObjectForKey:frameName];
+    }
+    return archive;
 }
 
 - (void)_replaceSelectionWithMarkupString:(NSString *)markupString baseURL:(NSURL *)baseURL
@@ -229,6 +232,7 @@
         if ([WebView canShowMIMETypeAsHTML:MIMEType]) {
             NSString *markupString = [[NSString alloc] initWithData:[mainResource data] encoding:NSUTF8StringEncoding];
             [self addSubresources:[archive subresources]];
+            [self _addSubframeArchives:[archive subframeArchives]];
             [self _replaceSelectionWithMarkupString:markupString baseURL:[mainResource URL]];
             [markupString release];
             return YES;
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.h b/WebKit/WebView.subproj/WebDataSourcePrivate.h
index 265e4a8..674060f 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.h
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.h
@@ -128,8 +128,8 @@
 
 - (WebArchive *)_archive;
 - (WebArchive *)_archiveWithMarkupString:(NSString *)markupString nodes:(NSArray *)nodes;
-- (void)_setPendingSubframeArchives:(NSArray *)subframeArchives;
-- (WebArchive *)_archiveForFrameName:(NSString *)frameName;
+- (void)_addSubframeArchives:(NSArray *)subframeArchives;
+- (WebArchive *)_popSubframeArchiveWithName:(NSString *)frameName;
 
 - (void)_replaceSelectionWithMarkupString:(NSString *)markupString baseURL:(NSURL *)baseURL;
 - (BOOL)_replaceSelectionWithWebArchive:(WebArchive *)archive;
diff --git a/WebKit/WebView.subproj/WebFrame.m b/WebKit/WebView.subproj/WebFrame.m
index 62e5149..97dd32d 100644
--- a/WebKit/WebView.subproj/WebFrame.m
+++ b/WebKit/WebView.subproj/WebFrame.m
@@ -318,7 +318,7 @@ NSString *WebPageCacheDocumentViewKey = @"WebPageCacheDocumentViewKey";
     
     [newDataSource _setOverrideEncoding:[[self dataSource] _overrideEncoding]];
     [newDataSource addSubresources:subresources];
-    [newDataSource _setPendingSubframeArchives:subframeArchives];
+    [newDataSource _addSubframeArchives:subframeArchives];
     
     // When we loading alternate content for an unreachable URL that we're
     // visiting in the b/f list, we treat it as a reload so the b/f list 
@@ -1936,7 +1936,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
         }
     }
 
-    WebArchive *archive = [[self dataSource] _archiveForFrameName:[childFrame name]];
+    WebArchive *archive = [[self dataSource] _popSubframeArchiveWithName:[childFrame name]];
     if (archive) {
         [childFrame loadArchive:archive];
     } else {
diff --git a/WebKit/WebView.subproj/WebHTMLRepresentation.m b/WebKit/WebView.subproj/WebHTMLRepresentation.m
index 84d9ec5..e4ddbdf 100644
--- a/WebKit/WebView.subproj/WebHTMLRepresentation.m
+++ b/WebKit/WebView.subproj/WebHTMLRepresentation.m
@@ -23,7 +23,7 @@
 @public
     WebDataSource *dataSource;
     WebBridge *bridge;
-    NSData *parsedWebArchiveData;
+    NSData *parsedArchiveData;
 }
 @end
 
@@ -31,7 +31,7 @@
 
 - (void)dealloc
 {
-    [parsedWebArchiveData release];
+    [parsedArchiveData release];
     [super dealloc];
 }
 
@@ -86,7 +86,7 @@
 {
 }
 
-- (void)loadWebArchive
+- (void)loadArchive
 {
     WebArchive *archive = [[WebArchive alloc] initWithData:[_private->dataSource data]];
     WebResource *mainResource = [archive mainResource];
@@ -99,11 +99,11 @@
     
     NSData *data = [mainResource data];
     [data retain];
-    [_private->parsedWebArchiveData release];
-    _private->parsedWebArchiveData = data;
+    [_private->parsedArchiveData release];
+    _private->parsedArchiveData = data;
     
     [_private->dataSource addSubresources:subresources];
-    [_private->dataSource _setPendingSubframeArchives:subframeArchives];
+    [_private->dataSource _addSubframeArchives:subframeArchives];
     [_private->bridge closeURL];
     [_private->bridge openURL:[mainResource URL]
                        reload:NO 
@@ -118,7 +118,7 @@
 {
     if ([dataSource webFrame]) {
         if ([self _isDisplayingWebArchive]) {
-            [self loadWebArchive];
+            [self loadArchive];
         }
         // Telling the bridge we received some data and passing nil as the data is our
         // way to get work done that is normally done when the first bit of data is
@@ -135,7 +135,7 @@
 - (NSString *)documentSource
 {
     if ([self _isDisplayingWebArchive]) {
-        return [[[NSString alloc] initWithData:_private->parsedWebArchiveData encoding:NSUTF8StringEncoding] autorelease];
+        return [[[NSString alloc] initWithData:_private->parsedArchiveData encoding:NSUTF8StringEncoding] autorelease];
     } else {
         return [WebBridge stringWithData:[_private->dataSource data] textEncoding:[_private->bridge textEncoding]];
     }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list