[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:59:13 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit a04f4919670ebe878038b4595a45eda78d700f50
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Oct 1 23:57:47 2003 +0000

    WebKit:
    	Fixed 3438441.  If a load is triggered by a onload handling, don't add an entry for it into the b/f or history.  The new Google ads use this technique.
    
            Reviewed by Ken.
    
            * Misc.subproj/WebKitLogging.h:
            * Misc.subproj/WebKitLogging.m:
            * WebCoreSupport.subproj/WebBridge.m:
            (-[WebBridge loadURL:referrer:reload:onLoadEvent:target:triggeringEvent:form:formValues:]):
            * WebView.subproj/WebFramePrivate.h:
            * WebView.subproj/WebFramePrivate.m:
            (-[WebFrame _addBackForwardItemClippedAtTarget:]):
            (-[WebFrame _transitionToCommitted:]):
            (-[WebFrame _isLoadComplete]):
            (-[WebFrame _loadItem:withLoadType:]):
            (-[WebFrame _itemForRestoringDocState]):
    
    WebCore:
    	Fixed 3438441.  Pass extra info up to WebKit about load type, specifically is a load is triggered by JS running in an onLoad handler.
    
            Reviewed by Ken.
    
            * khtml/ecma/kjs_binding.h:
            * kwq/KWQKHTMLPart.mm:
            (KWQKHTMLPart::openURL):
            (KWQKHTMLPart::openURLRequest):
            (KWQKHTMLPart::submitForm):
            (KWQKHTMLPart::urlSelected):
            * kwq/KWQKHTMLPartBrowserExtension.mm:
            (KHTMLPartBrowserExtension::createNewWindow):
    
            * kwq/WebCoreBridge.h:
            * kwq/WebCoreBridge.mm:
            (-[WebCoreBridge saveDocumentToPageCache]):
    	Nothing changed.  Tweaked spacing.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5110 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 9482f2e..738bc02 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,23 @@
+2003-10-01  Richard Williamson   <rjw at apple.com>
+
+	Fixed 3438441.  Pass extra info up to WebKit about load type, specifically is a load is triggered by JS running in an onLoad handler.
+
+        Reviewed by Ken.
+
+        * khtml/ecma/kjs_binding.h:
+        * kwq/KWQKHTMLPart.mm:
+        (KWQKHTMLPart::openURL):
+        (KWQKHTMLPart::openURLRequest):
+        (KWQKHTMLPart::submitForm):
+        (KWQKHTMLPart::urlSelected):
+        * kwq/KWQKHTMLPartBrowserExtension.mm:
+        (KHTMLPartBrowserExtension::createNewWindow):
+
+        * kwq/WebCoreBridge.h:
+        * kwq/WebCoreBridge.mm:
+        (-[WebCoreBridge saveDocumentToPageCache]):
+	Nothing changed.  Tweaked spacing.
+
 2003-10-01  Chris Blumenberg  <cblu at apple.com>
 
 	<rdar://problem/2942589>: CSS cursors are not implemented
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 9482f2e..738bc02 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,23 @@
+2003-10-01  Richard Williamson   <rjw at apple.com>
+
+	Fixed 3438441.  Pass extra info up to WebKit about load type, specifically is a load is triggered by JS running in an onLoad handler.
+
+        Reviewed by Ken.
+
+        * khtml/ecma/kjs_binding.h:
+        * kwq/KWQKHTMLPart.mm:
+        (KWQKHTMLPart::openURL):
+        (KWQKHTMLPart::openURLRequest):
+        (KWQKHTMLPart::submitForm):
+        (KWQKHTMLPart::urlSelected):
+        * kwq/KWQKHTMLPartBrowserExtension.mm:
+        (KHTMLPartBrowserExtension::createNewWindow):
+
+        * kwq/WebCoreBridge.h:
+        * kwq/WebCoreBridge.mm:
+        (-[WebCoreBridge saveDocumentToPageCache]):
+	Nothing changed.  Tweaked spacing.
+
 2003-10-01  Chris Blumenberg  <cblu at apple.com>
 
 	<rdar://problem/2942589>: CSS cursors are not implemented
diff --git a/WebCore/khtml/ecma/kjs_binding.h b/WebCore/khtml/ecma/kjs_binding.h
index 7915560..d8e9f7a 100644
--- a/WebCore/khtml/ecma/kjs_binding.h
+++ b/WebCore/khtml/ecma/kjs_binding.h
@@ -125,6 +125,9 @@ namespace KJS {
     bool wasRunByUserGesture() const;
 
     virtual void mark();
+    
+    DOM::Event *getCurrentEvent() const { return m_evt; }
+    
   private:
     KHTMLPart* m_part;
     QPtrDict<DOMObject> m_domObjects;
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index 3ef04b5..18b456b 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -37,6 +37,7 @@
 #import "khtmlpart_p.h"
 #import "khtmlview.h"
 #import "kjs_window.h"
+#import "kjs_binding.h"
 #import "misc/htmlattrs.h"
 #import "csshelper.h"
 
@@ -195,12 +196,29 @@ void KWQKHTMLPart::provisionalLoadStarted()
 
 bool KWQKHTMLPart::openURL(const KURL &url)
 {
+    bool onLoad = false;
+    
+    if (jScript() && jScript()->interpreter()) {
+        KHTMLPart *rootPart;
+        
+        rootPart = this;
+        while (rootPart->parentPart() != 0)
+            rootPart = parentPart();
+        KJS::ScriptInterpreter *interpreter = static_cast<KJS::ScriptInterpreter *>(KJSProxy::proxy(rootPart)->interpreter());
+        DOM::Event *evt = interpreter->getCurrentEvent();
+        
+        if (evt) {
+            onLoad = (evt->type() == "load");
+        }
+    }
+
     // FIXME: The lack of args here to get the reload flag from
     // indicates a problem in how we use KHTMLPart::processObjectRequest,
     // where we are opening the URL before the args are set up.
     [_bridge loadURL:url.getNSURL()
             referrer:[_bridge referrer]
               reload:NO
+              onLoadEvent:onLoad
               target:nil
      triggeringEvent:nil
                 form:nil
@@ -213,6 +231,7 @@ void KWQKHTMLPart::openURLRequest(const KURL &url, const URLArgs &args)
     [_bridge loadURL:url.getNSURL()
             referrer:[_bridge referrer]
               reload:args.reload
+              onLoadEvent:false
               target:args.frameName.getNSString()
      triggeringEvent:nil
                 form:nil
@@ -562,6 +581,7 @@ void KWQKHTMLPart::submitForm(const KURL &url, const URLArgs &args)
         [_bridge loadURL:url.getNSURL()
 	        referrer:[_bridge referrer] 
                   reload:args.reload
+             onLoadEvent:false
   	          target:args.frameName.getNSString()
          triggeringEvent:_currentEvent
                     form:_formAboutToBeSubmitted
@@ -618,6 +638,7 @@ void KWQKHTMLPart::urlSelected(const KURL &url, int button, int state, const URL
     [_bridge loadURL:url.getNSURL()
             referrer:[_bridge referrer]
               reload:args.reload
+         onLoadEvent:false
               target:args.frameName.getNSString()
      triggeringEvent:_currentEvent
                 form:nil
diff --git a/WebCore/kwq/KWQKHTMLPartBrowserExtension.mm b/WebCore/kwq/KWQKHTMLPartBrowserExtension.mm
index 31dcfe5..22f6c13 100644
--- a/WebCore/kwq/KWQKHTMLPartBrowserExtension.mm
+++ b/WebCore/kwq/KWQKHTMLPartBrowserExtension.mm
@@ -86,7 +86,7 @@ void KHTMLPartBrowserExtension::createNewWindow(const KURL &url,
 	bridge = [_part->bridge() findFrameNamed:frameName];
 	if (bridge != nil) {
 	    if (!url.isEmpty()) {
-		[bridge loadURL:url.getNSURL() referrer:[_part->bridge() referrer] reload:urlArgs.reload target:nil triggeringEvent:nil form:nil formValues:nil];
+		[bridge loadURL:url.getNSURL() referrer:[_part->bridge() referrer] reload:urlArgs.reload onLoadEvent:false target:nil triggeringEvent:nil form:nil formValues:nil];
 	    }
 	    [bridge focusWindow];
 	    *partResult = [bridge part];
diff --git a/WebCore/kwq/WebCoreBridge.h b/WebCore/kwq/WebCoreBridge.h
index 1ff85a1..bf4e777 100644
--- a/WebCore/kwq/WebCoreBridge.h
+++ b/WebCore/kwq/WebCoreBridge.h
@@ -240,7 +240,7 @@ typedef enum {
 - (NSString *)generateFrameName;
 - (void)frameDetached;
 
-- (void)loadURL:(NSURL *)URL referrer:(NSString *)referrer reload:(BOOL)reload target:(NSString *)target triggeringEvent:(NSEvent *)event form:(NSObject <WebDOMElement> *)form formValues:(NSDictionary *)values;
+- (void)loadURL:(NSURL *)URL referrer:(NSString *)referrer reload:(BOOL)reload onLoadEvent:(BOOL)onLoad target:(NSString *)target triggeringEvent:(NSEvent *)event form:(NSObject <WebDOMElement> *)form formValues:(NSDictionary *)values;
 - (void)postWithURL:(NSURL *)URL referrer:(NSString *)referrer target:(NSString *)target data:(NSData *)data contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event form:(NSObject <WebDOMElement> *)form formValues:(NSDictionary *)values;
 
 - (WebCoreBridge *)createWindowWithURL:(NSURL *)URL frameName:(NSString *)name;
diff --git a/WebCore/kwq/WebCoreBridge.mm b/WebCore/kwq/WebCoreBridge.mm
index 76430ca..01cc8a2 100644
--- a/WebCore/kwq/WebCoreBridge.mm
+++ b/WebCore/kwq/WebCoreBridge.mm
@@ -286,8 +286,6 @@ static bool initializedObjectCacheSize = FALSE;
                                                      windowProperties:windowProperties
                                                    locationProperties:locationProperties
 				                  interpreterBuiltins:interpreterBuiltins] autorelease];
-
-
     [pageState setPausedActions: _part->pauseActions((const void *)pageState)];
 
     return [self saveDocumentToPageCache:pageState];
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 06584ba..7de22b8 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,21 @@
+2003-10-01  Richard Williamson   <rjw at apple.com>
+
+	Fixed 3438441.  If a load is triggered by a onload handling, don't add an entry for it into the b/f or history.  The new Google ads use this technique.
+
+        Reviewed by Ken.
+
+        * Misc.subproj/WebKitLogging.h:
+        * Misc.subproj/WebKitLogging.m:
+        * WebCoreSupport.subproj/WebBridge.m:
+        (-[WebBridge loadURL:referrer:reload:onLoadEvent:target:triggeringEvent:form:formValues:]):
+        * WebView.subproj/WebFramePrivate.h:
+        * WebView.subproj/WebFramePrivate.m:
+        (-[WebFrame _addBackForwardItemClippedAtTarget:]):
+        (-[WebFrame _transitionToCommitted:]):
+        (-[WebFrame _isLoadComplete]):
+        (-[WebFrame _loadItem:withLoadType:]):
+        (-[WebFrame _itemForRestoringDocState]):
+
 2003-10-01  Darin Adler  <darin at apple.com>
 
         Reviewed by John.
diff --git a/WebKit/Misc.subproj/WebKitLogging.h b/WebKit/Misc.subproj/WebKitLogging.h
index 3fc8c25..8439cb4 100644
--- a/WebKit/Misc.subproj/WebKitLogging.h
+++ b/WebKit/Misc.subproj/WebKitLogging.h
@@ -31,3 +31,4 @@ extern WebLogChannel WebKitLogHistory;
 extern WebLogChannel WebKitLogBindings;
 extern WebLogChannel WebKitLogEncoding;
 extern WebLogChannel WebKitLogLiveConnect;
+extern WebLogChannel WebKitLogBackForward;
diff --git a/WebKit/Misc.subproj/WebKitLogging.m b/WebKit/Misc.subproj/WebKitLogging.m
index 5d9126b..8d6f935 100644
--- a/WebKit/Misc.subproj/WebKitLogging.m
+++ b/WebKit/Misc.subproj/WebKitLogging.m
@@ -27,4 +27,5 @@ WebLogChannel WebKitLogBindings =               { 0x01000000, "WebKitLogLevel",
 WebLogChannel WebKitLogFontSelection =	        { 0x02000000, "WebKitLogLevel", WebLogChannelUninitialized };
 WebLogChannel WebKitLogEncoding =               { 0x04000000, "WebKitLogLevel", WebLogChannelUninitialized };
 WebLogChannel WebKitLogLiveConnect =            { 0x08000000, "WebKitLogLevel", WebLogChannelUninitialized };
+WebLogChannel WebKitLogBackForward =            { 0x10000000, "WebKitLogLevel", WebLogChannelUninitialized };
 
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.m b/WebKit/WebCoreSupport.subproj/WebBridge.m
index 90c9948..09dae4a 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.m
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.m
@@ -439,15 +439,22 @@
     [[self dataSource] _setIconURL:URL withType:type];
 }
 
-- (void)loadURL:(NSURL *)URL referrer:(NSString *)referrer reload:(BOOL)reload target:(NSString *)target triggeringEvent:(NSEvent *)event form:(NSObject <WebDOMElement> *)form formValues:(NSDictionary *)values
+- (void)loadURL:(NSURL *)URL referrer:(NSString *)referrer reload:(BOOL)reload onLoadEvent:(BOOL)onLoad target:(NSString *)target triggeringEvent:(NSEvent *)event form:(NSObject <WebDOMElement> *)form formValues:(NSDictionary *)values
 {
     if ([target length] == 0) {
 	target = nil;
     }
 
     WebFrame *targetFrame = [_frame findFrameNamed:target];
-
-    [_frame _loadURL:URL referrer:referrer loadType:(reload ? WebFrameLoadTypeReload : WebFrameLoadTypeStandard) target:target triggeringEvent:event form:form formValues:values];
+    WebFrameLoadType loadType;
+    
+    if (reload)
+        loadType = WebFrameLoadTypeReload;
+    else if (onLoad)
+        loadType = WebFrameLoadTypeOnLoadEvent;
+    else
+        loadType = WebFrameLoadTypeStandard;
+    [_frame _loadURL:URL referrer:referrer loadType:loadType target:target triggeringEvent:event form:form formValues:values];
 
     if (targetFrame != nil && _frame != targetFrame) {
 	[[targetFrame _bridge] focusWindow];
diff --git a/WebKit/WebView.subproj/WebFramePrivate.h b/WebKit/WebView.subproj/WebFramePrivate.h
index 86c54d1..79b9da6 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.h
+++ b/WebKit/WebView.subproj/WebFramePrivate.h
@@ -42,7 +42,8 @@ typedef enum {
     WebFrameLoadTypeReload,
     WebFrameLoadTypeReloadAllowingStaleData,
     WebFrameLoadTypeSame,		// user loads same URL again (but not reload button)
-    WebFrameLoadTypeInternal
+    WebFrameLoadTypeInternal,
+    WebFrameLoadTypeOnLoadEvent
 } WebFrameLoadType;
 
 #define WebFrameStateChangedNotification @"WebFrameStateChangedNotification"
diff --git a/WebKit/WebView.subproj/WebFramePrivate.m b/WebKit/WebView.subproj/WebFramePrivate.m
index da2218b..8951cc2 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.m
+++ b/WebKit/WebView.subproj/WebFramePrivate.m
@@ -262,6 +262,7 @@ NSString *WebPageCacheDocumentViewKey = @"WebPageCacheDocumentViewKey";
 {
     if (![WebDataProtocol _webIsDataProtocolURL:[[[[[self webView] mainFrame] dataSource] response] URL]]) {
         WebHistoryItem *bfItem = [[[self webView] mainFrame] _createItemTreeWithTargetFrame:self clippedAtTarget:doClip];
+        LOG (BackForward, "for frame %@, adding item  %@\n", [self name], bfItem);
         [[[self webView] backForwardList] addItem:bfItem];
     }
 }
@@ -701,6 +702,7 @@ NSString *WebPageCacheDocumentViewKey = @"WebPageCacheDocumentViewKey";
                 [self _makeDocumentView];
                 break;
                 
+            case WebFrameLoadTypeOnLoadEvent:
             case WebFrameLoadTypeInternal:
                 // Add an item to the item tree for this frame
                 ASSERT(![ds _isClientRedirect]);
@@ -1001,6 +1003,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
                         [self _restoreScrollPosition];
                         break;
 
+                    case WebFrameLoadTypeOnLoadEvent:
                     case WebFrameLoadTypeStandard:
                     case WebFrameLoadTypeInternal:
                     case WebFrameLoadTypeReloadAllowingStaleData:
@@ -1265,6 +1268,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
 			    [request setCachePolicy:NSURLRequestReturnCacheDataElseLoad];
 			}
                         break;
+                    case WebFrameLoadTypeOnLoadEvent:
                     case WebFrameLoadTypeStandard:
                     case WebFrameLoadTypeInternal:
                         // no-op: leave as protocol default
@@ -2039,6 +2043,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
         case WebFrameLoadTypeForward:
         case WebFrameLoadTypeIndexedBackForward:
         case WebFrameLoadTypeInternal:
+        case WebFrameLoadTypeOnLoadEvent:
         case WebFrameLoadTypeStandard:
             return [_private currentItem];
     }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list