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

darin darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:49:51 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit a820a16e84d1d28268c7110ed8669af3996dcc1e
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Oct 15 22:44:58 2002 +0000

    WebCore:
    
            * kwq/KWQKHTMLPartImpl.mm: (KWQKHTMLPartImpl::urlSelected):
    	Move the special case of a different anchor within the same
    	page into WebKit from here.
    
            * kwq/kdecore/kurl.h: Mark urlcmp as a friend.
            * kwq/KWQKURL.mm: (urlcmp): Implement the ignoreRef feature, which
    	is needed to make the KHTMLPart::openURL function work right.
    
            * kwq/WebCoreBridge.h: Removed addBackForwardItemWithURL:anchor:
    	and added URL method.
            * kwq/WebCoreBridge.mm: (-[WebCoreBridge URL]): Added.
    
    WebKit:
    
            * WebCoreSupport.subproj/WebBridge.m:
            (-[WebBridge loadURL:referrer:]): Add a special case for when the URL is the
    	same as the previous URL for the same frame. This relies on some logic in
    	KHTML's openURL method that handles this case too.
    
            * WebView.subproj/WebDataSource.m:
            (-[WebDataSource initWithRequest:]): Don't bother keeping an inputURL.
            (-[WebDataSource URL]): Just return [[self request] URL]. Maybe we can
    	remove this altogether.
            * WebView.subproj/WebDataSourcePrivate.h: Remove inputURL, finalURL.
            * WebView.subproj/WebDataSourcePrivate.m:
            (-[WebDataSourcePrivate dealloc]): No need to release inputURL, finalURL.
            (-[WebDataSource _setURL:]): Used only by the new code above. Makes a copy
    	of the request, changes the URL, and then drops the old request.
            (-[WebDataSource _setRequest:]): Changed to no longer call _setURL. Now
    	does much of the work that _setURL used to do.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2333 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index d7a1fe8..f450c41 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,5 +1,19 @@
 2002-10-15  Darin Adler  <darin at apple.com>
 
+        * kwq/KWQKHTMLPartImpl.mm: (KWQKHTMLPartImpl::urlSelected):
+	Move the special case of a different anchor within the same
+	page into WebKit from here.
+
+        * kwq/kdecore/kurl.h: Mark urlcmp as a friend.
+        * kwq/KWQKURL.mm: (urlcmp): Implement the ignoreRef feature, which
+	is needed to make the KHTMLPart::openURL function work right.
+
+        * kwq/WebCoreBridge.h: Removed addBackForwardItemWithURL:anchor:
+	and added URL method.
+        * kwq/WebCoreBridge.mm: (-[WebCoreBridge URL]): Added.
+
+2002-10-15  Darin Adler  <darin at apple.com>
+
 	- fixed 3074558 -- frames multiply at: http://www.iarsn.com/
 
 	The key was to make the name attribute work properly.
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index d7a1fe8..f450c41 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,5 +1,19 @@
 2002-10-15  Darin Adler  <darin at apple.com>
 
+        * kwq/KWQKHTMLPartImpl.mm: (KWQKHTMLPartImpl::urlSelected):
+	Move the special case of a different anchor within the same
+	page into WebKit from here.
+
+        * kwq/kdecore/kurl.h: Mark urlcmp as a friend.
+        * kwq/KWQKURL.mm: (urlcmp): Implement the ignoreRef feature, which
+	is needed to make the KHTMLPart::openURL function work right.
+
+        * kwq/WebCoreBridge.h: Removed addBackForwardItemWithURL:anchor:
+	and added URL method.
+        * kwq/WebCoreBridge.mm: (-[WebCoreBridge URL]): Added.
+
+2002-10-15  Darin Adler  <darin at apple.com>
+
 	- fixed 3074558 -- frames multiply at: http://www.iarsn.com/
 
 	The key was to make the name attribute work properly.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index d7a1fe8..f450c41 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,5 +1,19 @@
 2002-10-15  Darin Adler  <darin at apple.com>
 
