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


The following commit has been merged in the debian/unstable branch:
commit 1dc1aaa93eb091407b4fd04d6f1a21717be6fd6b
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Mar 5 02:01:20 2002 +0000

            Changes to support 'provisional' data sources.
            API changes to IFBaseWebController, removed redundant methods.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@688 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 67e4af5..77d305b 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,18 @@
+2002-03-04  Richard Williamson  <rjw at apple.com>
+ 
+        Changes to support 'provisional' data sources.
+        API changes to IFBaseWebController, removed redundant methods.
+ 
+	* src/kwq/KWQKHTMLPart.mm: (WCSetIFWebDataSourceMakeFunc), (-[KHTMLPartLoadClient
+	IFURLHandleResourceDidBeginLoading:]), (-[KHTMLPartLoadClient
+	IFURLHandleResourceDidCancelLoading:]), (-[KHTMLPartLoadClient
+	IFURLHandleResourceDidFinishLoading:data:]), (-[KHTMLPartLoadClient
+	IFURLHandle:resourceDataDidBecomeAvailable:]), (-[KHTMLPartLoadClient
+	IFURLHandle:resourceDidFailLoadingWithResult:]),
+	(KHTMLPart::khtmlMouseReleaseEvent), (KHTMLPart::submitForm),
+	(KHTMLPart::requestFrame):
+	* src/kwq/external.h:
+
 2002-02-28  Richard Williamson  <rjw at apple.com>
 
         Finished up progress notification for main document.  
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 67e4af5..77d305b 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,18 @@
+2002-03-04  Richard Williamson  <rjw at apple.com>
+ 
+        Changes to support 'provisional' data sources.
+        API changes to IFBaseWebController, removed redundant methods.
+ 
+	* src/kwq/KWQKHTMLPart.mm: (WCSetIFWebDataSourceMakeFunc), (-[KHTMLPartLoadClient
+	IFURLHandleResourceDidBeginLoading:]), (-[KHTMLPartLoadClient
+	IFURLHandleResourceDidCancelLoading:]), (-[KHTMLPartLoadClient
+	IFURLHandleResourceDidFinishLoading:data:]), (-[KHTMLPartLoadClient
+	IFURLHandle:resourceDataDidBecomeAvailable:]), (-[KHTMLPartLoadClient
+	IFURLHandle:resourceDidFailLoadingWithResult:]),
+	(KHTMLPart::khtmlMouseReleaseEvent), (KHTMLPart::submitForm),
+	(KHTMLPart::requestFrame):
+	* src/kwq/external.h:
+
 2002-02-28  Richard Williamson  <rjw at apple.com>
 
         Finished up progress notification for main document.  
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 67e4af5..77d305b 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,18 @@
+2002-03-04  Richard Williamson  <rjw at apple.com>
+ 
+        Changes to support 'provisional' data sources.
+        API changes to IFBaseWebController, removed redundant methods.
+ 
+	* src/kwq/KWQKHTMLPart.mm: (WCSetIFWebDataSourceMakeFunc), (-[KHTMLPartLoadClient
+	IFURLHandleResourceDidBeginLoading:]), (-[KHTMLPartLoadClient
+	IFURLHandleResourceDidCancelLoading:]), (-[KHTMLPartLoadClient
+	IFURLHandleResourceDidFinishLoading:data:]), (-[KHTMLPartLoadClient
+	IFURLHandle:resourceDataDidBecomeAvailable:]), (-[KHTMLPartLoadClient
+	IFURLHandle:resourceDidFailLoadingWithResult:]),
+	(KHTMLPart::khtmlMouseReleaseEvent), (KHTMLPart::submitForm),
+	(KHTMLPart::requestFrame):
+	* src/kwq/external.h:
+
 2002-02-28  Richard Williamson  <rjw at apple.com>
 
         Finished up progress notification for main document.  
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index 8d39f40..92ecfee 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -58,74 +58,18 @@
 #import <KWQView.h>
 
 #include <WCLoadProgress.h>
+#include <WCWebDataSource.h>
 
- at class IFWebDataSource;
- at class IFWebView;
- at class IFWebFrame;
- at class IFError;
-
- at protocol IFWebController
-- (IFWebFrame *)createFrameNamed: (NSString *)name for: (IFWebDataSource *)dataSource inParent: (IFWebDataSource *)dataSource;
-- (BOOL)locationWillChangeTo: (NSURL *)url forFrame: (IFWebFrame *)frame;
-- (BOOL)_changeLocationTo: (NSURL *)url forFrame: (IFWebFrame *)frame parent: (IFWebDataSource *)parent;
-- (void)locationChangeStartedForFrame: (IFWebFrame *)frame;
-- (void)locationChangeDone: (IFError *)error forFrame: (IFWebFrame *)frame;
- at end
-
- at protocol IFLocationChangeHandler
-- (void)locationChangeDone: (IFError *)error forDataSource: (IFWebDataSource *)dataSource;
- at end
-
- at interface IFWebDataSource : NSObject
-- initWithURL: (NSURL *)url;
-- (void)setFrame: (IFWebFrame *)fName;
-- (IFWebFrame *)frame;
-- (id <IFWebController>)controller;
-- (void)startLoading: (BOOL)forceRefresh;
-- (void)_startLoading: (BOOL)forceRefresh initiatedByUserEvent: (BOOL)byUserEvent;
-- frameNamed: (NSString *)f;
-- (void)_setParent: (IFWebDataSource *)p;
-- (IFWebDataSource *)parent;
- at end
-
-// This should not be allowed here.  data source should not reference view
-// API.
- at interface IFWebView: NSObject
-- (QWidget *)_widget;
- at end
-
- at interface IFWebFrame: NSObject
-- initWithName: (NSString *)n view: v dataSource: (IFWebDataSource *)d;
-- view;
-- (IFWebDataSource *)dataSource;
-- (void)_setRenderFramePart: (void *)p;
-- (void *)_renderFramePart;
- at end
+#include <external.h>
 
-typedef enum {
-    IF_LOAD_TYPE_CSS    = 1,
-    IF_LOAD_TYPE_IMAGE  = 2,
-    IF_LOAD_TYPE_SCRIPT = 3,
-    IF_LOAD_TYPE_HTML   = 4
-} IF_LOAD_TYPE;
 
+WCIFWebDataSourceMakeFunc WCIFWebDataSourceMake;
 
- at interface IFLoadProgress : NSObject
+void WCSetIFWebDataSourceMakeFunc(WCIFWebDataSourceMakeFunc func)
 {
-    int bytesSoFar;	// 0 if this is the start of load
-    int totalToLoad;	// -1 if this is not known.
-                        // bytesSoFar == totalLoaded when complete
-    IF_LOAD_TYPE type;	// load types, either image, css, or jscript
+    WCIFWebDataSourceMake = func;
 }
-- init;
- at end
-
- at protocol  IFLoadHandler
-- (void)receivedProgress: (IFLoadProgress *)progress forResource: (NSString *)resourceDescription fromDataSource: (IFWebDataSource *)dataSource;
-
-- (void)receivedError: (IFError *)error forResource: (NSString *)resourceDescription partialProgress: (IFLoadProgress *)progress fromDataSource: (IFWebDataSource *)dataSource;
 
- at end
 
 static bool cache_init = false;
 
@@ -172,7 +116,7 @@ static void recursive(const DOM::Node &pNode, const DOM::Node &node)
     
     userData = [[[sender attributes] objectForKey:IFURLHandleUserData] pointerValue];
     
-    KWQDEBUGLEVEL1 (0x2000, "userData = 0x%08x\n", userData);
+    KWQDEBUGLEVEL1 (0x2000, "url = %s\n", [[[sender url] absoluteString] cString]);
 }
 
 - (void)IFURLHandleResourceDidCancelLoading:(IFURLHandle *)sender
@@ -181,7 +125,7 @@ static void recursive(const DOM::Node &pNode, const DOM::Node &node)
     
     userData = [[[sender attributes] objectForKey:IFURLHandleUserData] pointerValue];
 
-    KWQDEBUGLEVEL1 (0x2000, "userData = 0x%08x\n", userData);
+    KWQDEBUGLEVEL1 (0x2000, "url = %s\n", [[[sender url] absoluteString] cString]);
     [sender autorelease];
 }
 
@@ -191,7 +135,7 @@ static void recursive(const DOM::Node &pNode, const DOM::Node &node)
     
     userData = [[[sender attributes] objectForKey:IFURLHandleUserData] pointerValue];
 
-    KWQDEBUGLEVEL1 (0x2000, "userData = 0x%08x\n", userData);
+    KWQDEBUGLEVEL1 (0x2000, "url = %s\n", [[[sender url] absoluteString] cString]);
     m_part->closeURL();
 
     IFLoadProgress *loadProgress = WCIFLoadProgressMake();
@@ -208,7 +152,7 @@ static void recursive(const DOM::Node &pNode, const DOM::Node &node)
     
     userData = [[[sender attributes] objectForKey:IFURLHandleUserData] pointerValue];
 
-    KWQDEBUGLEVEL3 (0x2000, "userData = 0x%08x, data = 0x%08x, length %d\n", userData, data, [data length]);
+    KWQDEBUGLEVEL3 (0x2000, "url = %s, data = 0x%08x, length %d\n", [[[sender url] absoluteString] cString], data, [data length]);
     if (!m_data) {
         m_data = [data retain];
     }
@@ -226,7 +170,7 @@ static void recursive(const DOM::Node &pNode, const DOM::Node &node)
     
     userData = [[[sender attributes] objectForKey:IFURLHandleUserData] pointerValue];
 
-    KWQDEBUGLEVEL2 (0x2000, "result = %d, userData = 0x%08x\n", result, userData);
+    KWQDEBUGLEVEL2 (0x2000, "url = %s, result = %d\n", [[[sender url] absoluteString] cString], result);
     [sender autorelease];
 }
 
@@ -1392,35 +1336,20 @@ void KHTMLPart::khtmlMouseReleaseEvent( khtml::MouseReleaseEvent *event )
 
     // HACK!  FIXME!
     if (d->m_strSelectedURL != QString::null) {
-        IFWebDataSource *dataSource;
-        id <IFWebController>controller;
+        IFWebDataSource *oldDataSource, *newDataSource;
         KURL clickedURL(completeURL( splitUrlTarget(d->m_strSelectedURL)));
         NSString *urlString = [NSString stringWithCString:clickedURL.url().latin1()];
         NSURL *url = [NSURL URLWithString: urlString];
         IFWebFrame *frame;
         
-        dataSource = getDataSource();
-        frame = [dataSource frame];
-        controller = [dataSource controller];
+        oldDataSource = getDataSource();
+        frame = [oldDataSource frame];
         
-        if ([controller _changeLocationTo: url forFrame: frame parent: [[frame dataSource] parent]]){
-            [[frame dataSource] _startLoading: YES initiatedByUserEvent: YES];
-        }
-
-/*
-        id nsview = ((IFWebView *)((QWidget *)view())->getView());
+        newDataSource = WCIFWebDataSourceMake(url);
+        [newDataSource _setParent: [oldDataSource parent]];
         
-        //if ([nsview isKindOfClass: NSClassFromString(@"IFDynamicScrollBarsView")])
-        if ([nsview isKindOfClass: NSClassFromString(@"NSScrollView")])
-            nsview = [nsview documentView];
-        [nsview _resetView];
-        openURL (clickedURL);
-        // [kocienda]: shield your eyes!
-        // this hack is to get link clicks to show up in the history list of the test app
-        // this should be removed and replaced by something better
-        NSString *urlString = [NSString stringWithCString:clickedURL.url().latin1()];
-        [[NSNotificationCenter defaultCenter] postNotificationName:@"uri-click" object:urlString];
-*/
+        [frame setProvisionalDataSource: newDataSource];
+        [frame startLoading];
     }
     
 #ifndef _KWQ_
@@ -1718,19 +1647,19 @@ void KHTMLPart::submitForm( const char *action, const QString &url, const QByteA
   else
     emit d->m_extension->openURLRequest( u, args );
 #endif
-
+    IFWebDataSource *oldDataSource, *newDataSource;
     NSString *urlString = [NSString stringWithCString:u.url().latin1()];
     NSURL *qurl = [NSURL URLWithString: urlString];
     IFWebFrame *frame;
-    id <IFWebController>controller;
     
-    dataSource = getDataSource();
-    frame = [dataSource frame];
-    controller = [dataSource controller];
+    oldDataSource = getDataSource();
+    frame = [oldDataSource frame];
     
-    if ([controller _changeLocationTo: qurl forFrame: frame parent: [[frame dataSource] parent]]){
-        [[frame dataSource] _startLoading: YES initiatedByUserEvent: YES];
-    }
+    newDataSource = WCIFWebDataSourceMake(qurl);
+    [newDataSource _setParent: [oldDataSource parent]];
+    
+    [frame setProvisionalDataSource: newDataSource];
+    [frame startLoading];
 
 }
 
