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

rjw rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:08:12 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit e3ec257b4b1f60d48c12a478e1f0f7693f5dc944
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Nov 25 21:54:43 2002 +0000

            Fixed exception thrown often when creating mouseover status text (3110186).
    
            * WebView.subproj/WebHTMLViewPrivate.m:
            (-[WebHTMLView _elementAtPoint:]):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2862 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 4bef566..5eb423f 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,10 @@
+2002-11-25  Richard Williamson   <rjw at apple.com>
+
+        Fixed exception thrown often when creating mouseover status text (3110186).
+        
+        * WebView.subproj/WebHTMLViewPrivate.m:
+        (-[WebHTMLView _elementAtPoint:]):
+
 2002-11-25  Darin Adler  <darin at apple.com>
 
 	- fixed a problem I discovered in testing where multiple identical bookmarks confuse us
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 4bef566..5eb423f 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,10 @@
+2002-11-25  Richard Williamson   <rjw at apple.com>
+
+        Fixed exception thrown often when creating mouseover status text (3110186).
+        
+        * WebView.subproj/WebHTMLViewPrivate.m:
+        (-[WebHTMLView _elementAtPoint:]):
+
 2002-11-25  Darin Adler  <darin at apple.com>
 
 	- fixed a problem I discovered in testing where multiple identical bookmarks confuse us
diff --git a/WebKit/History.subproj/WebHistoryItem.h b/WebKit/History.subproj/WebHistoryItem.h
index 03ebe38..38c1add 100644
--- a/WebKit/History.subproj/WebHistoryItem.h
+++ b/WebKit/History.subproj/WebHistoryItem.h
@@ -21,6 +21,7 @@
     NSString *anchor;
     NSArray *_documentState;
     NSMutableArray *_subItems;
+    NSMutableDictionary *pageCache;
     BOOL _loadedIcon;
     BOOL _isTargetItem;
 }
@@ -63,3 +64,9 @@
 - (WebHistoryItem *)targetItem;
 
 @end
+
+ at interface WebHistoryItem (WebPrivate)
+- (BOOL)pageCacheEnabled;
+- (void)setPageCacheEnabled: (BOOL)f;
+- (NSMutableDictionary *)pageCache;
+ at end
diff --git a/WebKit/History.subproj/WebHistoryItem.m b/WebKit/History.subproj/WebHistoryItem.m
index cff82d3..95dec43 100644
--- a/WebKit/History.subproj/WebHistoryItem.m
+++ b/WebKit/History.subproj/WebHistoryItem.m
@@ -74,6 +74,7 @@
     [anchor release];
     [_documentState release];
     [_subItems release];
+    [pageCache release];
     
     [super dealloc];
 }
@@ -388,5 +389,28 @@
 
     return self;
 }
-    
+
+ at end
+
+ at implementation WebHistoryItem (WebPrivate)
+
+- (BOOL)pageCacheEnabled;
+{
+    return pageCache != nil;
+}
+
+- (void)setPageCacheEnabled: (BOOL)f
+{
+    if (f && !pageCache)
+        pageCache = [[NSMutableDictionary alloc] init];
+    if (!f && pageCache){
+        [pageCache release];
+        pageCache = 0;
+    }
+}
+
+- pageCache
+{
+    return pageCache;
+}
 @end
diff --git a/WebKit/Misc.subproj/WebKitLogging.h b/WebKit/Misc.subproj/WebKitLogging.h
index dc1800f..7091dc4 100644
--- a/WebKit/Misc.subproj/WebKitLogging.h
+++ b/WebKit/Misc.subproj/WebKitLogging.h
@@ -24,3 +24,5 @@ extern WebLogChannel WebKitLogPlugins;
 extern WebLogChannel WebKitLogEvents;
 extern WebLogChannel WebKitLogView;
 extern WebLogChannel WebKitLogRedirect;