+        * kwq/KWQKHTMLPartImpl.mm: (KWQKHTMLPartImpl::urlSelected):
+	Move the special case of a different anchor within the same
+	page into WebKit from here.
+
+        * kwq/kdecore/kurl.h: Mark urlcmp as a friend.
+        * kwq/KWQKURL.mm: (urlcmp): Implement the ignoreRef feature, which
+	is needed to make the KHTMLPart::openURL function work right.
+
+        * kwq/WebCoreBridge.h: Removed addBackForwardItemWithURL:anchor:
+	and added URL method.
+        * kwq/WebCoreBridge.mm: (-[WebCoreBridge URL]): Added.
+
+2002-10-15  Darin Adler  <darin at apple.com>
+
 	- fixed 3074558 -- frames multiply at: http://www.iarsn.com/
 
 	The key was to make the name attribute work properly.
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index 8712305..8e900f9 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -168,25 +168,7 @@ void KWQKHTMLPartImpl::urlSelected(const KURL &url, int button, int state, const
         return;
     }
     
-    WebCoreBridge *targetBridge = bridgeForFrameName(args.frameName);
-
-    // FIXME: KHTML does this in openURL -- we should do this at that level so we don't
-    // have the complexity of dealing with the target here.
-    KHTMLPart *targetPart = [targetBridge part];
-    if (targetPart) {
-        KURL refLess(url);
-        targetPart->m_url.setRef("");
-        refLess.setRef("");
-        if (refLess.url() == targetPart->m_url.url()) {
-            targetPart->m_url = url;
-            targetPart->gotoAnchor(url.ref());
-            // This URL needs to be added to the back/forward list.
-            [targetBridge addBackForwardItemWithURL:cocoaURL anchor:url.ref().getNSString()];
-            return;
-        }
-    }
-    
-    [targetBridge loadURL:cocoaURL referrer:referrer(args)];
+    [bridgeForFrameName(args.frameName) loadURL:cocoaURL referrer:referrer(args)];
 }
 
 class KWQPluginPart : public ReadOnlyPart
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.mm b/WebCore/kwq/KWQKHTMLPartImpl.mm
index 8712305..8e900f9 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.mm
+++ b/WebCore/kwq/KWQKHTMLPartImpl.mm
@@ -168,25 +168,7 @@ void KWQKHTMLPartImpl::urlSelected(const KURL &url, int button, int state, const
         return;
     }
     
-    WebCoreBridge *targetBridge = bridgeForFrameName(args.frameName);
-
-    // FIXME: KHTML does this in openURL -- we should do this at that level so we don't
-    // have the complexity of dealing with the target here.
-    KHTMLPart *targetPart = [targetBridge part];
-    if (targetPart) {
-        KURL refLess(url);
-        targetPart->m_url.setRef("");
-        refLess.setRef("");
-        if (refLess.url() == targetPart->m_url.url()) {
-            targetPart->m_url = url;
-            targetPart->gotoAnchor(url.ref());
-            // This URL needs to be added to the back/forward list.
-            [targetBridge addBackForwardItemWithURL:cocoaURL anchor:url.ref().getNSString()];
-            return;
-        }
-    }
-    
-    [targetBridge loadURL:cocoaURL referrer:referrer(args)];
+    [bridgeForFrameName(args.frameName) loadURL:cocoaURL referrer:referrer(args)];
 }
 
 class KWQPluginPart : public ReadOnlyPart
diff --git a/WebCore/kwq/KWQKURL.h b/WebCore/kwq/KWQKURL.h
index 11f3411..39f7b20 100644
--- a/WebCore/kwq/KWQKURL.h
+++ b/WebCore/kwq/KWQKURL.h
@@ -99,9 +99,9 @@ private:
     int pathEndPos;
     int queryEndPos;
     int fragmentEndPos;