@@ -1746,32 +1675,43 @@ bool KHTMLPart::requestFrame( khtml::RenderPart *frame, const QString &url, cons
     IFWebFrame *aFrame;
     IFWebDataSource *dataSource;
     
-    //fprintf (stdout, "0x%08x requestFrame():  part = 0x%08x, name = %s, url = %s\n", (unsigned int)this, (unsigned int)frame, frameName.latin1(), url.latin1());    
+    fprintf (stdout, "0x%08x requestFrame():  part = 0x%08x, name = %s, url = %s\n", (unsigned int)this, (unsigned int)frame, frameName.latin1(), url.latin1());    
     dataSource = getDataSource();
 
     aFrame =[dataSource frameNamed: nsframeName];
     if (aFrame){
-        //fprintf (stdout, "0x%08x requestFrame():  part = 0x%08x frame found\n", (unsigned int)this, (unsigned int)frame);    
+        fprintf (stdout, "0x%08x requestFrame():  frame found part = 0x%08x\n", (unsigned int)this, (unsigned int)frame);    
+        fprintf (stdout, "0x%08x requestFrame():  frame found _widget = 0x%08x\n", (unsigned int)this, (unsigned int)[[aFrame view] _widget]);    
+        fprintf (stdout, "0x%08x requestFrame():  frame found _provisionalWidget = 0x%08x\n", (unsigned int)this, (unsigned int)[[aFrame view] _provisionalWidget]);    
         // ?
-        frame->setWidget ([[aFrame view] _widget]);
+        if ([[aFrame view] _provisionalWidget])
+            frame->setWidget ([[aFrame view] _provisionalWidget]);
+        else
+            frame->setWidget ([[aFrame view] _widget]);
     }
     else {        
-        IFWebDataSource *dataSource;
+        IFWebDataSource *oldDataSource, *newDataSource;
         NSURL *childURL;
         IFWebFrame *newFrame;
         id <IFWebController> controller;
 
-        //fprintf (stdout, "0x%08x requestFrame():  part = 0x%08x creating frame\n", (unsigned int)this, (unsigned int)frame);    
+        fprintf (stdout, "0x%08x requestFrame():  part = 0x%08x creating frame\n", (unsigned int)this, (unsigned int)frame);    
         childURL = [NSURL URLWithString: QSTRING_TO_NSSTRING (completeURL( url ).url() )];
         
-        dataSource = getDataSource();
-        controller = [dataSource controller];
-        newFrame = [controller createFrameNamed: nsframeName for: nil inParent: dataSource];
+        oldDataSource = getDataSource();
+        controller = [oldDataSource controller];
+        newFrame = [controller createFrameNamed: nsframeName for: nil inParent: oldDataSource];
+        if (newFrame == nil){
+            // Controller return NO to location change, now what?
+            return false;
+        }
         [newFrame _setRenderFramePart: frame];
+        
+        newDataSource = WCIFWebDataSourceMake(childURL);
+        [newDataSource _setParent: oldDataSource];
+        [newFrame setProvisionalDataSource: newDataSource];
     
-        if ([controller _changeLocationTo: childURL forFrame: newFrame parent: dataSource]){            
-            [[newFrame dataSource] startLoading: YES];
-        }
+        [newFrame startLoading];
     }
 
 #ifdef _SUPPORT_JAVASCRIPT_URL_    
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.mm b/WebCore/kwq/KWQKHTMLPartImpl.mm
index 8d39f40..92ecfee 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.mm
+++ b/WebCore/kwq/KWQKHTMLPartImpl.mm
@@ -58,74 +58,18 @@
 #import <KWQView.h>
 
 #include <WCLoadProgress.h>
+#include <WCWebDataSource.h>
 
- at class IFWebDataSource;
- at class IFWebView;
- at class IFWebFrame;
- at class IFError;
-
- at protocol IFWebController
-- (IFWebFrame *)createFrameNamed: (NSString *)name for: (IFWebDataSource *)dataSource inParent: (IFWebDataSource *)dataSource;
-- (BOOL)locationWillChangeTo: (NSURL *)url forFrame: (IFWebFrame *)frame;
-- (BOOL)_changeLocationTo: (NSURL *)url forFrame: (IFWebFrame *)frame parent: (IFWebDataSource *)parent;
-- (void)locationChangeStartedForFrame: (IFWebFrame *)frame;
-- (void)locationChangeDone: (IFError *)error forFrame: (IFWebFrame *)frame;
- at end
-
- at protocol IFLocationChangeHandler
-- (void)locationChangeDone: (IFError *)error forDataSource: (IFWebDataSource *)dataSource;
- at end
-
- at interface IFWebDataSource : NSObject
-- initWithURL: (NSURL *)url;
-- (void)setFrame: (IFWebFrame *)fName;
-- (IFWebFrame *)frame;
-- (id <IFWebController>)controller;
-- (void)startLoading: (BOOL)forceRefresh;
-- (void)_startLoading: (BOOL)forceRefresh initiatedByUserEvent: (BOOL)byUserEvent;
-- frameNamed: (NSString *)f;
-- (void)_setParent: (IFWebDataSource *)p;
-- (IFWebDataSource *)parent;
- at end
-
-// This should not be allowed here.  data source should not reference view
-// API.
- at interface IFWebView: NSObject
-- (QWidget *)_widget;
- at end
-
- at interface IFWebFrame: NSObject
-- initWithName: (NSString *)n view: v dataSource: (IFWebDataSource *)d;
-- view;
-- (IFWebDataSource *)dataSource;
-- (void)_setRenderFramePart: (void *)p;
-- (void *)_renderFramePart;
- at end
+#include <external.h>
 
-typedef enum {
-    IF_LOAD_TYPE_CSS    = 1,
-    IF_LOAD_TYPE_IMAGE  = 2,
-    IF_LOAD_TYPE_SCRIPT = 3,
-    IF_LOAD_TYPE_HTML   = 4
-} IF_LOAD_TYPE;
 
+WCIFWebDataSourceMakeFunc WCIFWebDataSourceMake;
 
- at interface IFLoadProgress : NSObject
+void WCSetIFWebDataSourceMakeFunc(WCIFWebDataSourceMakeFunc func)
 {
-    int bytesSoFar;	// 0 if this is the start of load
-    int totalToLoad;	// -1 if this is not known.
-                        // bytesSoFar == totalLoaded when complete
-    IF_LOAD_TYPE type;	// load types, either image, css, or jscript
+    WCIFWebDataSourceMake = func;
 }
-- init;
- at end
-
- at protocol  IFLoadHandler
-- (void)receivedProgress: (IFLoadProgress *)progress forResource: (NSString *)resourceDescription fromDataSource: (IFWebDataSource *)dataSource;
-
-- (void)receivedError: (IFError *)error forResource: (NSString *)resourceDescription partialProgress: (IFLoadProgress *)progress fromDataSource: (IFWebDataSource *)dataSource;
 
- at end
 
 static bool cache_init = false;
 
@@ -172,7 +116,7 @@ static void recursive(const DOM::Node &pNode, const DOM::Node &node)
     
     userData = [[[sender attributes] objectForKey:IFURLHandleUserData] pointerValue];
     
-    KWQDEBUGLEVEL1 (0x2000, "userData = 0x%08x\n", userData);
+    KWQDEBUGLEVEL1 (0x2000, "url = %s\n", [[[sender url] absoluteString] cString]);
 }
 
 - (void)IFURLHandleResourceDidCancelLoading:(IFURLHandle *)sender
@@ -181,7 +125,7 @@ static void recursive(const DOM::Node &pNode, const DOM::Node &node)
     
     userData = [[[sender attributes] objectForKey:IFURLHandleUserData] pointerValue];
 
-    KWQDEBUGLEVEL1 (0x2000, "userData = 0x%08x\n", userData);
+    KWQDEBUGLEVEL1 (0x2000, "url = %s\n", [[[sender url] absoluteString] cString]);
     [sender autorelease];
 }
 
@@ -191,7 +135,7 @@ static void recursive(const DOM::Node &pNode, const DOM::Node &node)
     
     userData = [[[sender attributes] objectForKey:IFURLHandleUserData] pointerValue];
 
-    KWQDEBUGLEVEL1 (0x2000, "userData = 0x%08x\n", userData);
+    KWQDEBUGLEVEL1 (0x2000, "url = %s\n", [[[sender url] absoluteString] cString]);
     m_part->closeURL();
 
     IFLoadProgress *loadProgress = WCIFLoadProgressMake();
@@ -208,7 +152,7 @@ static void recursive(const DOM::Node &pNode, const DOM::Node &node)
     
     userData = [[[sender attributes] objectForKey:IFURLHandleUserData] pointerValue];
 
-    KWQDEBUGLEVEL3 (0x2000, "userData = 0x%08x, data = 0x%08x, length %d\n", userData, data, [data length]);
+    KWQDEBUGLEVEL3 (0x2000, "url = %s, data = 0x%08x, length %d\n", [[[sender url] absoluteString] cString], data, [data length]);
     if (!m_data) {
         m_data = [data retain];
     }
@@ -226,7 +170,7 @@ static void recursive(const DOM::Node &pNode, const DOM::Node &node)
     
     userData = [[[sender attributes] objectForKey:IFURLHandleUserData] pointerValue];
 
-    KWQDEBUGLEVEL2 (0x2000, "result = %d, userData = 0x%08x\n", result, userData);
+    KWQDEBUGLEVEL2 (0x2000, "url = %s, result = %d\n", [[[sender url] absoluteString] cString], result);
     [sender autorelease];
 }
 
@@ -1392,35 +1336,20 @@ void KHTMLPart::khtmlMouseReleaseEvent( khtml::MouseReleaseEvent *event )
 
     // HACK!  FIXME!
     if (d->m_strSelectedURL != QString::null) {
-        IFWebDataSource *dataSource;
-        id <IFWebController>controller;
+        IFWebDataSource *oldDataSource, *newDataSource;
         KURL clickedURL(completeURL( splitUrlTarget(d->m_strSelectedURL)));
         NSString *urlString = [NSString stringWithCString:clickedURL.url().latin1()];
         NSURL *url = [NSURL URLWithString: urlString];
         IFWebFrame *frame;
         
-        dataSource = getDataSource();
-        frame = [dataSource frame];
-        controller = [dataSource controller];
+        oldDataSource = getDataSource();
+        frame = [oldDataSource frame];
         
-        if ([controller _changeLocationTo: url forFrame: frame parent: [[frame dataSource] parent]]){
-            [[frame dataSource] _startLoading: YES initiatedByUserEvent: YES];
-        }
-
-/*
-        id nsview = ((IFWebView *)((QWidget *)view())->getView());
+        newDataSource = WCIFWebDataSourceMake(url);
+        [newDataSource _setParent: [oldDataSource parent]];
         
-        //if ([nsview isKindOfClass: NSClassFromString(@"IFDynamicScrollBarsView")])
-        if ([nsview isKindOfClass: NSClassFromString(@"NSScrollView")])
-            nsview = [nsview documentView];
-        [nsview _resetView];
-        openURL (clickedURL);
-        // [kocienda]: shield your eyes!
-        // this hack is to get link clicks to show up in the history list of the test app
-        // this should be removed and replaced by something better
-        NSString *urlString = [NSString stringWithCString:clickedURL.url().latin1()];
-        [[NSNotificationCenter defaultCenter] postNotificationName:@"uri-click" object:urlString];
-*/
+        [frame setProvisionalDataSource: newDataSource];
+        [frame startLoading];
     }
     
 #ifndef _KWQ_
@@ -1718,19 +1647,19 @@ void KHTMLPart::submitForm( const char *action, const QString &url, const QByteA
   else
     emit d->m_extension->openURLRequest( u, args );
 #endif
-
+    IFWebDataSource *oldDataSource, *newDataSource;
     NSString *urlString = [NSString stringWithCString:u.url().latin1()];
     NSURL *qurl = [NSURL URLWithString: urlString];
     IFWebFrame *frame;
-    id <IFWebController>controller;
     
-    dataSource = getDataSource();
-    frame = [dataSource frame];
-    controller = [dataSource controller];
+    oldDataSource = getDataSource();
+    frame = [oldDataSource frame];
     
-    if ([controller _changeLocationTo: qurl forFrame: frame parent: [[frame dataSource] parent]]){
-        [[frame dataSource] _startLoading: YES initiatedByUserEvent: YES];
-    }
+    newDataSource = WCIFWebDataSourceMake(qurl);
+    [newDataSource _setParent: [oldDataSource parent]];
+    
+    [frame setProvisionalDataSource: newDataSource];
+    [frame startLoading];
 
 }
 
