[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:35:53 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit da0c49d29ddee3e769bfd2573ee6ae1f3093e890
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Apr 10 02:12:56 2003 +0000

            Fix for 3222904.  This change fixes the immediate symptoms of the bug,
            but we need to come back to this issue after beta 2.  Bug 3223929 captures
            the other problems.
    
            Reviewed by gramps.
    
            * WebView.subproj/WebDataSourcePrivate.h:
            * WebView.subproj/WebDataSourcePrivate.m:
            (-[WebDataSource __setRequest:]):
            (-[WebDataSource _setRequest:]):
            * WebView.subproj/WebFramePrivate.m:
            (-[WebFrame _shouldReloadForCurrent:andDestination:]):
            (-[WebFrame _loadItem:withLoadType:]):
            (-[WebFrame _loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4057 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 23c4c10..43de141 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,20 @@
+2003-04-09  Richard Williamson   <rjw at apple.com>
+
+        Fix for 3222904.  This change fixes the immediate symptoms of the bug,
+        but we need to come back to this issue after beta 2.  Bug 3223929 captures
+        the other problems.
+        
+        Reviewed by gramps.
+
+        * WebView.subproj/WebDataSourcePrivate.h:
+        * WebView.subproj/WebDataSourcePrivate.m:
+        (-[WebDataSource __setRequest:]):
+        (-[WebDataSource _setRequest:]):
+        * WebView.subproj/WebFramePrivate.m:
+        (-[WebFrame _shouldReloadForCurrent:andDestination:]):
+        (-[WebFrame _loadItem:withLoadType:]):
+        (-[WebFrame _loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]):
+
 2003-04-09  Maciej Stachowiak  <mjs at apple.com>
 
         Reviewed by Chris, Trey, Darin and Don.
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.h b/WebKit/WebView.subproj/WebDataSourcePrivate.h
index eb1bc88..7048251 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.h
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.h
@@ -133,6 +133,7 @@
 - (double)_loadingStartedTime;
 - (void)_setTitle:(NSString *)title;
 - (void)_setURL:(NSURL *)URL;
+- (void)__setRequest:(NSURLRequest *)request;
 - (void)_setRequest:(NSURLRequest *)request;
 - (void)_setResponse:(NSURLResponse *)response;
 - (void)_layoutChildren;
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.m b/WebKit/WebView.subproj/WebDataSourcePrivate.m
index 85242cd..40b6a5d 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.m
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.m
@@ -318,6 +318,14 @@
     _private->request = newRequest;
 }
 
+- (void)__setRequest:(NSURLRequest *)request
+{
+    if (request != _private->request){
+        [_private->request release];
+        _private->request = [request retain];
+    }
+}
+
 - (void)_setRequest:(NSURLRequest *)request
 {
     // We should never be getting a redirect callback after the data
@@ -326,7 +334,7 @@
     ASSERT(!_private->committed);
 
     NSURLRequest *oldRequest = _private->request;
-    
+
     _private->request = [request retain];
 
     // Only send serverRedirectedForDataSource: if URL changed.
diff --git a/WebKit/WebView.subproj/WebFramePrivate.m b/WebKit/WebView.subproj/WebFramePrivate.m
index 0fe7c6e..c481187 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.m
+++ b/WebKit/WebView.subproj/WebFramePrivate.m
@@ -1051,6 +1051,12 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     }
 }
 
+- (BOOL)_shouldReloadForCurrent:(NSURL *)currentURL andDestination:(NSURL *)destinationURL
+{
+    return !(([currentURL fragment] || [destinationURL fragment]) &&
+    [[currentURL _web_URLByRemovingFragment] isEqual: [destinationURL _web_URLByRemovingFragment]]);
+}
+
 // loads content into this frame, as specified by item
 - (void)_loadItem:(WebHistoryItem *)item withLoadType:(WebFrameLoadType)loadType
 {
@@ -1065,25 +1071,34 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     // check for all that as an additional optimization.
     // We also do not do anchor-style navigation if we're posting a form.
     
-    // FIXME: These checks don't match the ones in _loadURL:referrer:loadType:target:triggeringEvent:isFormSubmission:
-    // Perhaps they should.
-    
-    if (!formData
-        && [item anchor]
-        && [[itemURL _web_URLByRemovingFragment] isEqual: [currentURL _web_URLByRemovingFragment]]
-        && (!_private->children || ![_private->children count]))
+    if (!formData && ![self _shouldReloadForCurrent:itemURL andDestination:currentURL] )
     {
+#if 0
+        // FIXME:  We need to normalize the code paths for anchor navigation.  Something
+        // like the following line of code should be done, but also accounting for correct
+        // updates to the back/forward list and scroll position.
+        // rjw 4/9/03 See 3223929.
+        [self _loadURL:itemURL referrer:[[[self dataSource] request] HTTPReferrer] loadType:loadType target:nil triggeringEvent:nil form:nil formValues:nil];
+#endif
         // must do this maintenance here, since we don't go through a real page reload
         [self _saveScrollPositionToItem:[_private currentItem]];
         // FIXME: form state might want to be saved here too
 
         // FIXME: Perhaps we can use scrollToAnchorWithURL here instead and remove the older scrollToAnchor:?
-        [[_private->dataSource _bridge] scrollToAnchor: [item anchor]];
+        if ([item anchor])
+            [[_private->dataSource _bridge] scrollToAnchor: [item anchor]];
     
         // must do this maintenance here, since we don't go through a real page reload
         [_private setCurrentItem:item];
         [self _restoreScrollPosition];
 
+        // Fake the URL change by updating the datasource's request.  This will no longer
+        // be necessary if we do the better fix described above.
+        NSMutableURLRequest *hackedRequest = [[[self dataSource] request] mutableCopy];
+        [hackedRequest setURL: itemURL];
+        [[self dataSource] __setRequest: [[hackedRequest copy] autorelease]];
+        [hackedRequest release];
+        
         [[[self webView] _locationChangeDelegateForwarder] webView: _private->controller locationChangedWithinPageForDataSource:_private->dataSource];
     } else {
         // Remember this item so we can traverse any child items as child frames load
@@ -1577,9 +1592,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     if (!isFormSubmission
         && loadType != WebFrameLoadTypeReload
         && loadType != WebFrameLoadTypeSame
-        && ![_private->bridge isFrameSet]
-        && [URL fragment]
-        && [[URL _web_URLByRemovingFragment] isEqual:[[NSURL _web_URLWithString:[_private->bridge URL]] _web_URLByRemovingFragment]]) {
+        && ![self _shouldReloadForCurrent:URL andDestination:[NSURL _web_URLWithString:[_private->bridge URL]]]) {
         
         // Just do anchor navigation within the existing content.
         

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list