+    
+    // True if both URLs are the same.
+    friend bool urlcmp(const QString &URLA, const QString &URLB, bool ignoreTrailingSlash, bool ignoreRef);
 };
 
-// True if both URLs are the same.
-bool urlcmp(const QString &URLA, const QString &URLB, bool ignoreTrailingSlash, bool ignoreRef);
-
 #endif
diff --git a/WebCore/kwq/KWQKURL.mm b/WebCore/kwq/KWQKURL.mm
index d09551e..cb824fe 100644
--- a/WebCore/kwq/KWQKURL.mm
+++ b/WebCore/kwq/KWQKURL.mm
@@ -1083,8 +1083,15 @@ bool operator==(const KURL &a, const KURL &b)
     return a.urlString == b.urlString;
 }
 
-bool urlcmp(const QString &a, const QString &b, bool, bool)
+bool urlcmp(const QString &a, const QString &b, bool ignoreTrailingSlash, bool ignoreRef)
 {
+    if (ignoreRef) {
+        KURL aURL(a);
+        KURL bURL(b);
+        if (aURL.m_isValid && bURL.m_isValid) {
+            return aURL.urlString.left(aURL.queryEndPos) == bURL.urlString.left(bURL.queryEndPos);
+        }
+    }
     return a == b;
 }
 
diff --git a/WebCore/kwq/WebCoreBridge.h b/WebCore/kwq/WebCoreBridge.h
index 9feca08..8ae775c 100644
--- a/WebCore/kwq/WebCoreBridge.h
+++ b/WebCore/kwq/WebCoreBridge.h
@@ -97,6 +97,8 @@ typedef khtml::RenderPart KHTMLRenderPart;
 - (void)restoreDocumentState;
 - (void)end;
 
+- (NSURL *)URL;
+
 - (void)installInFrame:(NSView *)view;
 - (void)removeFromFrame;
 
@@ -202,8 +204,6 @@ typedef khtml::RenderPart KHTMLRenderPart;
 
 - (BOOL)modifierTrackingEnabled;
 
-- (void)addBackForwardItemWithURL:(NSURL *)URL anchor:(NSString *)anchor;
-
 - (NSView *)nextKeyViewOutsideWebViews;
 - (NSView *)previousKeyViewOutsideWebViews;
 
diff --git a/WebCore/kwq/WebCoreBridge.mm b/WebCore/kwq/WebCoreBridge.mm
index 1ebd129..0878641 100644
--- a/WebCore/kwq/WebCoreBridge.mm
+++ b/WebCore/kwq/WebCoreBridge.mm
@@ -760,4 +760,9 @@ static NSAttributedString *attributedString(DOM::NodeImpl *_startNode, int start
     return part->name().getNSString();
 }
 
+- (NSURL *)URL
+{
+    return part->url().getNSURL();
+}
+
 @end
diff --git a/WebCore/kwq/kdecore/kurl.h b/WebCore/kwq/kdecore/kurl.h
index 11f3411..39f7b20 100644
--- a/WebCore/kwq/kdecore/kurl.h
+++ b/WebCore/kwq/kdecore/kurl.h
@@ -99,9 +99,9 @@ private:
     int pathEndPos;
     int queryEndPos;
     int fragmentEndPos;
+    
+    // True if both URLs are the same.
+    friend bool urlcmp(const QString &URLA, const QString &URLB, bool ignoreTrailingSlash, bool ignoreRef);
 };
 
-// True if both URLs are the same.
-bool urlcmp(const QString &URLA, const QString &URLB, bool ignoreTrailingSlash, bool ignoreRef);
-
 #endif
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 403b6a2..82c5967 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,5 +1,24 @@
 2002-10-15  Darin Adler  <darin at apple.com>
 