@@ -1746,32 +1675,43 @@ bool KHTMLPart::requestFrame( khtml::RenderPart *frame, const QString &url, cons
     IFWebFrame *aFrame;
     IFWebDataSource *dataSource;
     
-    //fprintf (stdout, "0x%08x requestFrame():  part = 0x%08x, name = %s, url = %s\n", (unsigned int)this, (unsigned int)frame, frameName.latin1(), url.latin1());    
+    fprintf (stdout, "0x%08x requestFrame():  part = 0x%08x, name = %s, url = %s\n", (unsigned int)this, (unsigned int)frame, frameName.latin1(), url.latin1());    
     dataSource = getDataSource();
 
     aFrame =[dataSource frameNamed: nsframeName];
     if (aFrame){
-        //fprintf (stdout, "0x%08x requestFrame():  part = 0x%08x frame found\n", (unsigned int)this, (unsigned int)frame);    
+        fprintf (stdout, "0x%08x requestFrame():  frame found part = 0x%08x\n", (unsigned int)this, (unsigned int)frame);    
+        fprintf (stdout, "0x%08x requestFrame():  frame found _widget = 0x%08x\n", (unsigned int)this, (unsigned int)[[aFrame view] _widget]);    
+        fprintf (stdout, "0x%08x requestFrame():  frame found _provisionalWidget = 0x%08x\n", (unsigned int)this, (unsigned int)[[aFrame view] _provisionalWidget]);    
         // ?
-        frame->setWidget ([[aFrame view] _widget]);
+        if ([[aFrame view] _provisionalWidget])
+            frame->setWidget ([[aFrame view] _provisionalWidget]);
+        else
+            frame->setWidget ([[aFrame view] _widget]);
     }
     else {        
-        IFWebDataSource *dataSource;
+        IFWebDataSource *oldDataSource, *newDataSource;
         NSURL *childURL;
         IFWebFrame *newFrame;
         id <IFWebController> controller;
 
-        //fprintf (stdout, "0x%08x requestFrame():  part = 0x%08x creating frame\n", (unsigned int)this, (unsigned int)frame);    
+        fprintf (stdout, "0x%08x requestFrame():  part = 0x%08x creating frame\n", (unsigned int)this, (unsigned int)frame);    
         childURL = [NSURL URLWithString: QSTRING_TO_NSSTRING (completeURL( url ).url() )];
         
-        dataSource = getDataSource();
-        controller = [dataSource controller];
-        newFrame = [controller createFrameNamed: nsframeName for: nil inParent: dataSource];
+        oldDataSource = getDataSource();
+        controller = [oldDataSource controller];
+        newFrame = [controller createFrameNamed: nsframeName for: nil inParent: oldDataSource];
+        if (newFrame == nil){
+            // Controller return NO to location change, now what?
+            return false;
+        }
         [newFrame _setRenderFramePart: frame];
+        
+        newDataSource = WCIFWebDataSourceMake(childURL);
+        [newDataSource _setParent: oldDataSource];
+        [newFrame setProvisionalDataSource: newDataSource];
     
-        if ([controller _changeLocationTo: childURL forFrame: newFrame parent: dataSource]){            
-            [[newFrame dataSource] startLoading: YES];
-        }
+        [newFrame startLoading];
     }
 
 #ifdef _SUPPORT_JAVASCRIPT_URL_    
diff --git a/WebCore/kwq/external.h b/WebCore/kwq/external.h
new file mode 100644
index 0000000..cadbdca
--- /dev/null
+++ b/WebCore/kwq/external.h
@@ -0,0 +1,97 @@
+/*
+ * Copyright (C) 2001 Apple Computer, Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+ 
+#ifndef _EXTERNAL_H
+#define _EXTERNAL_H_
+
+ at class IFWebDataSource;
+ at class IFWebView;
+ at class IFWebFrame;
+ at class IFError;
+
+ at protocol IFWebController
+- (IFWebFrame *)createFrameNamed: (NSString *)name for: (IFWebDataSource *)dataSource inParent: (IFWebDataSource *)dataSource;
+- (BOOL)locationWillChangeTo: (NSURL *)url forFrame: (IFWebFrame *)frame;
+- (void)locationChangeStartedForFrame: (IFWebFrame *)frame;
+- (void)locationChangeDone: (IFError *)error forFrame: (IFWebFrame *)frame;
+ at end
+
+ at protocol IFLocationChangeHandler
+- (void)locationChangeDone: (IFError *)error forDataSource: (IFWebDataSource *)dataSource;
+ at end
+
+ at interface IFWebDataSource : NSObject
+- initWithURL: (NSURL *)url;
+- (void)setFrame: (IFWebFrame *)fName;
+- (IFWebFrame *)frame;
+- (id <IFWebController>)controller;
+- frameNamed: (NSString *)f;
+- (void)_setParent: (IFWebDataSource *)p;
+- (IFWebDataSource *)parent;
+ at end
+
+// This should not be allowed here.  data source should not reference view
+// API.
+ at interface IFWebView: NSObject
+- (QWidget *)_widget;
+- (QWidget *)_provisionalWidget;
+ at end
+
+ at interface IFWebFrame: NSObject
+- initWithName: (NSString *)n view: v dataSource: (IFWebDataSource *)d;
+- view;
+- (IFWebDataSource *)dataSource;
+- (void)setProvisionalDataSource: (IFWebDataSource *)ds;
+- (void)_setRenderFramePart: (void *)p;
+- (void *)_renderFramePart;
+- (void)startLoading;
+ at end
+
+typedef enum {
+    IF_LOAD_TYPE_CSS    = 1,
+    IF_LOAD_TYPE_IMAGE  = 2,
+    IF_LOAD_TYPE_SCRIPT = 3,
+    IF_LOAD_TYPE_HTML   = 4
+} IF_LOAD_TYPE;
+
+
+ at interface IFLoadProgress : NSObject
+{
+    int bytesSoFar;	// 0 if this is the start of load
+    int totalToLoad;	// -1 if this is not known.
+                        // bytesSoFar == totalLoaded when complete
+    IF_LOAD_TYPE type;	// load types, either image, css, or jscript
+}
+- init;
+ at end
+
+ at protocol  IFLoadHandler
+- (void)receivedProgress: (IFLoadProgress *)progress forResource: (NSString *)resourceDescription fromDataSource: (IFWebDataSource *)dataSource;
+
+- (void)receivedError: (IFError *)error forResource: (NSString *)resourceDescription partialProgress: (IFLoadProgress *)progress fromDataSource: (IFWebDataSource *)dataSource;
+
+ at end
+
+#endif
diff --git a/WebCore/src/kwq/KWQKHTMLPart.mm b/WebCore/src/kwq/KWQKHTMLPart.mm
index 8d39f40..92ecfee 100644
--- a/WebCore/src/kwq/KWQKHTMLPart.mm
+++ b/WebCore/src/kwq/KWQKHTMLPart.mm
@@ -58,74 +58,18 @@
 #import <KWQView.h>
 
 #include <WCLoadProgress.h>
+#include <WCWebDataSource.h>
 
- at class IFWebDataSource;
- at class IFWebView;
- at class IFWebFrame;
- at class IFError;
-
- at protocol IFWebController
-- (IFWebFrame *)createFrameNamed: (NSString *)name for: (IFWebDataSource *)dataSource inParent: (IFWebDataSource *)dataSource;
-- (BOOL)locationWillChangeTo: (NSURL *)url forFrame: (IFWebFrame *)frame;
-- (BOOL)_changeLocationTo: (NSURL *)url forFrame: (IFWebFrame *)frame parent: (IFWebDataSource *)parent;
-- (void)locationChangeStartedForFrame: (IFWebFrame *)frame;
-- (void)locationChangeDone: (IFError *)error forFrame: (IFWebFrame *)frame;
- at end
-
- at protocol IFLocationChangeHandler
-- (void)locationChangeDone: (IFError *)error forDataSource: (IFWebDataSource *)dataSource;
- at end
-
- at interface IFWebDataSource : NSObject
-- initWithURL: (NSURL *)url;
-- (void)setFrame: (IFWebFrame *)fName;
-- (IFWebFrame *)frame;
-- (id <IFWebController>)controller;
-- (void)startLoading: (BOOL)forceRefresh;
-- (void)_startLoading: (BOOL)forceRefresh initiatedByUserEvent: (BOOL)byUserEvent;
-- frameNamed: (NSString *)f;
-- (void)_setParent: (IFWebDataSource *)p;
-- (IFWebDataSource *)parent;
- at end
-
-// This should not be allowed here.  data source should not reference view
-// API.
- at interface IFWebView: NSObject
-- (QWidget *)_widget;
- at end
-
- at interface IFWebFrame: NSObject
-- initWithName: (NSString *)n view: v dataSource: (IFWebDataSource *)d;
-- view;
-- (IFWebDataSource *)dataSource;
-- (void)_setRenderFramePart: (void *)p;
-- (void *)_renderFramePart;
- at end
+#include <external.h>
 
-typedef enum {
-    IF_LOAD_TYPE_CSS    = 1,
-    IF_LOAD_TYPE_IMAGE  = 2,
-    IF_LOAD_TYPE_SCRIPT = 3,
-    IF_LOAD_TYPE_HTML   = 4
-} IF_LOAD_TYPE;
 
+WCIFWebDataSourceMakeFunc WCIFWebDataSourceMake;
 
- at interface IFLoadProgress : NSObject
+void WCSetIFWebDataSourceMakeFunc(WCIFWebDataSourceMakeFunc func)
 {
-    int bytesSoFar;	// 0 if this is the start of load
-    int totalToLoad;	// -1 if this is not known.
-                        // bytesSoFar == totalLoaded when complete
-    IF_LOAD_TYPE type;	// load types, either image, css, or jscript
+    WCIFWebDataSourceMake = func;
 }
-- init;
- at end
-
- at protocol  IFLoadHandler
-- (void)receivedProgress: (IFLoadProgress *)progress forResource: (NSString *)resourceDescription fromDataSource: (IFWebDataSource *)dataSource;
-
-- (void)receivedError: (IFError *)error forResource: (NSString *)resourceDescription partialProgress: (IFLoadProgress *)progress fromDataSource: (IFWebDataSource *)dataSource;
 
- at end
 
 static bool cache_init = false;
 
@@ -172,7 +116,7 @@ static void recursive(const DOM::Node &pNode, const DOM::Node &node)
     
     userData = [[[sender attributes] objectForKey:IFURLHandleUserData] pointerValue];
     
-    KWQDEBUGLEVEL1 (0x2000, "userData = 0x%08x\n", userData);
+    KWQDEBUGLEVEL1 (0x2000, "url = %s\n", [[[sender url] absoluteString] cString]);
 }
 
 - (void)IFURLHandleResourceDidCancelLoading:(IFURLHandle *)sender
@@ -181,7 +125,7 @@ static void recursive(const DOM::Node &pNode, const DOM::Node &node)
     
     userData = [[[sender attributes] objectForKey:IFURLHandleUserData] pointerValue];
 
-    KWQDEBUGLEVEL1 (0x2000, "userData = 0x%08x\n", userData);
+    KWQDEBUGLEVEL1 (0x2000, "url = %s\n", [[[sender url] absoluteString] cString]);
     [sender autorelease];
 }
 
@@ -191,7 +135,7 @@ static void recursive(const DOM::Node &pNode, const DOM::Node &node)
     
     userData = [[[sender attributes] objectForKey:IFURLHandleUserData] pointerValue];
 
-    KWQDEBUGLEVEL1 (0x2000, "userData = 0x%08x\n", userData);
+    KWQDEBUGLEVEL1 (0x2000, "url = %s\n", [[[sender url] absoluteString] cString]);
     m_part->closeURL();
 
     IFLoadProgress *loadProgress = WCIFLoadProgressMake();
@@ -208,7 +152,7 @@ static void recursive(const DOM::Node &pNode, const DOM::Node &node)
     
     userData = [[[sender attributes] objectForKey:IFURLHandleUserData] pointerValue];
 
-    KWQDEBUGLEVEL3 (0x2000, "userData = 0x%08x, data = 0x%08x, length %d\n", userData, data, [data length]);
+    KWQDEBUGLEVEL3 (0x2000, "url = %s, data = 0x%08x, length %d\n", [[[sender url] absoluteString] cString], data, [data length]);
     if (!m_data) {
         m_data = [data retain];
     }
@@ -226,7 +170,7 @@ static void recursive(const DOM::Node &pNode, const DOM::Node &node)
     
     userData = [[[sender attributes] objectForKey:IFURLHandleUserData] pointerValue];
 
-    KWQDEBUGLEVEL2 (0x2000, "result = %d, userData = 0x%08x\n", result, userData);
+    KWQDEBUGLEVEL2 (0x2000, "url = %s, result = %d\n", [[[sender url] absoluteString] cString], result);
     [sender autorelease];
 }
 
@@ -1392,35 +1336,20 @@ void KHTMLPart::khtmlMouseReleaseEvent( khtml::MouseReleaseEvent *event )
 
     // HACK!  FIXME!
     if (d->m_strSelectedURL != QString::null) {
-        IFWebDataSource *dataSource;
-        id <IFWebController>controller;
+        IFWebDataSource *oldDataSource, *newDataSource;
         KURL clickedURL(completeURL( splitUrlTarget(d->m_strSelectedURL)));
         NSString *urlString = [NSString stringWithCString:clickedURL.url().latin1()];
         NSURL *url = [NSURL URLWithString: urlString];
         IFWebFrame *frame;
         
-        dataSource = getDataSource();
-        frame = [dataSource frame];
-        controller = [dataSource controller];
+        oldDataSource = getDataSource();
+        frame = [oldDataSource frame];
         
-        if ([controller _changeLocationTo: url forFrame: frame parent: [[frame dataSource] parent]]){
-            [[frame dataSource] _startLoading: YES initiatedByUserEvent: YES];
-        }
-
-/*
-        id nsview = ((IFWebView *)((QWidget *)view())->getView());
+        newDataSource = WCIFWebDataSourceMake(url);
+        [newDataSource _setParent: [oldDataSource parent]];
         
-        //if ([nsview isKindOfClass: NSClassFromString(@"IFDynamicScrollBarsView")])
-        if ([nsview isKindOfClass: NSClassFromString(@"NSScrollView")])
-            nsview = [nsview documentView];
-        [nsview _resetView];
-        openURL (clickedURL);
-        // [kocienda]: shield your eyes!
-        // this hack is to get link clicks to show up in the history list of the test app
-        // this should be removed and replaced by something better
-        NSString *urlString = [NSString stringWithCString:clickedURL.url().latin1()];
-        [[NSNotificationCenter defaultCenter] postNotificationName:@"uri-click" object:urlString];
-*/
+        [frame setProvisionalDataSource: newDataSource];
+        [frame startLoading];
     }
     
 #ifndef _KWQ_