+
+extern WebLogChannel WebKitLogPageCache;
\ No newline at end of file
diff --git a/WebKit/Misc.subproj/WebKitLogging.m b/WebKit/Misc.subproj/WebKitLogging.m
index 14c48e8..18e61f5 100644
--- a/WebKit/Misc.subproj/WebKitLogging.m
+++ b/WebKit/Misc.subproj/WebKitLogging.m
@@ -20,3 +20,5 @@ WebLogChannel WebKitLogPlugins =		{ 0x00002000, "WebKitLogLevel", WebLogChannelU
 WebLogChannel WebKitLogEvents =       		{ 0x00010000, "WebKitLogLevel", WebLogChannelUninitialized };
 WebLogChannel WebKitLogView =         		{ 0x00020000, "WebKitLogLevel", WebLogChannelUninitialized };
 WebLogChannel WebKitLogRedirect =     		{ 0x00040000, "WebKitLogLevel", WebLogChannelUninitialized };
+
+WebLogChannel WebKitLogPageCache =              { 0x00080000, "WebKitLogLevel", WebLogChannelUninitialized };
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.m b/WebKit/WebCoreSupport.subproj/WebBridge.m
index a17f856..340e696 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.m
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.m
@@ -322,6 +322,18 @@
     return [[frame _itemForRestoringDocState] documentState];
 }
 
+- (BOOL)saveDocumentToPageCache: documentInfo
+{
+    WebHistoryItem *item = [frame _itemForSavingDocState];
+    if (![item pageCacheEnabled]){
+        printf ("WebBridge saveDocumentToPageCache:  not saving\n");
+        return false;
+    }
+    [[item pageCache] setObject: documentInfo forKey: @"WebCorePageState"];
+    printf ("WebBridge saveDocumentToPageCache:  saving\n");
+    return true;
+}
+
 - (NSString *)userAgentForURL:(NSString *)URL
 {
     return [[frame controller] userAgentForURL:[NSURL _web_URLWithString:URL]];
diff --git a/WebKit/WebView.subproj/WebDataSource.m b/WebKit/WebView.subproj/WebDataSource.m
index deb9c64..ecc8091 100644
--- a/WebKit/WebView.subproj/WebDataSource.m
+++ b/WebKit/WebView.subproj/WebDataSource.m
@@ -118,7 +118,7 @@
 
 - (void)startLoading
 {
-    [self _startLoading];
+    [self _startLoading: nil];
 }
 
 
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.h b/WebKit/WebView.subproj/WebDataSourcePrivate.h
index 38d1527..63f1323 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.h
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.h
@@ -85,6 +85,9 @@
     NSString *downloadPath;
 
     BOOL justOpenedForTargetedLink;
+
+    BOOL storedInPageCache;
+    BOOL loadingFromPageCache;
 }
 
 @end
@@ -95,7 +98,7 @@
 - (Class)_representationClass;
 - (void)_setRepresentation:(id<WebDocumentRepresentation>)representation;
 - (void)_setController:(WebController *)controller;
-- (void)_startLoading;
+- (void)_startLoading: (NSDictionary *)pageCache;
 - (void)_stopLoading;
 - (BOOL)_isStopping;
 - (void)_recursiveStopLoading;
@@ -128,7 +131,7 @@
 - (WebBridge *)_bridge;
 
 - (BOOL)_isCommitted;
-- (void)_commitIfReady;
+- (void)_commitIfReady: (NSDictionary *)pageCache;
 - (void)_makeRepresentation;
 - (void)_receivedData:(NSData *)data;
 - (void)_finishedLoading;
@@ -142,5 +145,7 @@
 - (void)_setDownloadPath:(NSString *)downloadPath;
 - (void)_setJustOpenedForTargetedLink:(BOOL)justOpened;
 - (BOOL)_justOpenedForTargetedLink;
+- (void)_setStoredInPageCache:(BOOL)f;
+- (BOOL)_storedInPageCache;
 
 @end
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.m b/WebKit/WebView.subproj/WebDataSourcePrivate.m
index 78252d7..f862a6f 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.m
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.m
@@ -137,7 +137,7 @@
 }
 
 