+        * WebCoreSupport.subproj/WebBridge.m:
+        (-[WebBridge loadURL:referrer:]): Add a special case for when the URL is the
+	same as the previous URL for the same frame. This relies on some logic in
+	KHTML's openURL method that handles this case too.
+
+        * WebView.subproj/WebDataSource.m:
+        (-[WebDataSource initWithRequest:]): Don't bother keeping an inputURL.
+        (-[WebDataSource URL]): Just return [[self request] URL]. Maybe we can
+	remove this altogether.
+        * WebView.subproj/WebDataSourcePrivate.h: Remove inputURL, finalURL.
+        * WebView.subproj/WebDataSourcePrivate.m:
+        (-[WebDataSourcePrivate dealloc]): No need to release inputURL, finalURL.
+        (-[WebDataSource _setURL:]): Used only by the new code above. Makes a copy
+	of the request, changes the URL, and then drops the old request.
+        (-[WebDataSource _setRequest:]): Changed to no longer call _setURL. Now
+	does much of the work that _setURL used to do.
+
+2002-10-15  Darin Adler  <darin at apple.com>
+
 	WebKit part of improved frame name support.
 
         * WebView.subproj/WebFrame.m:
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 403b6a2..82c5967 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,5 +1,24 @@
 2002-10-15  Darin Adler  <darin at apple.com>
 
+        * WebCoreSupport.subproj/WebBridge.m:
+        (-[WebBridge loadURL:referrer:]): Add a special case for when the URL is the
+	same as the previous URL for the same frame. This relies on some logic in
+	KHTML's openURL method that handles this case too.
+
+        * WebView.subproj/WebDataSource.m:
+        (-[WebDataSource initWithRequest:]): Don't bother keeping an inputURL.
+        (-[WebDataSource URL]): Just return [[self request] URL]. Maybe we can
+	remove this altogether.
+        * WebView.subproj/WebDataSourcePrivate.h: Remove inputURL, finalURL.
+        * WebView.subproj/WebDataSourcePrivate.m:
+        (-[WebDataSourcePrivate dealloc]): No need to release inputURL, finalURL.
+        (-[WebDataSource _setURL:]): Used only by the new code above. Makes a copy
+	of the request, changes the URL, and then drops the old request.
+        (-[WebDataSource _setRequest:]): Changed to no longer call _setURL. Now
+	does much of the work that _setURL used to do.
+
+2002-10-15  Darin Adler  <darin at apple.com>
+
 	WebKit part of improved frame name support.
 
         * WebView.subproj/WebFrame.m:
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.m b/WebKit/WebCoreSupport.subproj/WebBridge.m
index 91e642d..a9b5c8b 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.m
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.m
@@ -24,6 +24,7 @@
 #import <WebFoundation/WebError.h>
 #import <WebFoundation/WebHTTPResourceRequest.h>
 #import <WebFoundation/WebNSStringExtras.h>
+#import <WebFoundation/WebNSURLExtras.h>
 #import <WebFoundation/WebResourceHandle.h>
 #import <WebFoundation/WebResourceResponse.h>
 
@@ -266,6 +267,25 @@
 
 - (void)loadURL:(NSURL *)URL referrer:(NSString *)referrer
 {
+    // FIXME: This logic doesn't exactly match what KHTML does in openURL, so it's possible
+    // this will screw up in some cases involving framesets.
+    if ([[URL _web_URLByRemovingFragment] isEqual:[[self URL] _web_URLByRemovingFragment]]) {
+        [self openURL:URL];
+
+        WebHistoryItem *backForwardItem = [[WebHistoryItem alloc] initWithURL:URL
+            target:[frame name] parent:[[frame parent] name] title:[[frame dataSource] pageTitle]];
+        [backForwardItem setAnchor:[URL fragment]];
+        [[[frame controller] backForwardList] addEntry:backForwardItem];
+        [backForwardItem release];
+
+        //id <WebLocationChangeDelegate> delegate = [[frame controller] locationChangeDelegate];
+        WebDataSource *dataSource = [frame dataSource];
+        [dataSource _setURL:URL];
+        
+        // FIXME: Call some method here.
+        return;
+    }
+    
     WebResourceRequest *request = [[WebResourceRequest alloc] initWithURL:URL];
     [request setReferrer:referrer];
     [self loadRequest:request];
@@ -344,15 +364,6 @@
     return [currentItem documentState];
 }
 