@@ -1718,19 +1647,19 @@ void KHTMLPart::submitForm( const char *action, const QString &url, const QByteA
   else
     emit d->m_extension->openURLRequest( u, args );
 #endif
-
+    IFWebDataSource *oldDataSource, *newDataSource;
     NSString *urlString = [NSString stringWithCString:u.url().latin1()];
     NSURL *qurl = [NSURL URLWithString: urlString];
     IFWebFrame *frame;
-    id <IFWebController>controller;
     
-    dataSource = getDataSource();
-    frame = [dataSource frame];
-    controller = [dataSource controller];
+    oldDataSource = getDataSource();
+    frame = [oldDataSource frame];
     
-    if ([controller _changeLocationTo: qurl forFrame: frame parent: [[frame dataSource] parent]]){
-        [[frame dataSource] _startLoading: YES initiatedByUserEvent: YES];
-    }
+    newDataSource = WCIFWebDataSourceMake(qurl);
+    [newDataSource _setParent: [oldDataSource parent]];
+    
+    [frame setProvisionalDataSource: newDataSource];
+    [frame startLoading];
 
 }
 
@@ -1746,32 +1675,43 @@ bool KHTMLPart::requestFrame( khtml::RenderPart *frame, const QString &url, cons
     IFWebFrame *aFrame;
     IFWebDataSource *dataSource;
     
-    //fprintf (stdout, "0x%08x requestFrame():  part = 0x%08x, name = %s, url = %s\n", (unsigned int)this, (unsigned int)frame, frameName.latin1(), url.latin1());    
+    fprintf (stdout, "0x%08x requestFrame():  part = 0x%08x, name = %s, url = %s\n", (unsigned int)this, (unsigned int)frame, frameName.latin1(), url.latin1());    
     dataSource = getDataSource();
 
     aFrame =[dataSource frameNamed: nsframeName];
     if (aFrame){
-        //fprintf (stdout, "0x%08x requestFrame():  part = 0x%08x frame found\n", (unsigned int)this, (unsigned int)frame);    
+        fprintf (stdout, "0x%08x requestFrame():  frame found part = 0x%08x\n", (unsigned int)this, (unsigned int)frame);    
+        fprintf (stdout, "0x%08x requestFrame():  frame found _widget = 0x%08x\n", (unsigned int)this, (unsigned int)[[aFrame view] _widget]);    
+        fprintf (stdout, "0x%08x requestFrame():  frame found _provisionalWidget = 0x%08x\n", (unsigned int)this, (unsigned int)[[aFrame view] _provisionalWidget]);    
         // ?
-        frame->setWidget ([[aFrame view] _widget]);
+        if ([[aFrame view] _provisionalWidget])
+            frame->setWidget ([[aFrame view] _provisionalWidget]);
+        else
+            frame->setWidget ([[aFrame view] _widget]);
     }
     else {        
-        IFWebDataSource *dataSource;
+        IFWebDataSource *oldDataSource, *newDataSource;
         NSURL *childURL;
         IFWebFrame *newFrame;
         id <IFWebController> controller;
 
-        //fprintf (stdout, "0x%08x requestFrame():  part = 0x%08x creating frame\n", (unsigned int)this, (unsigned int)frame);    
+        fprintf (stdout, "0x%08x requestFrame():  part = 0x%08x creating frame\n", (unsigned int)this, (unsigned int)frame);    
         childURL = [NSURL URLWithString: QSTRING_TO_NSSTRING (completeURL( url ).url() )];
         
-        dataSource = getDataSource();
-        controller = [dataSource controller];
-        newFrame = [controller createFrameNamed: nsframeName for: nil inParent: dataSource];
+        oldDataSource = getDataSource();
+        controller = [oldDataSource controller];
+        newFrame = [controller createFrameNamed: nsframeName for: nil inParent: oldDataSource];
+        if (newFrame == nil){
+            // Controller return NO to location change, now what?
+            return false;
+        }
         [newFrame _setRenderFramePart: frame];
+        
+        newDataSource = WCIFWebDataSourceMake(childURL);
+        [newDataSource _setParent: oldDataSource];
+        [newFrame setProvisionalDataSource: newDataSource];
     
-        if ([controller _changeLocationTo: childURL forFrame: newFrame parent: dataSource]){            
-            [[newFrame dataSource] startLoading: YES];
-        }
+        [newFrame startLoading];
     }
 
 #ifdef _SUPPORT_JAVASCRIPT_URL_    
diff --git a/WebCore/src/kwq/external.h b/WebCore/src/kwq/external.h
new file mode 100644
index 0000000..cadbdca
--- /dev/null
+++ b/WebCore/src/kwq/external.h
@@ -0,0 +1,97 @@
+/*
+ * Copyright (C) 2001 Apple Computer, Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+ 
+#ifndef _EXTERNAL_H
+#define _EXTERNAL_H_
+
+ at class IFWebDataSource;
+ at class IFWebView;
+ at class IFWebFrame;
+ at class IFError;
+
+ at protocol IFWebController
+- (IFWebFrame *)createFrameNamed: (NSString *)name for: (IFWebDataSource *)dataSource inParent: (IFWebDataSource *)dataSource;
+- (BOOL)locationWillChangeTo: (NSURL *)url forFrame: (IFWebFrame *)frame;
+- (void)locationChangeStartedForFrame: (IFWebFrame *)frame;
+- (void)locationChangeDone: (IFError *)error forFrame: (IFWebFrame *)frame;
+ at end
+
+ at protocol IFLocationChangeHandler
+- (void)locationChangeDone: (IFError *)error forDataSource: (IFWebDataSource *)dataSource;
+ at end
+
+ at interface IFWebDataSource : NSObject
+- initWithURL: (NSURL *)url;
+- (void)setFrame: (IFWebFrame *)fName;
+- (IFWebFrame *)frame;
+- (id <IFWebController>)controller;
+- frameNamed: (NSString *)f;
+- (void)_setParent: (IFWebDataSource *)p;
+- (IFWebDataSource *)parent;
+ at end
+
+// This should not be allowed here.  data source should not reference view
+// API.
+ at interface IFWebView: NSObject
+- (QWidget *)_widget;
+- (QWidget *)_provisionalWidget;
+ at end
+
+ at interface IFWebFrame: NSObject
+- initWithName: (NSString *)n view: v dataSource: (IFWebDataSource *)d;
+- view;
+- (IFWebDataSource *)dataSource;
+- (void)setProvisionalDataSource: (IFWebDataSource *)ds;
+- (void)_setRenderFramePart: (void *)p;
+- (void *)_renderFramePart;
+- (void)startLoading;
+ at end
+
+typedef enum {
+    IF_LOAD_TYPE_CSS    = 1,
+    IF_LOAD_TYPE_IMAGE  = 2,
+    IF_LOAD_TYPE_SCRIPT = 3,
+    IF_LOAD_TYPE_HTML   = 4
+} IF_LOAD_TYPE;
+
+
+ at interface IFLoadProgress : NSObject
+{
+    int bytesSoFar;	// 0 if this is the start of load
+    int totalToLoad;	// -1 if this is not known.
+                        // bytesSoFar == totalLoaded when complete
+    IF_LOAD_TYPE type;	// load types, either image, css, or jscript
+}
+- init;
+ at end
+
+ at protocol  IFLoadHandler
+- (void)receivedProgress: (IFLoadProgress *)progress forResource: (NSString *)resourceDescription fromDataSource: (IFWebDataSource *)dataSource;
+
+- (void)receivedError: (IFError *)error forResource: (NSString *)resourceDescription partialProgress: (IFLoadProgress *)progress fromDataSource: (IFWebDataSource *)dataSource;
+
+ at end
+
+#endif
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index b58295f..328973b 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,40 @@
+2002-03-04  Richard Williamson  <rjw at apple.com>
+
+        Changes to support 'provisional' data sources.
+        API changes to IFBaseWebController, removed redundant methods.
+ 
+        * Misc.subproj/WebKitDebug.h:
+	* Plugins.subproj/IFPluginView.mm: (-[IFPluginView
+	getURLNotify:target:notifyData:]):
+	* WebView.subproj/IFBaseWebController.h:
+	* WebView.subproj/IFBaseWebController.mm: (-[IFBaseWebController init]),
+	(-[IFBaseWebController initWithView:provisionalDataSource:]),
+	(-[IFBaseWebController createFrameNamed:for:inParent:]), (-[IFBaseWebController
+	receivedProgress:forResource:fromDataSource:]), (-[IFBaseWebController
+	receivedError:forResource:partialProgress:fromDataSource:]),
+	(-[IFBaseWebController locationChangeCommittedForFrame:]), (-[IFBaseWebController
+	_frameForDataSource:fromFrame:]), (-[IFBaseWebController mainFrame]):
+	* WebView.subproj/IFBaseWebControllerPrivate.h:
+	* WebView.subproj/IFBaseWebControllerPrivate.mm:
+	* WebView.subproj/IFWebController.h:
+	* WebView.subproj/IFWebDataSource.mm: (IFWebDataSourceMake), (+[IFWebDataSource
+	load]):
+	* WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSource
+	_startLoading:initiatedByUserEvent:]):
+	* WebView.subproj/IFWebFrame.h:
+	* WebView.subproj/IFWebFrame.mm: (-[IFWebFrame init]), (-[IFWebFrame
+	initWithName:view:provisionalDataSource:controller:]), (-[IFWebFrame
+	setProvisionalDataSource:]), (-[IFWebFrame startLoading]), (-[IFWebFrame
+	stopLoading]), (-[IFWebFrame reload:]):
+	* WebView.subproj/IFWebFramePrivate.h:
+	* WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _setDataSource:]),
+	(-[IFWebFrame _transitionProvisionalToCommitted]):
+	* WebView.subproj/IFWebView.h:
+	* WebView.subproj/IFWebView.mm: (-[IFWebView provisionalDataSourceChanged:]),
+	(-[IFWebView dataSourceChanged:]):
+	* WebView.subproj/IFWebViewPrivate.h:
+	* WebView.subproj/IFWebViewPrivate.mm: (-[IFWebView _provisionalWidget]):
+
 2002-03-04  John Sullivan  <sullivan at apple.com>
 
 	Changed default fonts.
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index b58295f..328973b 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,40 @@
+2002-03-04  Richard Williamson  <rjw at apple.com>
+
+        Changes to support 'provisional' data sources.
+        API changes to IFBaseWebController, removed redundant methods.
+ 
+        * Misc.subproj/WebKitDebug.h:
+	* Plugins.subproj/IFPluginView.mm: (-[IFPluginView
+	getURLNotify:target:notifyData:]):
+	* WebView.subproj/IFBaseWebController.h:
+	* WebView.subproj/IFBaseWebController.mm: (-[IFBaseWebController init]),
+	(-[IFBaseWebController initWithView:provisionalDataSource:]),
+	(-[IFBaseWebController createFrameNamed:for:inParent:]), (-[IFBaseWebController
+	receivedProgress:forResource:fromDataSource:]), (-[IFBaseWebController
+	receivedError:forResource:partialProgress:fromDataSource:]),
+	(-[IFBaseWebController locationChangeCommittedForFrame:]), (-[IFBaseWebController
+	_frameForDataSource:fromFrame:]), (-[IFBaseWebController mainFrame]):
+	* WebView.subproj/IFBaseWebControllerPrivate.h:
+	* WebView.subproj/IFBaseWebControllerPrivate.mm:
+	* WebView.subproj/IFWebController.h:
+	* WebView.subproj/IFWebDataSource.mm: (IFWebDataSourceMake), (+[IFWebDataSource
+	load]):
+	* WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSource
+	_startLoading:initiatedByUserEvent:]):
+	* WebView.subproj/IFWebFrame.h:
+	* WebView.subproj/IFWebFrame.mm: (-[IFWebFrame init]), (-[IFWebFrame
+	initWithName:view:provisionalDataSource:controller:]), (-[IFWebFrame
+	setProvisionalDataSource:]), (-[IFWebFrame startLoading]), (-[IFWebFrame
+	stopLoading]), (-[IFWebFrame reload:]):
+	* WebView.subproj/IFWebFramePrivate.h:
+	* WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _setDataSource:]),
+	(-[IFWebFrame _transitionProvisionalToCommitted]):
+	* WebView.subproj/IFWebView.h:
+	* WebView.subproj/IFWebView.mm: (-[IFWebView provisionalDataSourceChanged:]),
+	(-[IFWebView dataSourceChanged:]):
+	* WebView.subproj/IFWebViewPrivate.h:
+	* WebView.subproj/IFWebViewPrivate.mm: (-[IFWebView _provisionalWidget]):
+
 2002-03-04  John Sullivan  <sullivan at apple.com>
 
 	Changed default fonts.
diff --git a/WebKit/Misc.subproj/WebKitDebug.h b/WebKit/Misc.subproj/WebKitDebug.h
index 4e9f2cb..35bad64 100644
--- a/WebKit/Misc.subproj/WebKitDebug.h
+++ b/WebKit/Misc.subproj/WebKitDebug.h
@@ -84,7 +84,7 @@ void WebKitLogAtLevel(unsigned int level, NSString *format, ...);
 #define WEBKIT_ASSERT(expr) \
     do { \
         if (!(expr)) { \
-            NSString *reason = [NSString stringWithFormat:@"assertion failed: '%s'", #expr]; \
+            NSString *reason = [NSString stringWithFormat:@"assertion failed(%s:%d %s): '%s'", __FILE__, __LINE__, __FUNCTION__, #expr]; \
             [[NSException exceptionWithName:NSGenericException reason:reason userInfo: nil] raise]; \
         } \
     } while (0)
@@ -92,7 +92,7 @@ void WebKitLogAtLevel(unsigned int level, NSString *format, ...);
 #define WEBKIT_ASSERT_VALID_ARG(arg,expr) \
     do { \
         if (!(expr)) { \
-            NSString *reason = [NSString stringWithFormat:@"'%s' fails check: '%s'", #arg, #expr]; \
+            NSString *reason = [NSString stringWithFormat:@"(%s:%d %s): '%s' fails check: '%s'", __FILE__, __LINE__, __FUNCTION__, #arg, #expr]; \
             [[NSException exceptionWithName:NSInvalidArgumentException reason:reason userInfo: nil] raise]; \
         } \
     } while (0)
@@ -100,7 +100,7 @@ void WebKitLogAtLevel(unsigned int level, NSString *format, ...);
 #define WEBKIT_ASSERT_NOT_NIL(arg) \
     do { \
         if ((arg) == nil) { \
-            NSString *reason = [NSString stringWithFormat:@"'%s' is nil", #arg]; \
+            NSString *reason = [NSString stringWithFormat:@"(%s:%d %s): '%s' is nil", __FILE__, __LINE__, __FUNCTION__, #arg]; \
             [[NSException exceptionWithName:NSInvalidArgumentException reason:reason userInfo: nil] raise]; \
         } \
     } while (0)
diff --git a/WebKit/Plugins.subproj/IFPluginView.mm b/WebKit/Plugins.subproj/IFPluginView.mm
index 30fc84b..99fd5a1 100644
--- a/WebKit/Plugins.subproj/IFPluginView.mm
+++ b/WebKit/Plugins.subproj/IFPluginView.mm
@@ -528,8 +528,8 @@ static id IFPluginMake(NSRect rect, WCPlugin *plugin, NSString *url, NSString *m
         dataSource = [[[IFWebDataSource alloc] initWithURL:newURL] autorelease];
         webView = [self findSuperview:@"IFWebView"];
         webController = [webView controller];
-        [webController setMainDataSource:dataSource];
-        [dataSource startLoading: YES];
+        [[webController mainFrame] setProvisionalDataSource:dataSource];
+        [[webController mainFrame] startLoading];
     }else if(!strcmp(target, "_blank") || !strcmp(target, "_new")){
         printf("Error: No API to open new browser window\n");
     }
diff --git a/WebKit/Plugins.subproj/WebPluginView.m b/WebKit/Plugins.subproj/WebPluginView.m
index 30fc84b..99fd5a1 100644
--- a/WebKit/Plugins.subproj/WebPluginView.m
+++ b/WebKit/Plugins.subproj/WebPluginView.m
@@ -528,8 +528,8 @@ static id IFPluginMake(NSRect rect, WCPlugin *plugin, NSString *url, NSString *m
         dataSource = [[[IFWebDataSource alloc] initWithURL:newURL] autorelease];
         webView = [self findSuperview:@"IFWebView"];
         webController = [webView controller];
-        [webController setMainDataSource:dataSource];
-        [dataSource startLoading: YES];
+        [[webController mainFrame] setProvisionalDataSource:dataSource];
+        [[webController mainFrame] startLoading];
     }else if(!strcmp(target, "_blank") || !strcmp(target, "_new")){
         printf("Error: No API to open new browser window\n");
     }
diff --git a/WebKit/WebView.subproj/IFBaseWebController.h b/WebKit/WebView.subproj/IFBaseWebController.h
index 73036dc..4d21928 100644
--- a/WebKit/WebView.subproj/IFBaseWebController.h
+++ b/WebKit/WebView.subproj/IFBaseWebController.h
@@ -15,9 +15,15 @@
 }
 
 
+/*
+    Calls designated initializer with nil arguments.
+*/
 - init;
 
-- initWithView: (IFWebView *)view dataSource: (IFWebDataSource *)dataSource;
+/*
+    Designated initializer.
+*/
+- initWithView: (IFWebView *)view provisionalDataSource: (IFWebDataSource *)dataSource;
 
 
 - (void)setDirectsAllLinksToSystemBrowser: (BOOL)flag;
@@ -25,23 +31,4 @@
 
 - (BOOL)directsAllLinksToSystemBrowser;
 
-
-// Sets the mainView and the mainDataSource.
-// Returns NO if locationWillChangeTo:forFrame: disallows the change, otherwise returns YES.
-- (BOOL)setMainView: (IFWebView *)view andMainDataSource: (IFWebDataSource *)dataSource;
-
-
-- (void)setMainView: (IFWebView *)view;
-
-
-- (IFWebView *)mainView;
-
-
-// Returns NO if locationWillChangeTo:forFrame: disallows the change, otherwise returns YES.
-- (BOOL)setMainDataSource: (IFWebDataSource *)dataSource;
-
-
-- (IFWebDataSource *)mainDataSource;
-
-
 @end
diff --git a/WebKit/WebView.subproj/IFBaseWebController.mm b/WebKit/WebView.subproj/IFBaseWebController.mm
index b478e05..ff31f13 100644
--- a/WebKit/WebView.subproj/IFBaseWebController.mm
+++ b/WebKit/WebView.subproj/IFBaseWebController.mm
@@ -10,6 +10,8 @@
 #import <WebKit/IFWebFramePrivate.h>
 #import <WebKit/IFException.h>
 
+#import <WebKit/WebKitDebug.h>
+
 #include <WCLoadProgress.h>
 
 
@@ -92,17 +94,19 @@ static id IFLoadProgressMake()
 
 - init
 {
-    [super init];
-    _controllerPrivate = [[IFBaseWebControllerPrivate alloc] init];
-    return self;
+    return [self initWithView: nil provisionalDataSource: nil];
 }
 
 
-- initWithView: (IFWebView *)view dataSource: (IFWebDataSource *)dataSource
+- initWithView: (IFWebView *)view provisionalDataSource: (IFWebDataSource *)dataSource
 {
+    IFBaseWebControllerPrivate *data;
     [super init];
-    _controllerPrivate = [[IFBaseWebControllerPrivate alloc] init];
-    [self setMainView: view andMainDataSource: dataSource];
+    
+    data = [[IFBaseWebControllerPrivate alloc] init];
+    _controllerPrivate = data;
+    data->mainFrame = [[IFWebFrame alloc] initWithName: @"top" view: view provisionalDataSource: dataSource controller: self];
+
     return self;   
 }
 
@@ -126,29 +130,6 @@ static id IFLoadProgressMake()
 }
 
 