-- (void)_startLoading
+- (void)_startLoading: (NSDictionary *)pageCache
 {
     ASSERT([self _isStopping] == NO);
 
@@ -154,7 +154,11 @@
     
     [[_private->controller locationChangeDelegate] locationChangeStartedForDataSource:self];
 
-    if (!_private->mainClient) {
+    if (pageCache){
+        _private->loadingFromPageCache = YES;
+        [self _commitIfReady: pageCache];
+    }
+    else if (!_private->mainClient) {
 	if ([self webFrame] == [[self controller] mainFrame]) {
 	    [_private->request setCookiePolicyBaseURL:[self URL]];
 	} else {
@@ -172,6 +176,11 @@
     }
 }
 
+- (void)_startLoading
+{
+    [self _startLoading: nil];
+}
+
 - (void)_addSubresourceClient:(WebSubresourceClient *)client
 {
     if (_private->subresourceClients == nil) {
@@ -431,9 +440,9 @@
     return _private->committed;
 }
 
--(void)_commitIfReady
+-(void)_commitIfReady: (NSDictionary *)pageCache
 {
-    if (![self isDownloading] && _private->gotFirstByte && !_private->committed) {
+    if (_private->loadingFromPageCache || (![self isDownloading] && _private->gotFirstByte && !_private->committed)) {
         WebFrameLoadType loadType = [[self webFrame] _loadType];
         bool reload = loadType == WebFrameLoadTypeReload
             || loadType == WebFrameLoadTypeReloadAllowingStaleData;
@@ -443,12 +452,25 @@
 
         LOG(Loading, "committed resource = %@", [[self request] URL]);
 	_private->committed = TRUE;
-        [self _makeRepresentation];
-        [[self webFrame] _transitionToCommitted];
-	[[self _bridge] openURL:[[_private->response URL] absoluteString] reload:reload headers:headers lastModified:[_private->response lastModifiedDate]];
+        if (!pageCache)
+            [self _makeRepresentation];
+            
+        [[self webFrame] _transitionToCommitted: pageCache];
+	
+        if (pageCache){
+            WebDataSource *ds = [pageCache objectForKey: @"WebKitDataSource"];
+            [[ds _bridge] openURL:[[_private->response URL] absoluteString] reload:reload headers:headers lastModified:nil pageCache: pageCache];
+        }
+        else
+            [[self _bridge] openURL:[[_private->response URL] absoluteString] reload:reload headers:headers lastModified:[_private->response lastModifiedDate] pageCache: pageCache];
     }
 }
 
+- (void)_commitIfReady
+{
+    [self _commitIfReady: nil];
+}
+
 -(void)_makeRepresentation
 {
     Class repClass = [self _representationClass];
@@ -619,5 +641,14 @@
     return _private->justOpenedForTargetedLink;
 }
 
+- (void)_setStoredInPageCache:(BOOL)f
+{
+    _private->storedInPageCache = f;
+}
+
+- (BOOL)_storedInPageCache
+{
+    return _private->storedInPageCache;
+}
 @end
 
diff --git a/WebKit/WebView.subproj/WebFramePrivate.h b/WebKit/WebView.subproj/WebFramePrivate.h
index 71f56ae..c68b3fe 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.h
+++ b/WebKit/WebView.subproj/WebFramePrivate.h
@@ -103,7 +103,7 @@ typedef enum {
 - (void)_detachFromParent;
 - (void)_setController: (WebController *)controller;
 - (void)_setDataSource: (WebDataSource *)d;
-- (void)_transitionToCommitted;
+- (void)_transitionToCommitted: (NSDictionary *)pageCache;
 - (void)_transitionToLayoutAcceptable;
 - (WebFrameState)_state;
 - (void)_setState: (WebFrameState)newState;
diff --git a/WebKit/WebView.subproj/WebFramePrivate.m b/WebKit/WebView.subproj/WebFramePrivate.m
index cc3e7c2..28d056e 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.m
+++ b/WebKit/WebView.subproj/WebFramePrivate.m
@@ -399,7 +399,7 @@ static const char * const stateNames[] = {
 }
 
 
-- (void)_transitionToCommitted
+- (void)_transitionToCommitted: (NSDictionary *)pageCache
 {
     ASSERT([self controller] != nil);
 
@@ -425,7 +425,16 @@ static const char * const stateNames[] = {
             }
 
             // Set the committed data source on the frame.
-            [self _setDataSource:_private->provisionalDataSource];
+            // Use the datasource from the pageCache if present, otherwise
+            // the provisional becomes the committed datasource.
+            if (pageCache){
+                WebDataSource *cachedDataSource = [pageCache objectForKey: @"WebKitDataSource"];
+                ASSERT (cachedDataSource != nil);
+                [self _setDataSource: cachedDataSource];
+            }
+            else
+                [self _setDataSource:_private->provisionalDataSource];
+                
             [_private setProvisionalDataSource: nil];
 
             [self _setState: WebFrameStateCommittedPage];
@@ -442,7 +451,16 @@ static const char * const stateNames[] = {
                 if ([[self controller] usesBackForwardList]) {
                     // Must grab the current scroll position before disturbing it
                     [self _saveScrollPositionToItem:[_private previousItem]];
-                    [[self webView] _makeDocumentViewForDataSource:ds];
+                    
+                    // Create a document view for this document, or used the cached view.
+                    if (pageCache){
+                        id <WebDocumentView> cachedView = [pageCache objectForKey: @"WebKitDocumentView"];
+                        ASSERT (cachedView != nil);
+                        [[self webView] _setDocumentView: cachedView];
+                    }
+                    else
+                        [[self webView] _makeDocumentViewForDataSource:ds];
+                        
                     // FIXME - I'm not sure this call does anything.  Should be dealt with as
                     // part of 3024377
                     [self _restoreScrollPosition];
@@ -512,6 +530,16 @@ static const char * const stateNames[] = {
     }
 }
 
+- (BOOL)_canCachePage
+{
+    return YES;
+}
+
+- (void)_purgePageCache
+{
+    // This method implements the rule for purging the page cache.
+}
+
 - (WebFrameState)_state
 {
     return _private->state;
@@ -551,6 +579,17 @@ static const char * const stateNames[] = {
         [_private->scheduledLayoutTimer fire];
         ASSERT(_private->scheduledLayoutTimer == nil);
         [_private setPreviousItem:nil];
+
+        // Cache the page, if possible.
+        if ([_private->bridge canCachePage] && [self _canCachePage]){
+            LOG (PageCache, "enabling page cache for %@, %@", [self name], [[self dataSource] URL]);
+            [[_private currentItem] setPageCacheEnabled: YES];
+            [[self dataSource] _setStoredInPageCache: YES];
+            [[[_private currentItem] pageCache] setObject: [self dataSource] forKey: @"WebKitDataSource"];
+            [[[_private currentItem] pageCache] setObject: [[self webView] documentView] forKey: @"WebKitDocumentView"];
+            [_private->bridge saveDocumentToPageCache];
+            [self _purgePageCache];
+        }
     }
 }
 
@@ -1066,7 +1105,9 @@ static const char * const stateNames[] = {
         // adding the BF item will save away scroll state.
         [self _addBackForwardItemClippedAtTarget:NO];
     }
-    [_private->bridge openURL:[URL absoluteString] reload:NO headers:nil lastModified:nil];
+    
+    [_private->bridge openURL:[URL absoluteString] reload:NO headers:nil lastModified:nil pageCache: nil];
+    
     if (!isRedirect) {
         // This will clear previousItem from the rest of the frame tree tree that didn't
         // doing any loading.  We need to make a pass on this now, since for anchor nav
@@ -1352,7 +1393,16 @@ static const char * const stateNames[] = {
     if (self == [[self controller] mainFrame])
         LOG(DocumentLoad, "loading %@", [[[self provisionalDataSource] request] URL]);
 
-    [_private->provisionalDataSource startLoading];
+    WebFrameLoadType loadType = [self _loadType];
+    if ((loadType == WebFrameLoadTypeForward ||
+        loadType == WebFrameLoadTypeBack ||
+        loadType == WebFrameLoadTypeIndexedBackForward) &&
+        [[_private provisionalItem] pageCacheEnabled]){
+        printf ("Restoring page from state, %s\n", [[[[_private provisionalItem] URL] absoluteString] cString]);
+        [_private->provisionalDataSource _startLoading: [[_private provisionalItem] pageCache]];
+    }
+    else 
+        [_private->provisionalDataSource startLoading];
 }
 
 - (void)_loadDataSource:(WebDataSource *)newDataSource withLoadType: (WebFrameLoadType)loadType
diff --git a/WebKit/WebView.subproj/WebHTMLViewPrivate.m b/WebKit/WebView.subproj/WebHTMLViewPrivate.m
index c07c8ff..cb9b2c2 100644
--- a/WebKit/WebView.subproj/WebHTMLViewPrivate.m
+++ b/WebKit/WebView.subproj/WebHTMLViewPrivate.m
@@ -169,7 +169,11 @@
     if ([frameName length] == 0) {
         [elementInfo setObject:webFrame forKey:WebElementLinkTargetFrameKey];
     } else {
-        [elementInfo _web_setObjectIfNotNil:[webFrame findFrameNamed:frameName] forKey:WebElementLinkTargetFrameKey];
+        WebFrame *wf = [webFrame findFrameNamed:frameName];
+        if (wf != nil)
+            [elementInfo setObject:wf forKey:WebElementLinkTargetFrameKey];
+        else
+            [elementInfo removeObjectForKey:WebElementLinkTargetFrameKey];
     }
 
     [elementInfo setObject:webFrame forKey:WebElementFrameKey];

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list