-- (void)addBackForwardItemWithURL:(NSURL *)URL anchor:(NSString *)anchor;
-{
-    WebHistoryItem *backForwardItem = [[WebHistoryItem alloc] initWithURL:URL
-        target:[frame name] parent:[[frame parent] name] title:[[frame dataSource] pageTitle]];
-    [backForwardItem setAnchor:anchor];
-    [[[frame controller] backForwardList] addEntry:backForwardItem];
-    [backForwardItem release];
-}
-
 - (NSString *)userAgentForURL:(NSURL *)URL
 {
     return [[frame controller] userAgentForURL:URL];
diff --git a/WebKit/WebView.subproj/WebDataSource.m b/WebKit/WebView.subproj/WebDataSource.m
index 0a6607e..23c66ee 100644
--- a/WebKit/WebView.subproj/WebDataSource.m
+++ b/WebKit/WebView.subproj/WebDataSource.m
@@ -49,7 +49,6 @@
     
     _private = [[WebDataSourcePrivate alloc] init];
     _private->request = [request retain];
-    _private->inputURL = [[request URL] retain];
 
     ++WebDataSourceCount;
     
@@ -112,7 +111,7 @@
 // May return nil if not initialized with a URL.
 - (NSURL *)URL
 {
-    return _private->finalURL ? _private->finalURL : _private->inputURL;
+    return [[self request] URL];
 }
 
 
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.h b/WebKit/WebView.subproj/WebDataSourcePrivate.h
index e664425..29aeecb 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.h
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.h
@@ -29,14 +29,10 @@
     WebController *controller;
     
     // The original URL as requested during initialization.
-    NSURL *inputURL;
     WebResourceRequest *originalRequest;
     WebResourceRequest *request;
     WebResourceResponse *response;
 
-    // The original URL we may have been redirected to.
-    NSURL *finalURL;
-    
     // Client for main resource, and corresponding handle.
     WebMainResourceClient *mainClient;
     WebResourceHandle *mainHandle;
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.m b/WebKit/WebView.subproj/WebDataSourcePrivate.m
index 9b9364e..6f6afd3 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.m
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.m
@@ -47,9 +47,7 @@
     
     [resourceData release];
     [representation release];
-    [inputURL release];
     [request release];
-    [finalURL release];
     [mainClient release];
     [mainHandle release];
     [subresourceClients release];
@@ -263,26 +261,25 @@
 
 - (void)_setURL:(NSURL *)URL
 {
+    WebResourceRequest *newRequest = [_private->request copy];
+    [_private->request release];
+    [newRequest setURL:URL];
+    _private->request = newRequest;
+}
+
+- (void)_setRequest:(WebResourceRequest *)request
+{
     // We should never be getting a redirect callback after the data
     // source is committed. It would be a WebFoundation bug if it sent
     // a redirect callback after commit.
     ASSERT(!_private->committed);
+    ASSERT(_private->request != request);
+    
+    [request retain];
+    [_private->request release];
+    _private->request = request;
 
-    [URL retain];
-    [_private->finalURL release];
-    _private->finalURL = URL;
-
-    [[_private->controller locationChangeDelegate] serverRedirectTo:URL forDataSource:self];
-}
-
-- (void)_setRequest:(WebResourceRequest *)request
-{
-    if (_private->request != request) {
-        [request retain];
-        [_private->request release];
-        _private->request = request;
-        [self _setURL:[request URL]];
-    }
+    [[_private->controller locationChangeDelegate] serverRedirectTo:[request URL] forDataSource:self];
 }
 
 - (void)_setResponse:(WebResourceResponse *)response

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list