-
-// This is the designated method to change the main view and/or main data source.
-// The main view and data source are held in the main frame.
-- (BOOL)setMainView: (IFWebView *)view andMainDataSource: (IFWebDataSource *)dataSource
-{
-    IFBaseWebControllerPrivate *data = ((IFBaseWebControllerPrivate *)_controllerPrivate);
-        
-    if (dataSource != nil && dataSource != [data->mainFrame dataSource]){
-        if (![self locationWillChangeTo: [dataSource inputURL] forFrame: data->mainFrame])
-            return NO;
-    }
-    
-    // Do we need to delete and recreate the main frame?  Or can we reuse it?
-    [data->mainFrame reset];
-    [data->mainFrame autorelease];
-    
-    data->mainFrame = [[IFWebFrame alloc] initWithName: @"top" view: view dataSource: dataSource controller: self];
-    
-    return YES;
-}
-
-
-
 - (IFWebFrame *)createFrameNamed: (NSString *)fname for: (IFWebDataSource *)childDataSource inParent: (IFWebDataSource *)parentDataSource
 {
     IFWebView *childView;
@@ -157,7 +138,7 @@ static id IFLoadProgressMake()
 
     childView = [[[IFWebView alloc] initWithFrame: NSMakeRect (0,0,0,0)] autorelease];
 
-    newFrame = [[[IFWebFrame alloc] initWithName: fname view: childView dataSource: childDataSource controller: self] autorelease];
+    newFrame = [[[IFWebFrame alloc] initWithName: fname view: childView provisionalDataSource: childDataSource controller: self] autorelease];
 
     [parentDataSource addFrame: newFrame];
 
@@ -171,39 +152,6 @@ static id IFLoadProgressMake()
 }
 
 
-- (void)setMainView: (IFWebView *)m;
-{
-    IFBaseWebControllerPrivate *data = ((IFBaseWebControllerPrivate *)_controllerPrivate);
-    [self setMainView: m andMainDataSource: [data->mainFrame dataSource]];
-}
-
-- (IFWebFrame *)mainFrame
-{
-    IFBaseWebControllerPrivate *data = ((IFBaseWebControllerPrivate *)_controllerPrivate);
-    return data->mainFrame;
-}
-
-
-- (IFWebView *)mainView
-{
-    IFBaseWebControllerPrivate *data = ((IFBaseWebControllerPrivate *)_controllerPrivate);
-    return [data->mainFrame view];
-}
-
-
-- (BOOL)setMainDataSource: (IFWebDataSource *)dataSource;
-{
-    IFBaseWebControllerPrivate *data = ((IFBaseWebControllerPrivate *)_controllerPrivate);
-    return [self setMainView: [data->mainFrame view] andMainDataSource: dataSource];
-}
-
-- (IFWebDataSource *)mainDataSource
-{
-    IFBaseWebControllerPrivate *data = ((IFBaseWebControllerPrivate *)_controllerPrivate);
-    return [data->mainFrame dataSource];
-}
-
-
 
 // ---------------------------------------------------------------------
 // IFScriptContextHandler
@@ -236,15 +184,30 @@ static id IFLoadProgressMake()
 // ---------------------------------------------------------------------
 - (void)receivedProgress: (IFLoadProgress *)progress forResource: (NSString *)resourceDescription fromDataSource: (IFWebDataSource *)dataSource
 {
+    IFWebFrame *frame = [dataSource frame];
+    
+    WEBKIT_ASSERT (dataSource != nil);
+
+    WEBKIT_ASSERT (frame != nil);
+
+    // Check to see if this is the first load for a data source, if so
+    // we need to transition the data source from provisional to committed.
+    if (progress->bytesSoFar == progress->totalToLoad && [frame provisionalDataSource] == dataSource){
+        WEBKITDEBUGLEVEL1 (0x2000, "resource = %s\n", [resourceDescription cString]);
+        [frame _transitionProvisionalToCommitted];
+    }
+    
     // Check if the load is complete for this data source.
     if (progress->bytesSoFar == progress->totalToLoad)
         [self _checkLoadCompleteForDataSource: dataSource];
 }
 
 
-
 - (void)receivedError: (IFError *)error forResource: (NSString *)resourceDescription partialProgress: (IFLoadProgress *)progress fromDataSource: (IFWebDataSource *)dataSource
 {
+    WEBKIT_ASSERT (dataSource != nil);
+
+    // FIXME What should we do if the error is for a provisional data source?
     [self _checkLoadCompleteForDataSource: dataSource];
 }
 
@@ -258,15 +221,15 @@ static id IFLoadProgressMake()
 }
 
 
-- (void)locationChangeStartedForFrame: (IFWebFrame *)frame initiatedByUserEvent: (BOOL)flag;
+- (void)locationChangeStartedForFrame: (IFWebFrame *)frame;
 {
-    // Do nothing.
+    // Do nothing.  Subclasses typically override this method.
 }
 
 
 - (void)locationChangeCommittedForFrame: (IFWebFrame *)frame
 {
-    [NSException raise:IFMethodNotYetImplemented format:@"IFBaseWebController::locationChangeInProgressForDataSource:forDataSource: is not implemented"];
+    // Do nothing.  Subclasses typically override this method.
 }
 
 
@@ -296,6 +259,9 @@ static id IFLoadProgressMake()
     if ([frame dataSource] == dataSource)
         return frame;
         
+    if ([frame provisionalDataSource] == dataSource)
+        return frame;
+        
     frames = [[frame dataSource] children];
     count = [frames count];
     for (i = 0; i < count; i++){
@@ -304,6 +270,16 @@ static id IFLoadProgressMake()
         if (result)
             return result;
     }
+
+    frames = [[frame provisionalDataSource] children];
+    count = [frames count];
+    for (i = 0; i < count; i++){
+        frame = [frames objectAtIndex: i];
+        result = [self _frameForDataSource: dataSource fromFrame: frame];
+        if (result)
+            return result;
+    }
+    
     return nil;       
 }
 
@@ -316,5 +292,12 @@ static id IFLoadProgressMake()
 }
 
 
+- (IFWebFrame *)mainFrame
+{
+    IFBaseWebControllerPrivate *data = (IFBaseWebControllerPrivate *)_controllerPrivate;
+    
+    return data->mainFrame;
+}
+
 
 @end
diff --git a/WebKit/WebView.subproj/IFBaseWebControllerPrivate.h b/WebKit/WebView.subproj/IFBaseWebControllerPrivate.h
index 08ac21a..b31f3ea 100644
--- a/WebKit/WebView.subproj/IFBaseWebControllerPrivate.h
+++ b/WebKit/WebView.subproj/IFBaseWebControllerPrivate.h
@@ -15,7 +15,5 @@
 
 
 @interface IFBaseWebController (IFPrivate);
-- (BOOL)_changeLocationTo: (NSURL *)url forFrame: (IFWebFrame *)frame parent: (IFWebDataSource *)parent;
-- (void)_changeFrame: (IFWebFrame *)frame dataSource: (IFWebDataSource *)newDataSource;
 - (void)_checkLoadCompleteForDataSource: (IFWebDataSource *)dataSource;
 @end
diff --git a/WebKit/WebView.subproj/IFBaseWebControllerPrivate.mm b/WebKit/WebView.subproj/IFBaseWebControllerPrivate.mm
index 2b37efd..9ae00ce 100644
--- a/WebKit/WebView.subproj/IFBaseWebControllerPrivate.mm
+++ b/WebKit/WebView.subproj/IFBaseWebControllerPrivate.mm
@@ -31,44 +31,6 @@
 
 @implementation IFBaseWebController (IFPrivate)
 
-- (BOOL)_changeLocationTo: (NSURL *)url forFrame: (IFWebFrame *)frame parent: (IFWebDataSource *)parent
-{
-    if ([self locationWillChangeTo: url forFrame: frame]){
-        IFWebDataSource *dataSource = [[[IFWebDataSource alloc] initWithURL: url] autorelease];
-        
-        [dataSource _setParent: parent];
-        [self _changeFrame: frame dataSource: dataSource];
-        return YES;
-    }
-    return NO;
-}
-
-
-- (void)_changeFrame: (IFWebFrame *)frame dataSource: (IFWebDataSource *)newDataSource
-{
-    IFBaseWebControllerPrivate *data = ((IFBaseWebControllerPrivate *)_controllerPrivate);
-    IFWebDataSource *oldDataSource;
-
-    oldDataSource = [frame dataSource];
-    if (frame == data->mainFrame)
-        [newDataSource _setParent: nil];
-    else if (oldDataSource && oldDataSource != newDataSource)
-        [newDataSource _setParent: [oldDataSource parent]];
-            
-    [newDataSource _setController: self];
-    [frame _setDataSource: newDataSource];
-    
-    // dataSourceChanged: will reset the view and begin trying to
-    // display the new new datasource.
-    [[frame view] dataSourceChanged: newDataSource];
-
-    // This introduces a nasty dependency on the view.
-    khtml::RenderPart *renderPartFrame = [frame _renderFramePart];
-    id view = [frame view];
-    if (renderPartFrame && [view isKindOfClass: NSClassFromString(@"IFWebView")])
-        renderPartFrame->setWidget ([[frame view] _widget]);
-}
-
 - (void)_checkLoadCompleteForDataSource: (IFWebDataSource *)dataSource
 {
     // Check that all handle clients have been removed,
diff --git a/WebKit/WebView.subproj/IFWebController.h b/WebKit/WebView.subproj/IFWebController.h
index a66af3b..5a638c3 100644
--- a/WebKit/WebView.subproj/IFWebController.h
+++ b/WebKit/WebView.subproj/IFWebController.h
@@ -102,7 +102,7 @@
 // handshake.
 - (BOOL)locationWillChangeTo: (NSURL *)url forFrame: (IFWebFrame *)frame;
 
-- (void)locationChangeStartedForFrame: (IFWebFrame *)frame initiatedByUserEvent: (BOOL)flag;
+- (void)locationChangeStartedForFrame: (IFWebFrame *)frame;
 
 - (void)locationChangeCommittedForFrame: (IFWebFrame *)frame;
 
diff --git a/WebKit/WebView.subproj/IFWebDataSource.mm b/WebKit/WebView.subproj/IFWebDataSource.mm
index 094a8f2..717c9bf 100644
--- a/WebKit/WebView.subproj/IFWebDataSource.mm
+++ b/WebKit/WebView.subproj/IFWebDataSource.mm
@@ -9,8 +9,20 @@
 
 #include <xml/dom_docimpl.h>
 
+#include <WCWebDataSource.h>
+
 @implementation IFWebDataSource
 
+static id IFWebDataSourceMake(void *url) 
+{
+    return [[[IFWebDataSource alloc] initWithURL: (NSURL *)url] autorelease];
+}
+
++(void) load
+{
+    WCSetIFWebDataSourceMakeFunc(IFWebDataSourceMake);
+}
+
 + (void)initialize {
 
     NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
diff --git a/WebKit/WebView.subproj/IFWebDataSourcePrivate.mm b/WebKit/WebView.subproj/IFWebDataSourcePrivate.mm
index 5f5c9b1..3339e51 100644
--- a/WebKit/WebView.subproj/IFWebDataSourcePrivate.mm
+++ b/WebKit/WebView.subproj/IFWebDataSourcePrivate.mm
@@ -70,7 +70,7 @@
     
     [self _part]->openURL (url);
     
-    [[self controller] locationChangeStartedForFrame: [self frame] initiatedByUserEvent: byUserEvent];
+    [[self controller] locationChangeStartedForFrame: [self frame]];
 }
 
 
diff --git a/WebKit/WebView.subproj/IFWebFrame.h b/WebKit/WebView.subproj/IFWebFrame.h
index 1634bd1..0069590 100644
--- a/WebKit/WebView.subproj/IFWebFrame.h
+++ b/WebKit/WebView.subproj/IFWebFrame.h
@@ -17,7 +17,7 @@
     id _framePrivate;
 }
 
-- initWithName: (NSString *)name view: view dataSource: (IFWebDataSource *)dataSource controller: (id <IFWebController>)controller;
+- initWithName: (NSString *)name view: view provisionalDataSource: (IFWebDataSource *)dataSource controller: (id <IFWebController>)controller;
 - (NSString *)name;
 
 
@@ -31,12 +31,52 @@
     Sets the frame's data source.  Note that the data source will be
     considered 'provisional' until it has been loaded, and at least
     ~some~ data has been received.
+    
+    Will return NO and not set the provisional data source if the controller
+    disallows by return NO locationWillChangeTo:forFrame:.
+*/
+- (BOOL)setProvisionalDataSource: (IFWebDataSource *)ds;
+
+/*
+    Returns the committed data source.  Will return nil if the
+    provisional data source hasn't yet been loaded.
 */
-- (void)setDataSource: (IFWebDataSource *)ds;
 - (IFWebDataSource *)dataSource;
 
+/*
+    Will return the provisional data source.  The provisional data source will
+    return nil if no data source has been set on the frame, or the data source
+    has successfully transitioned to the committed data source.
+*/
 - (IFWebDataSource *)provisionalDataSource;
 
+
+/*
+    If a frame has a provisional data source this method will begin
+    loading data for that provisional data source.  If the frame
+    has no provisional data source this method will do nothing.
+
+    To reload an existing data source call reload.
+*/
+- (void)startLoading;
+
+
+/*
+    Stop any pending loads on the frame's data source,
+    and it's children.
+*/
+- (void)stopLoading;
+
+
+/*
+*/
+- (void)reload: (BOOL)forceRefresh;
+
+
+/*
+    This method removes references the underlying resources.
+    FIXME:  I think this should be private.
+*/
 - (void)reset;
 
 @end
diff --git a/WebKit/WebView.subproj/IFWebFrame.mm b/WebKit/WebView.subproj/IFWebFrame.mm
index de88745..bdbe133 100644
--- a/WebKit/WebView.subproj/IFWebFrame.mm
+++ b/WebKit/WebView.subproj/IFWebFrame.mm
@@ -8,33 +8,43 @@
 #import <WebKit/IFWebFrame.h>
 #import <WebKit/IFWebFramePrivate.h>
 #import <WebKit/IFWebViewPrivate.h>
-#import <WebKit/IFWebDataSource.h>
+#import <WebKit/IFWebDataSourcePrivate.h>
 #import <WebKit/IFBaseWebControllerPrivate.h>
 
 #import <WebKit/WebKitDebug.h>
 
+#include <KWQKHTMLPart.h>
+#include <rendering/render_frames.h>
+
 @implementation IFWebFrame
 
 - init
 {
-    return [self initWithName: nil view: nil dataSource: nil controller: nil];
+    return [self initWithName: nil view: nil provisionalDataSource: nil controller: nil];
 }
 
-- initWithName: (NSString *)n view: v dataSource: (IFWebDataSource *)d controller: (id<IFWebController>)c
+- initWithName: (NSString *)n view: v provisionalDataSource: (IFWebDataSource *)d controller: (id<IFWebController>)c
 {
     IFWebFramePrivate *data;
 
     [super init];
     
     _framePrivate = [[IFWebFramePrivate alloc] init];   
+
+    [self setController: c];
+
+    // Allow controller to override?
+    if (d && [self setProvisionalDataSource: d] == NO){
+        [self autorelease];
+        return nil;
+    }
     
     data = (IFWebFramePrivate *)_framePrivate;
     
     [data setName: n];
     
-    [self setController: c];
-    [self setView: v];
-    [self setDataSource:  d];
+    if (v)
+        [self setView: v];
     
     return self; 
 }
@@ -72,6 +82,7 @@
     return [data controller];
 }
 
+
 - (void)setController: (id <IFWebController>)controller
 {
     IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
@@ -86,28 +97,85 @@
 }
 
 
-
 - (IFWebDataSource *)dataSource
 {
     IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
     return [data dataSource];
 }
 
-- (void)setDataSource: (IFWebDataSource *)ds
+
+- (BOOL)setProvisionalDataSource: (IFWebDataSource *)newDataSource
 {
     IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
-    if ([data dataSource] == ds)
-        return;
+    IFWebDataSource *oldDataSource;
 
     WEBKIT_ASSERT ([self controller] != nil);
-        
-    // FIXME!  _changeFrame:dataSource: is implemented in IFBaseWebController, not a IFWebController
-    // method!
-    if (ds != nil){
-        [[self controller] _changeFrame: self dataSource: ds];
+
+    // Unfortunately the view must be non-nil, this is ultimately due
+    // to KDE parser requiring a KHTMLView.  Once we settle on a final
+    // KDE drop we should fix this dependency.
+    WEBKIT_ASSERT ([self view] != nil);
+
+    if (newDataSource != nil){
+        if (![[self controller] locationWillChangeTo: [newDataSource inputURL] forFrame: self])
+            return NO;
     }
+
+    oldDataSource = [self dataSource];
+    
+    // Is this the top frame?  If so set the data source's parent to nil.
+    if (self == [[self controller] mainFrame])
+        [newDataSource _setParent: nil];
+        
+    // Otherwise set the new data source's parent to the old data source's parent.
+    else if (oldDataSource && oldDataSource != newDataSource)
+        [newDataSource _setParent: [oldDataSource parent]];
+            
+    [newDataSource _setController: [self controller]];
+    
+    [data setProvisionalDataSource: newDataSource];
+    
+    [[self view] provisionalDataSourceChanged: newDataSource];
+
+    // This introduces a nasty dependency on the view.
+    khtml::RenderPart *renderPartFrame = [self _renderFramePart];
+    id view = [self view];
+    if (renderPartFrame && [view isKindOfClass: NSClassFromString(@"IFWebView")])
+        renderPartFrame->setWidget ([view _provisionalWidget]);
+
+    
+    return YES;
 }
 
+
+- (void)startLoading
+{
+    IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
+
+    // Force refresh is irrelevant, as this will always be the first load.
+    // The controller will transition the provisional data source to the
+    // committed data source.
+    [data->provisionalDataSource startLoading: NO];
+}
+
+
+- (void)stopLoading
+{
+    IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
+    
+    [data->provisionalDataSource stopLoading];
+    [data->dataSource stopLoading];
+}
+
+
+- (void)reload: (BOOL)forceRefresh
+{
+    IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
+
+    [data->dataSource startLoading: forceRefresh];
+}
+
+
 - (void)reset
 {
     IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
diff --git a/WebKit/WebView.subproj/IFWebFramePrivate.h b/WebKit/WebView.subproj/IFWebFramePrivate.h
index 3697e83..0bf9993 100644
--- a/WebKit/WebView.subproj/IFWebFramePrivate.h
+++ b/WebKit/WebView.subproj/IFWebFramePrivate.h
@@ -39,4 +39,5 @@
 - (void)_setRenderFramePart: (void *)p;
 - (void *)_renderFramePart;
 - (void)_setDataSource: (IFWebDataSource *)d;
+- (void)_transitionProvisionalToCommitted;
 @end
diff --git a/WebKit/WebView.subproj/IFWebFramePrivate.mm b/WebKit/WebView.subproj/IFWebFramePrivate.mm
index c1d7c42..c5d726d 100644
--- a/WebKit/WebView.subproj/IFWebFramePrivate.mm
+++ b/WebKit/WebView.subproj/IFWebFramePrivate.mm
@@ -7,6 +7,8 @@
 #import <WebKit/IFWebDataSourcePrivate.h>
 #import <WebKit/IFWebFramePrivate.h>
 
+#import <WebKit/WebKitDebug.h>
+
 @implementation IFWebFramePrivate
 
 - (void)dealloc
@@ -90,5 +92,26 @@
 }
 
 
+- (void)_transitionProvisionalToCommitted
+{
+    IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
+
+    WEBKIT_ASSERT ([self controller] != nil);
+
+    // Set the committed data source on the frame.
+    [self _setDataSource: data->provisionalDataSource];
+    
+    // dataSourceChanged: will reset the view and begin trying to
+    // display the new new datasource.
+    [[self view] dataSourceChanged: data->provisionalDataSource];
+
+    
+    // Now that the provisional data source is committed, release it.
+    [data setProvisionalDataSource: nil];
+
+    [[self controller] locationChangeCommittedForFrame: self];
+}
+
+
 @end
 
diff --git a/WebKit/WebView.subproj/IFWebView.h b/WebKit/WebView.subproj/IFWebView.h
index 941c744..a6b6107 100644
--- a/WebKit/WebView.subproj/IFWebView.h
+++ b/WebKit/WebView.subproj/IFWebView.h
@@ -99,6 +99,9 @@
 - (void)dataSourceChanged: (IFWebDataSource *)dataSource;
 
 
+- (void)provisionalDataSourceChanged: (IFWebDataSource *)dataSource;
+
+
 - (void)setNeedsLayout: (bool)flag;
 
 
diff --git a/WebKit/WebView.subproj/IFWebView.mm b/WebKit/WebView.subproj/IFWebView.mm
index 01674dc..980492f 100644
--- a/WebKit/WebView.subproj/IFWebView.mm
+++ b/WebKit/WebView.subproj/IFWebView.mm
@@ -51,32 +51,40 @@
 
 // This method is typically called by the view's controller when
 // the data source is changed.
-- (void)dataSourceChanged: (IFWebDataSource *)dataSource 
+- (void)provisionalDataSourceChanged: (IFWebDataSource *)dataSource 
 {
     IFWebViewPrivate *data = ((IFWebViewPrivate *)_viewPrivate);
     NSRect r = [self frame];
     
-    // Only delete the widget if we're the top level widget.  In other
-    // cases the widget is associated with a RenderFrame which will
-    // delete it's widget.
-    if ([dataSource isMainDocument] && data->widget)
-        delete data->widget;
-
     // Nasty!  Setup the cross references between the KHTMLView and
     // the KHTMLPart.
     KHTMLPart *part = [dataSource _part];
 
-    data->widget = new KHTMLView (part, 0);
-    part->setView (data->widget);
+    data->provisionalWidget = new KHTMLView (part, 0);
+    part->setView (data->provisionalWidget);
 
     // Check to see if we're a frame.
     if ([self _frameScrollView])
-        data->widget->setView ([self _frameScrollView]);
+        data->provisionalWidget->setView ([self _frameScrollView]);
     else
-        data->widget->setView (self);
+        data->provisionalWidget->setView (self);
     
-    data->widget->resize (r.size.width,r.size.height);
+    data->provisionalWidget->resize (r.size.width,r.size.height);
+}
 
+- (void)dataSourceChanged: (IFWebDataSource *)dataSource 
+{
+    IFWebViewPrivate *data = ((IFWebViewPrivate *)_viewPrivate);
+
+    // Only delete the widget if we're the top level widget.  In other
+    // cases the widget is associated with a RenderFrame which will
+    // delete it's widget.
+    if ([dataSource isMainDocument] && data->widget)
+        delete data->widget;
+
+    data->widget = data->provisionalWidget;
+    data->provisionalWidget = 0;
+    
     // Remove any remnants, i.e. form widgets, from the
     // previous page.
     [self _resetView];
@@ -87,7 +95,7 @@
 
 
 
-// This method should not be public until we have a more completely
+// This method should not be public until we have more completely
 // understood how IFWebView will be subclassed.
 - (void)layout
 {
diff --git a/WebKit/WebView.subproj/IFWebViewPrivate.h b/WebKit/WebView.subproj/IFWebViewPrivate.h
index f134132..f6ac554 100644
--- a/WebKit/WebView.subproj/IFWebViewPrivate.h
+++ b/WebKit/WebView.subproj/IFWebViewPrivate.h
@@ -19,6 +19,7 @@ class KHTMLView;
 {
     id <IFWebController>controller;
     KHTMLView *widget;
+    KHTMLView *provisionalWidget;
     IFDynamicScrollBarsView *frameScrollView;
     bool isFlipped;
     bool needsLayout;
@@ -31,6 +32,7 @@ class KHTMLView;
 - (void)_resetView;
 - (void)_resetWidget;
 - (KHTMLView *)_widget;
+- (KHTMLView *)_provisionalWidget;
 - (void)_setFrameScrollView: (IFDynamicScrollBarsView *)sv;
 - (IFDynamicScrollBarsView *)_frameScrollView;
 @end
diff --git a/WebKit/WebView.subproj/IFWebViewPrivate.mm b/WebKit/WebView.subproj/IFWebViewPrivate.mm
index 6060aad..c718a6a 100644
--- a/WebKit/WebView.subproj/IFWebViewPrivate.mm
+++ b/WebKit/WebView.subproj/IFWebViewPrivate.mm
@@ -81,6 +81,13 @@
     return ((IFWebViewPrivate *)_viewPrivate)->widget;    
 }
 
+
+- (KHTMLView *)_provisionalWidget
+{
+    return ((IFWebViewPrivate *)_viewPrivate)->provisionalWidget;    
+}
+
+
 - (void)_setFrameScrollView: (IFDynamicScrollBarsView *)sv
 {
     ((IFWebViewPrivate *)_viewPrivate)->frameScrollView = [sv retain];    
diff --git a/WebKit/WebView.subproj/WebController.h b/WebKit/WebView.subproj/WebController.h
index a66af3b..5a638c3 100644
--- a/WebKit/WebView.subproj/WebController.h
+++ b/WebKit/WebView.subproj/WebController.h
@@ -102,7 +102,7 @@
 // handshake.
 - (BOOL)locationWillChangeTo: (NSURL *)url forFrame: (IFWebFrame *)frame;
 
-- (void)locationChangeStartedForFrame: (IFWebFrame *)frame initiatedByUserEvent: (BOOL)flag;
+- (void)locationChangeStartedForFrame: (IFWebFrame *)frame;
 
 - (void)locationChangeCommittedForFrame: (IFWebFrame *)frame;
 
diff --git a/WebKit/WebView.subproj/WebDataSource.m b/WebKit/WebView.subproj/WebDataSource.m
index 094a8f2..717c9bf 100644
--- a/WebKit/WebView.subproj/WebDataSource.m
+++ b/WebKit/WebView.subproj/WebDataSource.m
@@ -9,8 +9,20 @@
 
 #include <xml/dom_docimpl.h>
 
+#include <WCWebDataSource.h>
+
 @implementation IFWebDataSource
 
+static id IFWebDataSourceMake(void *url) 
+{
+    return [[[IFWebDataSource alloc] initWithURL: (NSURL *)url] autorelease];
+}
+
++(void) load
+{
+    WCSetIFWebDataSourceMakeFunc(IFWebDataSourceMake);
+}
+
 + (void)initialize {
 
     NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.m b/WebKit/WebView.subproj/WebDataSourcePrivate.m
index 5f5c9b1..3339e51 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.m
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.m
@@ -70,7 +70,7 @@
     
     [self _part]->openURL (url);
     
-    [[self controller] locationChangeStartedForFrame: [self frame] initiatedByUserEvent: byUserEvent];
+    [[self controller] locationChangeStartedForFrame: [self frame]];
 }
 
 
diff --git a/WebKit/WebView.subproj/WebFrame.h b/WebKit/WebView.subproj/WebFrame.h
index 1634bd1..0069590 100644
--- a/WebKit/WebView.subproj/WebFrame.h
+++ b/WebKit/WebView.subproj/WebFrame.h
@@ -17,7 +17,7 @@
     id _framePrivate;
 }
 
-- initWithName: (NSString *)name view: view dataSource: (IFWebDataSource *)dataSource controller: (id <IFWebController>)controller;
+- initWithName: (NSString *)name view: view provisionalDataSource: (IFWebDataSource *)dataSource controller: (id <IFWebController>)controller;
 - (NSString *)name;
 
 
@@ -31,12 +31,52 @@
     Sets the frame's data source.  Note that the data source will be
     considered 'provisional' until it has been loaded, and at least
     ~some~ data has been received.
+    
+    Will return NO and not set the provisional data source if the controller
+    disallows by return NO locationWillChangeTo:forFrame:.
+*/
+- (BOOL)setProvisionalDataSource: (IFWebDataSource *)ds;
+
+/*
+    Returns the committed data source.  Will return nil if the
+    provisional data source hasn't yet been loaded.
 */
-- (void)setDataSource: (IFWebDataSource *)ds;
 - (IFWebDataSource *)dataSource;
 
+/*
+    Will return the provisional data source.  The provisional data source will
+    return nil if no data source has been set on the frame, or the data source
+    has successfully transitioned to the committed data source.
+*/
 - (IFWebDataSource *)provisionalDataSource;
 
+
+/*
+    If a frame has a provisional data source this method will begin
+    loading data for that provisional data source.  If the frame
+    has no provisional data source this method will do nothing.
+
+    To reload an existing data source call reload.
+*/
+- (void)startLoading;
+
+
+/*
+    Stop any pending loads on the frame's data source,
+    and it's children.
+*/
+- (void)stopLoading;
+
+
+/*
+*/
+- (void)reload: (BOOL)forceRefresh;
+
+
+/*
+    This method removes references the underlying resources.
+    FIXME:  I think this should be private.
+*/
 - (void)reset;
 
 @end
diff --git a/WebKit/WebView.subproj/WebFrame.m b/WebKit/WebView.subproj/WebFrame.m
index de88745..bdbe133 100644
--- a/WebKit/WebView.subproj/WebFrame.m
+++ b/WebKit/WebView.subproj/WebFrame.m
@@ -8,33 +8,43 @@
 #import <WebKit/IFWebFrame.h>
 #import <WebKit/IFWebFramePrivate.h>
 #import <WebKit/IFWebViewPrivate.h>
-#import <WebKit/IFWebDataSource.h>
+#import <WebKit/IFWebDataSourcePrivate.h>
 #import <WebKit/IFBaseWebControllerPrivate.h>
 
 #import <WebKit/WebKitDebug.h>
 
+#include <KWQKHTMLPart.h>
+#include <rendering/render_frames.h>
+
 @implementation IFWebFrame
 
 - init
 {
-    return [self initWithName: nil view: nil dataSource: nil controller: nil];
+    return [self initWithName: nil view: nil provisionalDataSource: nil controller: nil];
 }
 
-- initWithName: (NSString *)n view: v dataSource: (IFWebDataSource *)d controller: (id<IFWebController>)c
+- initWithName: (NSString *)n view: v provisionalDataSource: (IFWebDataSource *)d controller: (id<IFWebController>)c
 {
     IFWebFramePrivate *data;
 
     [super init];
     
     _framePrivate = [[IFWebFramePrivate alloc] init];   
+
+    [self setController: c];
+
+    // Allow controller to override?
+    if (d && [self setProvisionalDataSource: d] == NO){
+        [self autorelease];
+        return nil;
+    }
     
     data = (IFWebFramePrivate *)_framePrivate;
     
     [data setName: n];
     
-    [self setController: c];
-    [self setView: v];
-    [self setDataSource:  d];
+    if (v)
+        [self setView: v];
     
     return self; 
 }
@@ -72,6 +82,7 @@
     return [data controller];
 }
 
+
 - (void)setController: (id <IFWebController>)controller
 {
     IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
@@ -86,28 +97,85 @@
 }
 
 
-
 - (IFWebDataSource *)dataSource
 {
     IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
     return [data dataSource];
 }
 
-- (void)setDataSource: (IFWebDataSource *)ds
+
+- (BOOL)setProvisionalDataSource: (IFWebDataSource *)newDataSource
 {
     IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
-    if ([data dataSource] == ds)
-        return;
+    IFWebDataSource *oldDataSource;
 
     WEBKIT_ASSERT ([self controller] != nil);
-        
-    // FIXME!  _changeFrame:dataSource: is implemented in IFBaseWebController, not a IFWebController
-    // method!
-    if (ds != nil){
-        [[self controller] _changeFrame: self dataSource: ds];
+
+    // Unfortunately the view must be non-nil, this is ultimately due
+    // to KDE parser requiring a KHTMLView.  Once we settle on a final
+    // KDE drop we should fix this dependency.
+    WEBKIT_ASSERT ([self view] != nil);
+
+    if (newDataSource != nil){
+        if (![[self controller] locationWillChangeTo: [newDataSource inputURL] forFrame: self])
+            return NO;
     }
+
+    oldDataSource = [self dataSource];
+    
+    // Is this the top frame?  If so set the data source's parent to nil.
+    if (self == [[self controller] mainFrame])
+        [newDataSource _setParent: nil];
+        
+    // Otherwise set the new data source's parent to the old data source's parent.
+    else if (oldDataSource && oldDataSource != newDataSource)
+        [newDataSource _setParent: [oldDataSource parent]];
+            
+    [newDataSource _setController: [self controller]];
+    
+    [data setProvisionalDataSource: newDataSource];
+    
+    [[self view] provisionalDataSourceChanged: newDataSource];
+
+    // This introduces a nasty dependency on the view.
+    khtml::RenderPart *renderPartFrame = [self _renderFramePart];
+    id view = [self view];
+    if (renderPartFrame && [view isKindOfClass: NSClassFromString(@"IFWebView")])
+        renderPartFrame->setWidget ([view _provisionalWidget]);
+
+    
+    return YES;
 }
 
+
+- (void)startLoading
+{
+    IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
+
+    // Force refresh is irrelevant, as this will always be the first load.
+    // The controller will transition the provisional data source to the
+    // committed data source.
+    [data->provisionalDataSource startLoading: NO];
+}
+
+
+- (void)stopLoading
+{
+    IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
+    
+    [data->provisionalDataSource stopLoading];
+    [data->dataSource stopLoading];
+}
+
+
+- (void)reload: (BOOL)forceRefresh
+{
+    IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
+
+    [data->dataSource startLoading: forceRefresh];
+}
+
+
 - (void)reset
 {
     IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
diff --git a/WebKit/WebView.subproj/WebFramePrivate.h b/WebKit/WebView.subproj/WebFramePrivate.h
index 3697e83..0bf9993 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.h
+++ b/WebKit/WebView.subproj/WebFramePrivate.h
@@ -39,4 +39,5 @@
 - (void)_setRenderFramePart: (void *)p;
 - (void *)_renderFramePart;
 - (void)_setDataSource: (IFWebDataSource *)d;
+- (void)_transitionProvisionalToCommitted;
 @end
diff --git a/WebKit/WebView.subproj/WebFramePrivate.m b/WebKit/WebView.subproj/WebFramePrivate.m
index c1d7c42..c5d726d 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.m
+++ b/WebKit/WebView.subproj/WebFramePrivate.m
@@ -7,6 +7,8 @@
 #import <WebKit/IFWebDataSourcePrivate.h>
 #import <WebKit/IFWebFramePrivate.h>
 
+#import <WebKit/WebKitDebug.h>
+
 @implementation IFWebFramePrivate
 
 - (void)dealloc
@@ -90,5 +92,26 @@
 }
 
 
+- (void)_transitionProvisionalToCommitted
+{
+    IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
+
+    WEBKIT_ASSERT ([self controller] != nil);
+
+    // Set the committed data source on the frame.
+    [self _setDataSource: data->provisionalDataSource];
+    
+    // dataSourceChanged: will reset the view and begin trying to
+    // display the new new datasource.
+    [[self view] dataSourceChanged: data->provisionalDataSource];
+
+    
+    // Now that the provisional data source is committed, release it.
+    [data setProvisionalDataSource: nil];
+
+    [[self controller] locationChangeCommittedForFrame: self];
+}
+
+
 @end
 
diff --git a/WebKit/WebView.subproj/WebFrameView.h b/WebKit/WebView.subproj/WebFrameView.h
index 941c744..a6b6107 100644
--- a/WebKit/WebView.subproj/WebFrameView.h
+++ b/WebKit/WebView.subproj/WebFrameView.h
@@ -99,6 +99,9 @@
 - (void)dataSourceChanged: (IFWebDataSource *)dataSource;
 
 
+- (void)provisionalDataSourceChanged: (IFWebDataSource *)dataSource;
+
+
 - (void)setNeedsLayout: (bool)flag;
 
 
diff --git a/WebKit/WebView.subproj/WebFrameView.m b/WebKit/WebView.subproj/WebFrameView.m
index 01674dc..980492f 100644
--- a/WebKit/WebView.subproj/WebFrameView.m
+++ b/WebKit/WebView.subproj/WebFrameView.m
@@ -51,32 +51,40 @@
 
 // This method is typically called by the view's controller when
 // the data source is changed.
-- (void)dataSourceChanged: (IFWebDataSource *)dataSource 
+- (void)provisionalDataSourceChanged: (IFWebDataSource *)dataSource 
 {
     IFWebViewPrivate *data = ((IFWebViewPrivate *)_viewPrivate);
     NSRect r = [self frame];
     
-    // Only delete the widget if we're the top level widget.  In other
-    // cases the widget is associated with a RenderFrame which will
-    // delete it's widget.
-    if ([dataSource isMainDocument] && data->widget)
-        delete data->widget;
-
     // Nasty!  Setup the cross references between the KHTMLView and
     // the KHTMLPart.
     KHTMLPart *part = [dataSource _part];
 
-    data->widget = new KHTMLView (part, 0);
-    part->setView (data->widget);
+    data->provisionalWidget = new KHTMLView (part, 0);
+    part->setView (data->provisionalWidget);
 
     // Check to see if we're a frame.
     if ([self _frameScrollView])
-        data->widget->setView ([self _frameScrollView]);
+        data->provisionalWidget->setView ([self _frameScrollView]);
     else
-        data->widget->setView (self);
+        data->provisionalWidget->setView (self);
     
-    data->widget->resize (r.size.width,r.size.height);
+    data->provisionalWidget->resize (r.size.width,r.size.height);
+}
 
+- (void)dataSourceChanged: (IFWebDataSource *)dataSource 
+{
+    IFWebViewPrivate *data = ((IFWebViewPrivate *)_viewPrivate);
+
+    // Only delete the widget if we're the top level widget.  In other
+    // cases the widget is associated with a RenderFrame which will
+    // delete it's widget.
+    if ([dataSource isMainDocument] && data->widget)
+        delete data->widget;
+
+    data->widget = data->provisionalWidget;
+    data->provisionalWidget = 0;
+    
     // Remove any remnants, i.e. form widgets, from the
     // previous page.
     [self _resetView];
@@ -87,7 +95,7 @@
 
 
 
-// This method should not be public until we have a more completely
+// This method should not be public until we have more completely
 // understood how IFWebView will be subclassed.
 - (void)layout
 {
diff --git a/WebKit/WebView.subproj/WebFrameViewInternal.h b/WebKit/WebView.subproj/WebFrameViewInternal.h
index f134132..f6ac554 100644
--- a/WebKit/WebView.subproj/WebFrameViewInternal.h
+++ b/WebKit/WebView.subproj/WebFrameViewInternal.h
@@ -19,6 +19,7 @@ class KHTMLView;
 {
     id <IFWebController>controller;
     KHTMLView *widget;
+    KHTMLView *provisionalWidget;
     IFDynamicScrollBarsView *frameScrollView;
     bool isFlipped;
     bool needsLayout;
@@ -31,6 +32,7 @@ class KHTMLView;
 - (void)_resetView;
 - (void)_resetWidget;
 - (KHTMLView *)_widget;
+- (KHTMLView *)_provisionalWidget;
 - (void)_setFrameScrollView: (IFDynamicScrollBarsView *)sv;
 - (IFDynamicScrollBarsView *)_frameScrollView;
 @end
diff --git a/WebKit/WebView.subproj/WebFrameViewPrivate.h b/WebKit/WebView.subproj/WebFrameViewPrivate.h
index f134132..f6ac554 100644
--- a/WebKit/WebView.subproj/WebFrameViewPrivate.h
+++ b/WebKit/WebView.subproj/WebFrameViewPrivate.h
@@ -19,6 +19,7 @@ class KHTMLView;
 {
     id <IFWebController>controller;
     KHTMLView *widget;
+    KHTMLView *provisionalWidget;
     IFDynamicScrollBarsView *frameScrollView;
     bool isFlipped;
     bool needsLayout;
@@ -31,6 +32,7 @@ class KHTMLView;
 - (void)_resetView;
 - (void)_resetWidget;
 - (KHTMLView *)_widget;
+- (KHTMLView *)_provisionalWidget;
 - (void)_setFrameScrollView: (IFDynamicScrollBarsView *)sv;
 - (IFDynamicScrollBarsView *)_frameScrollView;
 @end
diff --git a/WebKit/WebView.subproj/WebFrameViewPrivate.m b/WebKit/WebView.subproj/WebFrameViewPrivate.m
index 6060aad..c718a6a 100644
--- a/WebKit/WebView.subproj/WebFrameViewPrivate.m
+++ b/WebKit/WebView.subproj/WebFrameViewPrivate.m
@@ -81,6 +81,13 @@
     return ((IFWebViewPrivate *)_viewPrivate)->widget;    
 }
 
+
+- (KHTMLView *)_provisionalWidget
+{
+    return ((IFWebViewPrivate *)_viewPrivate)->provisionalWidget;    
+}
+
+
 - (void)_setFrameScrollView: (IFDynamicScrollBarsView *)sv
 {
     ((IFWebViewPrivate *)_viewPrivate)->frameScrollView = [sv retain];    
diff --git a/WebKit/WebView.subproj/WebView.h b/WebKit/WebView.subproj/WebView.h
index a66af3b..5a638c3 100644
--- a/WebKit/WebView.subproj/WebView.h
+++ b/WebKit/WebView.subproj/WebView.h
@@ -102,7 +102,7 @@
 // handshake.
 - (BOOL)locationWillChangeTo: (NSURL *)url forFrame: (IFWebFrame *)frame;
 
-- (void)locationChangeStartedForFrame: (IFWebFrame *)frame initiatedByUserEvent: (BOOL)flag;
+- (void)locationChangeStartedForFrame: (IFWebFrame *)frame;
 
 - (void)locationChangeCommittedForFrame: (IFWebFrame *)frame;
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list