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

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


The following commit has been merged in the debian/unstable branch:
commit a7a6c3cee6a088a19b3e95032ab00779aacde828
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jun 14 23:15:53 2002 +0000

    WebCore:
    
    	Add the new bridge class that connects us to WebCore in a nicer way.
    	Started to use it for some things. More to come.
    
    	* WebKit.pbproj/project.pbxproj:
    	* IFWebCoreBridge.h: Added.
    	* IFWebCoreBridge.mm: Added.
    
    	* Misc.subproj/IFDownloadHandler.mm:
    	(-[IFDownloadHandler initWithDataSource:]): Call [super init].
    	(-[IFDownloadHandler dealloc]): Call [super dealloc].
    	* Plugins.subproj/IFPluginNullEventSender.m:
    	(-[IFPluginNullEventSender initializeWithNPP:functionPointer:window:]): Call [super init].
    	(-[IFPluginNullEventSender dealloc]): Call [super dealloc].
    	* WebView.subproj/IFDOMNode.mm: (-[IFDOMNode dealloc]): Call [super dealloc].
    	* WebView.subproj/IFImageView.m: (-[IFImageView dealloc]): Call [super dealloc].
    	* WebView.subproj/IFRenderNode.mm: (-[IFRenderNode dealloc]): Call [super dealloc].
    
    	* WebView.subproj/IFHTMLRepresentation.h: Moved variables into a private structure so
    	this class can be made public.
    	* WebView.subproj/IFHTMLRepresentationPrivate.h: Added. Has _bridge method.
    	* WebView.subproj/IFHTMLRepresentation.mm:
    	(-[IFHTMLRepresentation init]): Call [super init]. Also use the new private structure,
    	and allocate the IFWebCoreBridge.
    	(-[IFHTMLRepresentation dealloc]): Release the private structure and the IFWebCoreBridge.
    	Also, call [super dealloc].
    	(-[IFHTMLRepresentation _bridge]): Private method to get to the bridge.
    	(-[IFHTMLRepresentation receivedData:withDataSource:]): Use IFWebCoreBridge.
    
    	* WebView.subproj/IFWebViewPrivate.h: Add _setMarginWidth and _setMarginHeight.
    
    	* WebView.subproj/IFWebDataSourcePrivate.h: Tweak.
    	* WebView.subproj/IFWebDataSource.mm: Tweak.
    	* History.subproj/IFWebHistoryPrivate.m: Tweak.
    
    WebKit:
    
    	Worked on eliminating calls to WebKit. About 3/4 done.
    
    	* WebCore.exp: Export new WebCoreBridge class, fewer other things.
    
    	* WebCorePrefix.h: #include <ostream> in debug builds; we couldn't
    	before because of a PFE bug that has since been fixed (2920556).
    
    	* khtml/html/html_objectimpl.cpp: (HTMLObjectElementImpl::attach):
    	Add a comment explaining our latest change here.
    
    	* khtml/khtml_part.cpp: (KHTMLPart::~KHTMLPart): Fix storage leak
    	by deleting m_hostExtension.
    
    	* khtml/misc/loader.h: Set type properly on client member so we
    	don't have to do so much casting.
    
    	* kwq/KWQKHTMLPartImpl.h: Add getBridge and setBridge, remove setDataSource.
    	* kwq/KWQKHTMLPart.mm:
    	(KWQKHTMLPartImpl::KWQKHTMLPartImpl): Eliminate m_dataSource.
    	(KWQKHTMLPartImpl::openURLInFrame): Use WebCoreBridge.
    	(KWQKHTMLPartImpl::urlSelected): Use WebCoreBridge.
    	(KWQKHTMLPartImpl::requestFrame): Use WebCoreBridge.
    	(KWQKHTMLPartImpl::requestObject): Move WebCoreViewFactory code
    	here; we don't need an entire WCPluginWidget file just for this
    	function.
    	(KWQKHTMLPartImpl::submitForm): Use WebCoreBridge.
    	(KWQKHTMLPartImpl::frameExists): Use WebCoreBridge.
    	(KWQKHTMLPartImpl::frames): Use WebCoreBridge.
    	(KWQKHTMLPartImpl::setTitle): Use WebCoreBridge.
    	(KWQKHTMLPartImpl::getDataSource): Use WebCoreBridge.
    	(KWQKHTMLPartImpl::parentPart): Use WebCoreBridge.
    
    	* kwq/KWQKHTMLPartBrowserExtension.mm:
    	(KHTMLPartBrowserExtension::createNewWindow): Use WebCoreBridge.
    
    	* kwq/KWQKloader.mm: Move the part of external.h that we still use in
    	here, with the expectation of eliminating it soon. Also renamed
    	URLLoadClient to KWQURLLoadClient so we don't hog namespace.
    
    	* kwq/qt/qscrollview.h:
    	* kwq/KWQScrollView.mm: Used helper functions to do the "documentView"
    	selector thing more consistently.
    
    	* kwq/KWQWidget.mm: Get interface for changing the cursor from
    	WebCoreViewFactory.h instead of from external.h.
    
    	* kwq/WebCoreViewFactory.h:
    	* kwq/Makefile.am: Remove WCPluginWidget.mm, add WebCoreBridge.mm.
    	* kwq/WCPluginWidget.h: Removed.
    	* kwq/WCPluginWidget.mm: Removed.
    	* kwq/WebCoreBridge.h: Added.
    	* kwq/WebCoreBridge.mm: Added.
    
    	* kwq/qt/qarray.h: Use <ostream> instead of <iostream>.
    	* kwq/qt/qcstring.h: Remove <iostream> include since we include <qarray.h>.
    	* kwq/qt/qdatetime.h: Replace unconditional <iostream> include with a
    	conditional <ostream> include. Also made streaming operators conditional.
    	* kwq/qt/qlist.h: Use <ostream> instead of <iostream>.
    	* kwq/qt/qmap.h: Use <ostream> instead of <iostream>.
    	* kwq/qt/qpoint.h: Use <iosfwd> instead of <iostream>.
    	* kwq/qt/qsize.h: Use <iosfwd> instead of <iostream>.
    	* kwq/qt/qvaluelist.h: Use <ostream> instead of <iostream>.
    	* kwq/qt/qvector.h: Replace unconditional <iostream> include with a
    	conditional <ostream> include. Also made streaming operators conditional.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1357 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index a410d30..9b46775 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,70 @@
+2002-06-14  Darin Adler  <darin at apple.com>
+
+	Worked on eliminating calls to WebKit. About 3/4 done.
+
+	* WebCore.exp: Export new WebCoreBridge class, fewer other things.
+
+	* WebCorePrefix.h: #include <ostream> in debug builds; we couldn't
+	before because of a PFE bug that has since been fixed (2920556).
+
+	* khtml/html/html_objectimpl.cpp: (HTMLObjectElementImpl::attach):
+	Add a comment explaining our latest change here.
+
+	* khtml/khtml_part.cpp: (KHTMLPart::~KHTMLPart): Fix storage leak
+	by deleting m_hostExtension.
+
+	* khtml/misc/loader.h: Set type properly on client member so we
+	don't have to do so much casting.
+
+	* kwq/KWQKHTMLPartImpl.h: Add getBridge and setBridge, remove setDataSource.
+	* kwq/KWQKHTMLPart.mm:
+	(KWQKHTMLPartImpl::KWQKHTMLPartImpl): Eliminate m_dataSource.
+	(KWQKHTMLPartImpl::openURLInFrame): Use WebCoreBridge.
+	(KWQKHTMLPartImpl::urlSelected): Use WebCoreBridge.
+	(KWQKHTMLPartImpl::requestFrame): Use WebCoreBridge.
+	(KWQKHTMLPartImpl::requestObject): Move WebCoreViewFactory code
+	here; we don't need an entire WCPluginWidget file just for this
+	function.
+	(KWQKHTMLPartImpl::submitForm): Use WebCoreBridge.
+	(KWQKHTMLPartImpl::frameExists): Use WebCoreBridge.
+	(KWQKHTMLPartImpl::frames): Use WebCoreBridge.
+	(KWQKHTMLPartImpl::setTitle): Use WebCoreBridge.
+	(KWQKHTMLPartImpl::getDataSource): Use WebCoreBridge.
+	(KWQKHTMLPartImpl::parentPart): Use WebCoreBridge.
+
+	* kwq/KWQKHTMLPartBrowserExtension.mm:
+	(KHTMLPartBrowserExtension::createNewWindow): Use WebCoreBridge.
+
+	* kwq/KWQKloader.mm: Move the part of external.h that we still use in
+	here, with the expectation of eliminating it soon. Also renamed
+	URLLoadClient to KWQURLLoadClient so we don't hog namespace.
+
+	* kwq/qt/qscrollview.h:
+	* kwq/KWQScrollView.mm: Used helper functions to do the "documentView"
+	selector thing more consistently.
+
+	* kwq/KWQWidget.mm: Get interface for changing the cursor from
+	WebCoreViewFactory.h instead of from external.h.
+
+	* kwq/WebCoreViewFactory.h:
+	* kwq/Makefile.am: Remove WCPluginWidget.mm, add WebCoreBridge.mm.
+	* kwq/WCPluginWidget.h: Removed.
+	* kwq/WCPluginWidget.mm: Removed.
+	* kwq/WebCoreBridge.h: Added.
+	* kwq/WebCoreBridge.mm: Added.
+
+	* kwq/qt/qarray.h: Use <ostream> instead of <iostream>.
+	* kwq/qt/qcstring.h: Remove <iostream> include since we include <qarray.h>.
+	* kwq/qt/qdatetime.h: Replace unconditional <iostream> include with a
+	conditional <ostream> include. Also made streaming operators conditional.
+	* kwq/qt/qlist.h: Use <ostream> instead of <iostream>.
+	* kwq/qt/qmap.h: Use <ostream> instead of <iostream>.
+	* kwq/qt/qpoint.h: Use <iosfwd> instead of <iostream>.
+	* kwq/qt/qsize.h: Use <iosfwd> instead of <iostream>.
+	* kwq/qt/qvaluelist.h: Use <ostream> instead of <iostream>.
+	* kwq/qt/qvector.h: Replace unconditional <iostream> include with a
+	conditional <ostream> include. Also made streaming operators conditional.
+
 2002-06-14  Richard Williamson  <rjw at apple.com>
 
     Name change view -> webView.
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index a410d30..9b46775 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,70 @@
+2002-06-14  Darin Adler  <darin at apple.com>
+
+	Worked on eliminating calls to WebKit. About 3/4 done.
+
+	* WebCore.exp: Export new WebCoreBridge class, fewer other things.
+
+	* WebCorePrefix.h: #include <ostream> in debug builds; we couldn't
+	before because of a PFE bug that has since been fixed (2920556).
+
+	* khtml/html/html_objectimpl.cpp: (HTMLObjectElementImpl::attach):
+	Add a comment explaining our latest change here.
+
+	* khtml/khtml_part.cpp: (KHTMLPart::~KHTMLPart): Fix storage leak
+	by deleting m_hostExtension.
+
+	* khtml/misc/loader.h: Set type properly on client member so we
+	don't have to do so much casting.
+
+	* kwq/KWQKHTMLPartImpl.h: Add getBridge and setBridge, remove setDataSource.
+	* kwq/KWQKHTMLPart.mm:
+	(KWQKHTMLPartImpl::KWQKHTMLPartImpl): Eliminate m_dataSource.
+	(KWQKHTMLPartImpl::openURLInFrame): Use WebCoreBridge.
+	(KWQKHTMLPartImpl::urlSelected): Use WebCoreBridge.
+	(KWQKHTMLPartImpl::requestFrame): Use WebCoreBridge.
+	(KWQKHTMLPartImpl::requestObject): Move WebCoreViewFactory code
+	here; we don't need an entire WCPluginWidget file just for this
+	function.
+	(KWQKHTMLPartImpl::submitForm): Use WebCoreBridge.
+	(KWQKHTMLPartImpl::frameExists): Use WebCoreBridge.
+	(KWQKHTMLPartImpl::frames): Use WebCoreBridge.
+	(KWQKHTMLPartImpl::setTitle): Use WebCoreBridge.
+	(KWQKHTMLPartImpl::getDataSource): Use WebCoreBridge.
+	(KWQKHTMLPartImpl::parentPart): Use WebCoreBridge.
+
+	* kwq/KWQKHTMLPartBrowserExtension.mm:
+	(KHTMLPartBrowserExtension::createNewWindow): Use WebCoreBridge.
+
+	* kwq/KWQKloader.mm: Move the part of external.h that we still use in
+	here, with the expectation of eliminating it soon. Also renamed
+	URLLoadClient to KWQURLLoadClient so we don't hog namespace.
+
+	* kwq/qt/qscrollview.h:
+	* kwq/KWQScrollView.mm: Used helper functions to do the "documentView"
+	selector thing more consistently.
+
+	* kwq/KWQWidget.mm: Get interface for changing the cursor from
+	WebCoreViewFactory.h instead of from external.h.
+
+	* kwq/WebCoreViewFactory.h:
+	* kwq/Makefile.am: Remove WCPluginWidget.mm, add WebCoreBridge.mm.
+	* kwq/WCPluginWidget.h: Removed.
+	* kwq/WCPluginWidget.mm: Removed.
+	* kwq/WebCoreBridge.h: Added.
+	* kwq/WebCoreBridge.mm: Added.
+
+	* kwq/qt/qarray.h: Use <ostream> instead of <iostream>.
+	* kwq/qt/qcstring.h: Remove <iostream> include since we include <qarray.h>.
+	* kwq/qt/qdatetime.h: Replace unconditional <iostream> include with a
+	conditional <ostream> include. Also made streaming operators conditional.
+	* kwq/qt/qlist.h: Use <ostream> instead of <iostream>.
+	* kwq/qt/qmap.h: Use <ostream> instead of <iostream>.
+	* kwq/qt/qpoint.h: Use <iosfwd> instead of <iostream>.
+	* kwq/qt/qsize.h: Use <iosfwd> instead of <iostream>.
+	* kwq/qt/qvaluelist.h: Use <ostream> instead of <iostream>.
+	* kwq/qt/qvector.h: Replace unconditional <iostream> include with a
+	conditional <ostream> include. Also made streaming operators conditional.
+
 2002-06-14  Richard Williamson  <rjw at apple.com>
 
     Name change view -> webView.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index a410d30..9b46775 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,70 @@
+2002-06-14  Darin Adler  <darin at apple.com>
+
+	Worked on eliminating calls to WebKit. About 3/4 done.
+
+	* WebCore.exp: Export new WebCoreBridge class, fewer other things.
+
+	* WebCorePrefix.h: #include <ostream> in debug builds; we couldn't
+	before because of a PFE bug that has since been fixed (2920556).
+
+	* khtml/html/html_objectimpl.cpp: (HTMLObjectElementImpl::attach):
+	Add a comment explaining our latest change here.
+
+	* khtml/khtml_part.cpp: (KHTMLPart::~KHTMLPart): Fix storage leak
+	by deleting m_hostExtension.
+
+	* khtml/misc/loader.h: Set type properly on client member so we
+	don't have to do so much casting.
+
+	* kwq/KWQKHTMLPartImpl.h: Add getBridge and setBridge, remove setDataSource.
+	* kwq/KWQKHTMLPart.mm:
+	(KWQKHTMLPartImpl::KWQKHTMLPartImpl): Eliminate m_dataSource.
+	(KWQKHTMLPartImpl::openURLInFrame): Use WebCoreBridge.
+	(KWQKHTMLPartImpl::urlSelected): Use WebCoreBridge.
+	(KWQKHTMLPartImpl::requestFrame): Use WebCoreBridge.
+	(KWQKHTMLPartImpl::requestObject): Move WebCoreViewFactory code
+	here; we don't need an entire WCPluginWidget file just for this
+	function.
+	(KWQKHTMLPartImpl::submitForm): Use WebCoreBridge.
+	(KWQKHTMLPartImpl::frameExists): Use WebCoreBridge.
+	(KWQKHTMLPartImpl::frames): Use WebCoreBridge.
+	(KWQKHTMLPartImpl::setTitle): Use WebCoreBridge.
+	(KWQKHTMLPartImpl::getDataSource): Use WebCoreBridge.
+	(KWQKHTMLPartImpl::parentPart): Use WebCoreBridge.
+
+	* kwq/KWQKHTMLPartBrowserExtension.mm:
+	(KHTMLPartBrowserExtension::createNewWindow): Use WebCoreBridge.
+
+	* kwq/KWQKloader.mm: Move the part of external.h that we still use in
+	here, with the expectation of eliminating it soon. Also renamed
+	URLLoadClient to KWQURLLoadClient so we don't hog namespace.
+
+	* kwq/qt/qscrollview.h:
+	* kwq/KWQScrollView.mm: Used helper functions to do the "documentView"
+	selector thing more consistently.
+
+	* kwq/KWQWidget.mm: Get interface for changing the cursor from
+	WebCoreViewFactory.h instead of from external.h.
+
+	* kwq/WebCoreViewFactory.h:
+	* kwq/Makefile.am: Remove WCPluginWidget.mm, add WebCoreBridge.mm.
+	* kwq/WCPluginWidget.h: Removed.
+	* kwq/WCPluginWidget.mm: Removed.
+	* kwq/WebCoreBridge.h: Added.
+	* kwq/WebCoreBridge.mm: Added.
+
+	* kwq/qt/qarray.h: Use <ostream> instead of <iostream>.
+	* kwq/qt/qcstring.h: Remove <iostream> include since we include <qarray.h>.
+	* kwq/qt/qdatetime.h: Replace unconditional <iostream> include with a
+	conditional <ostream> include. Also made streaming operators conditional.
+	* kwq/qt/qlist.h: Use <ostream> instead of <iostream>.
+	* kwq/qt/qmap.h: Use <ostream> instead of <iostream>.
+	* kwq/qt/qpoint.h: Use <iosfwd> instead of <iostream>.
+	* kwq/qt/qsize.h: Use <iosfwd> instead of <iostream>.
+	* kwq/qt/qvaluelist.h: Use <ostream> instead of <iostream>.
+	* kwq/qt/qvector.h: Replace unconditional <iostream> include with a
+	conditional <ostream> include. Also made streaming operators conditional.
+
 2002-06-14  Richard Williamson  <rjw at apple.com>
 
     Name change view -> webView.
diff --git a/WebCore/WebCore.exp b/WebCore/WebCore.exp
index 778bb3d..640c156 100644
--- a/WebCore/WebCore.exp
+++ b/WebCore/WebCore.exp
@@ -1,11 +1,10 @@
+.objc_class_name_WebCoreBridge
+.objc_class_name_WebCoreImageRendererFactory
 .objc_class_name_WebCoreTextRendererFactory
 .objc_class_name_WebCoreViewFactory
-.objc_class_name_WebCoreImageRendererFactory
 __Z27WCSetIFLoadProgressMakeFuncPFP11objc_objectvE
-__Z28WCSetIFWebDataSourceMakeFuncPFP11objc_objectPvS1_jE
 __ZN11QMouseEventC1EN6QEvent4TypeERK6QPointii
 __ZN16KWQKHTMLPartImpl10setBaseURLERK4KURL
-__ZN16KWQKHTMLPartImpl13setDataSourceEP15IFWebDataSource
 __ZN16KWQKHTMLPartImpl14gotoBaseAnchorEv
 __ZN16KWQKHTMLPartImpl7setViewEP9KHTMLView
 __ZN16KWQKHTMLPartImpl8slotDataEP8NSStringPKcib
diff --git a/WebCore/WebCorePrefix.h b/WebCore/WebCorePrefix.h
index d7567bc..a877611 100644
--- a/WebCore/WebCorePrefix.h
+++ b/WebCore/WebCorePrefix.h
@@ -16,10 +16,12 @@
 #ifdef __cplusplus
 
 #include <cstddef>
-// FIXME: We really need to precompile iostream, but we can't until Radar 2920556 is fixed.
-//#include <iostream>
 #include <new>
 
+#ifndef NDEBUG
+#include <ostream>
+#endif
+
 #endif
 
 #include <sys/types.h>
diff --git a/WebCore/khtml/html/html_objectimpl.cpp b/WebCore/khtml/html/html_objectimpl.cpp
index 2e6127c..24fd757 100644
--- a/WebCore/khtml/html/html_objectimpl.cpp
+++ b/WebCore/khtml/html/html_objectimpl.cpp
@@ -334,14 +334,19 @@ void HTMLObjectElementImpl::attach()
 
     KHTMLView* w = getDocument()->view();
     bool loadplugin = w->part()->pluginsEnabled();
+#ifdef APPLE_CHANGES
+    // This check showed up during the KDE 3.0 -> 3.0.1 transition.
+    // We can't figure out exactly what it's supposed to do, but it prevents
+    // plugins from working properly for us, so we've rolled back to the way
+    // it was in KDE 3.0.1.
+#else
     KURL u = getDocument()->completeURL(url);
     for (KHTMLPart* part = w->part(); part; part = part->parentPart())
         if (part->url() == u) {
-#ifndef APPLE_CHANGES
             loadplugin = false;
-#endif
             break;
         }
+#endif
 
     if (loadplugin && parentNode()->renderer()) {
         needWidgetUpdate = false;
diff --git a/WebCore/khtml/khtml_part.cpp b/WebCore/khtml/khtml_part.cpp
index b054bf3..af28138 100644
--- a/WebCore/khtml/khtml_part.cpp
+++ b/WebCore/khtml/khtml_part.cpp
@@ -306,6 +306,8 @@ KHTMLPart::~KHTMLPart()
   
 #ifdef APPLE_CHANGES
   delete impl;
+
+  delete d->m_hostExtension;
 #endif
 
   delete d; d = 0;
diff --git a/WebCore/khtml/misc/loader.h b/WebCore/khtml/misc/loader.h
index cf328cb..b900a23 100644
--- a/WebCore/khtml/misc/loader.h
+++ b/WebCore/khtml/misc/loader.h
@@ -68,6 +68,11 @@ namespace DOM
 
 #ifdef APPLE_CHANGES
 class KWQLoaderImpl;
+#ifdef __OBJC__
+ at class KWQURLLoadClient;
+#else
+class KWQURLLoadClient;
+#endif
 #endif
 
 namespace khtml
@@ -382,7 +387,7 @@ namespace khtml
 	CachedObject *object;
         DocLoader* m_docLoader;
 #ifdef APPLE_CHANGES
-        void *client;
+        KWQURLLoadClient *client;
 #endif
      };
 
diff --git a/WebCore/kwq/KWQCString.h b/WebCore/kwq/KWQCString.h
index 2a5cfa6..8fd0868 100644
--- a/WebCore/kwq/KWQCString.h
+++ b/WebCore/kwq/KWQCString.h
@@ -28,11 +28,6 @@
 
 #include <qarray.h>
 #include <string.h>
-#include <KWQDef.h>
-
-#ifdef _KWQ_IOSTREAM_
-#include <iostream>
-#endif
 
 typedef QMemArray<char> QByteArray;
 
diff --git a/WebCore/kwq/KWQDateTime.h b/WebCore/kwq/KWQDateTime.h
index 1c352f2..7676ec5 100644
--- a/WebCore/kwq/KWQDateTime.h
+++ b/WebCore/kwq/KWQDateTime.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2001, 2002 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
@@ -26,7 +26,11 @@
 #ifndef QDATETIME_H_
 #define QDATETIME_H_
 
-#include <iostream>
+#include <KWQDef.h>
+
+#ifdef _KWQ_IOSTREAM_
+#include <iosfwd>
+#endif
 
 class QTime {
 public:
@@ -50,7 +54,9 @@ private:
     uint timeMS;  // time is stored in milliseconds 
     
     friend class QDateTime;
+#ifdef _KWQ_IOSTREAM_
     friend std::ostream &operator<<( std::ostream &, const QTime & );
+#endif
     
 };
 
@@ -77,7 +83,9 @@ private:
     void setCurrentDate();
     
     friend class QDateTime;
+#ifdef _KWQ_IOSTREAM_
     friend std::ostream &operator<<( std::ostream &, const QDate & );
+#endif
 
 };
 
@@ -97,7 +105,9 @@ private:
     QTime timeDT;
     QDate dateDT;
 
+#ifdef _KWQ_IOSTREAM_
     friend std::ostream &operator<<( std::ostream &, const QDateTime & );
+#endif
 };
 
 #endif
diff --git a/WebCore/kwq/KWQKHTMLPart.h b/WebCore/kwq/KWQKHTMLPart.h
index 647d139..3a7e883 100644
--- a/WebCore/kwq/KWQKHTMLPart.h
+++ b/WebCore/kwq/KWQKHTMLPart.h
@@ -27,8 +27,10 @@
 
 #ifdef __OBJC__
 @class IFWebDataSource;
+ at class WebCoreBridge;
 #else
 class IFWebDataSource;
+class WebCoreBridge;
 #endif
 
 class KWQKHTMLPartImpl : public QObject
@@ -37,6 +39,8 @@ public:
     KWQKHTMLPartImpl(KHTMLPart *);
     ~KWQKHTMLPartImpl();
     
+    void setBridge(WebCoreBridge *p) { bridge = p; }
+    WebCoreBridge *getBridge() const { return bridge; }
     void setView(KHTMLView *view);
 
     bool openURLInFrame(const KURL &, const KParts::URLArgs &);
@@ -59,7 +63,6 @@ public:
     
     QString documentSource() const;
 
-    void setDataSource(IFWebDataSource *);
     IFWebDataSource *getDataSource();
 
     bool frameExists(const QString &frameName);
@@ -76,13 +79,14 @@ public:
 private:
     KHTMLPart *part;
     KHTMLPartPrivate *d;
+    
+    WebCoreBridge *bridge;
 
     int m_redirectionTimer;
     
     KURL m_baseURL;
     QString m_documentSource;
     bool m_decodingStarted;
-    IFWebDataSource *m_dataSource;
     
     friend class KHTMLPart;
 };
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index fb3beee..a4bad96 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -35,21 +35,14 @@
 
 #import <khtmlpart_p.h>
 
-#import <WCPluginWidget.h>
+#import <WebCoreViewFactory.h>
+#import <WebCoreBridge.h>
 #import <WCWebDataSource.h>
-#import <external.h>
 
 #import <kwqdebug.h>
 
 #undef _KWQ_TIMING
 
-static WCIFWebDataSourceMakeFunc WCIFWebDataSourceMake;
-
-void WCSetIFWebDataSourceMakeFunc(WCIFWebDataSourceMakeFunc func)
-{
-    WCIFWebDataSourceMake = func;
-}
-
 static void recursive(const DOM::Node &pNode, const DOM::Node &node)
 {
     DOM::Node cur_child = node.lastChild();
@@ -68,7 +61,6 @@ KWQKHTMLPartImpl::KWQKHTMLPartImpl(KHTMLPart *p)
     , d(part->d)
     , m_redirectionTimer(0)
     , m_decodingStarted(false)
-    , m_dataSource(0)
 {
 }
 
@@ -79,29 +71,20 @@ KWQKHTMLPartImpl::~KWQKHTMLPartImpl()
 
 bool KWQKHTMLPartImpl::openURLInFrame( const KURL &url, const KParts::URLArgs &urlArgs )
 {
-  IFWebDataSource *oldDataSource, *newDataSource;
-  IFWebFrame *frame;
-
+    WebCoreBridge *frame;
 
-  if (!urlArgs.frameName.isEmpty()) {
-    frame = [[getDataSource() controller] frameNamed: QSTRING_TO_NSSTRING(urlArgs.frameName)];
-    oldDataSource = [frame dataSource];
-  } else {
-      oldDataSource = getDataSource();
-      frame = [oldDataSource webFrame];
-  }
-
-  if (frame == nil) {
-    frame = [[getDataSource() controller] mainFrame];
-  }
-
-  newDataSource = WCIFWebDataSourceMake(url.getNSURL(), nil, 0);
-  [newDataSource _setParent: [oldDataSource parent]];
+    if (!urlArgs.frameName.isEmpty()) {
+        frame = [bridge frameNamed:urlArgs.frameName.getNSString()];
+        if (frame == nil) {
+            frame = [bridge mainFrame];
+        }
+    } else {
+        frame = bridge;
+    }
 
-  [frame setProvisionalDataSource: newDataSource];
-  [frame startLoading];
+    [frame loadURL:url.getNSURL()];
 
-  return true;
+    return true;
 }
 
 void KWQKHTMLPartImpl::openURL(const KURL &url)
@@ -398,10 +381,9 @@ void KWQKHTMLPartImpl::redirectURL()
 
 void KWQKHTMLPartImpl::urlSelected( const QString &url, int button, int state, const QString &_target, KParts::URLArgs )
 {
-    IFWebDataSource *oldDataSource, *newDataSource;
     KURL clickedURL(part->completeURL( url));
-    IFWebFrame *frame, *currentFrame;
     KURL refLess(clickedURL);
+    WebCoreBridge *frame;
 	
     if ( url.find( QString::fromLatin1( "javascript:" ), 0, false ) == 0 )
     {
@@ -411,7 +393,7 @@ void KWQKHTMLPartImpl::urlSelected( const QString &url, int button, int state, c
 
     // Open new window on command-click
     if (state & MetaButton) {
-        [[getDataSource() controller] openNewWindowWithURL:clickedURL.getNSURL()];
+        [bridge openNewWindowWithURL:clickedURL.getNSURL()];
         return;
     }
 
@@ -423,86 +405,52 @@ void KWQKHTMLPartImpl::urlSelected( const QString &url, int button, int state, c
         return;
     }
     
-    oldDataSource = getDataSource();
-    currentFrame = [oldDataSource webFrame];
-    if (_target.isEmpty()){
-        // If we're the only frame in a frameset then pop
-        // the frame.
-        if ([[[oldDataSource parent] children] count] == 1){
-            frame = [[oldDataSource parent] webFrame];
+    if (_target.isEmpty()) {
+        // If we're the only frame in a frameset then pop the frame.
+        if ([[[bridge parent] children] count] == 1) {
+            frame = [bridge parent];
+        } else {
+            frame = bridge;
         }
-        else
-            frame = currentFrame;
     }
     else {
-        frame = [currentFrame frameNamed: QSTRING_TO_NSSTRING(_target)];
-        if (frame == nil){
-            // FIXME:  What is the correct behavior here?
-            NSLog (@"ERROR:  unable to find frame named %@\n",
-                        QSTRING_TO_NSSTRING(_target));
+        frame = [bridge frameNamed:_target.getNSString()];
+        if (frame == nil) {
+            // FIXME: What is the correct behavior here? Other browsers seem to open new windows.
+            NSLog (@"ERROR: unable to find frame named %@\n", _target.getNSString());
             return;
         }
-        oldDataSource = [frame dataSource];
     }
     
-    newDataSource = WCIFWebDataSourceMake(clickedURL.getNSURL(), nil, 0);
-    [newDataSource _setParent: [oldDataSource parent]];
-    
-    [frame setProvisionalDataSource: newDataSource];
-    [frame startLoading];
+    [frame loadURL:clickedURL.getNSURL()];
 }
 
 bool KWQKHTMLPartImpl::requestFrame( khtml::RenderPart *frame, const QString &url, const QString &frameName,
                                      const QStringList &params, bool isIFrame )
 {
-    NSString *nsframeName = QSTRING_TO_NSSTRING(frameName);
-    IFWebFrame *aFrame;
-    IFWebDataSource *dataSource;
-    
-    dataSource = getDataSource();
-
-    KWQDEBUGLEVEL (KWQ_LOG_FRAMES, "name %s\n", [nsframeName cString]);
-    aFrame =[dataSource frameNamed: nsframeName];
-    if (aFrame){
-        KWQDEBUGLEVEL (KWQ_LOG_FRAMES, "found %s\n", [nsframeName cString]);
-        QWidget *khtmlview = [[[aFrame webView] documentView] _provisionalWidget];
-        if (khtmlview)
-            frame->setWidget (khtmlview);
-        else
-            frame->setWidget ([[[aFrame webView] documentView] _widget]);
+    NSString *name = frameName.getNSString();
+
+    KWQDEBUGLEVEL(KWQ_LOG_FRAMES, "name %s\n", DEBUG_OBJECT(name));
+    WebCoreBridge *framePart = [bridge frameNamed:name];
+    if (framePart) {
+        KWQDEBUGLEVEL(KWQ_LOG_FRAMES, "found %s\n", DEBUG_OBJECT(name));
+        frame->setWidget([framePart widget]);
     }
     else {        
-        KWQDEBUGLEVEL (KWQ_LOG_FRAMES, "creating %s\n", [nsframeName cString]);
-        IFWebDataSource *oldDataSource, *newDataSource;
-        NSURL *childURL;
-        IFWebFrame *newFrame;
-        IFWebController *controller;
-        HTMLIFrameElementImpl *o = static_cast<HTMLIFrameElementImpl *>(frame->element());
-                
-        childURL = part->completeURL(url).getNSURL();
+        KWQDEBUGLEVEL(KWQ_LOG_FRAMES, "creating %s\n", DEBUG_OBJECT(name));
+        
+        NSURL *childURL = part->completeURL(url).getNSURL();
         if (childURL == nil || [childURL path] == nil) {
             NSLog (@"ERROR (probably need to fix CFURL): unable to create URL with path");
             return false;
         }
         
-        oldDataSource = getDataSource();
-        controller = [oldDataSource controller];
-        newFrame = [controller createFrameNamed: nsframeName for: nil inParent: oldDataSource inScrollView: o->scrollingMode() != QScrollView::AlwaysOff];
-        if (newFrame == nil) {
-            // Controller return NO to location change, now what?
+        HTMLIFrameElementImpl *o = static_cast<HTMLIFrameElementImpl *>(frame->element());
+        if (![bridge createNewFrameNamed:name withURL:childURL
+                renderPart:frame allowsScrolling:o->scrollingMode() != QScrollView::AlwaysOff
+                marginWidth:o->getMarginWidth() marginHeight:o->getMarginHeight()]) {
             return false;
         }
-        [newFrame _setRenderFramePart: frame];
-        
-        newDataSource = WCIFWebDataSourceMake(childURL, nil, 0);
-        [newDataSource _setParent: oldDataSource];
-        [newFrame setProvisionalDataSource: newDataSource];
-    
-        
-        [[newFrame webView] _setMarginWidth: o->getMarginWidth()];
-        [[newFrame webView] _setMarginHeight: o->getMarginHeight()];
-
-        [newFrame startLoading];
     }
 
 #ifdef _SUPPORT_JAVASCRIPT_URL_    
@@ -527,16 +475,29 @@ bool KWQKHTMLPartImpl::requestFrame( khtml::RenderPart *frame, const QString &ur
     return true;
 }
 
-bool KWQKHTMLPartImpl::requestObject( khtml::RenderPart *frame, const QString &url, const QString &serviceType,
-			              const QStringList &args )
+bool KWQKHTMLPartImpl::requestObject(khtml::RenderPart *frame, const QString &url, const QString &serviceType, const QStringList &args)
 {
-  if (url.isEmpty()) {
-    return false;
-  }
-  if (!frame->widget()) {
-    frame->setWidget(IFPluginWidgetCreate(part->completeURL(url).url(), serviceType, args, m_baseURL.url()));
-  }
-  return true;
+    if (url.isEmpty()) {
+        return false;
+    }
+    if (frame->widget()) {
+        return true;
+    }
+    
+    NSMutableArray *argsArray = [NSMutableArray arrayWithCapacity:args.count()];
+    for (uint i = 0; i < args.count(); i++) {
+        [argsArray addObject:args[i].getNSString()];
+    }
+    
+    QWidget *widget = new QWidget();
+    widget->setView([[WebCoreViewFactory sharedFactory]
+        viewForPluginWithURL:part->completeURL(url).url().getNSString()
+                    serviceType:serviceType.getNSString()
+                    arguments:argsArray
+                        baseURL:m_baseURL.url().getNSString()]);
+    frame->setWidget(widget);
+    
+    return true;
 }
 
 void KWQKHTMLPartImpl::submitForm( const char *action, const QString &url, const QByteArray &formData, const QString &_target, const QString& contentType, const QString& boundary )
@@ -569,9 +530,6 @@ void KWQKHTMLPartImpl::submitForm( const char *action, const QString &url, const
     return;
 #endif
 
-  NSMutableDictionary *attributes = [NSMutableDictionary dictionary];
-  unsigned loadFlags = 0;
-
 #ifdef NEED_THIS
   KParts::URLArgs args;
 
@@ -588,7 +546,7 @@ void KWQKHTMLPartImpl::submitForm( const char *action, const QString &url, const
   if ( strcmp( action, "get" ) == 0 )
   {
     u.setQuery( QString( formData.data(), formData.size() ) );
-    [attributes setObject:@"GET" forKey:IFHTTPURLHandleRequestMethod];
+    [bridge loadURL:u.getNSURL()];
 
 #ifdef NEED_THIS
     args.frameName = target;
@@ -608,14 +566,8 @@ void KWQKHTMLPartImpl::submitForm( const char *action, const QString &url, const
     else // contentType must be "multipart/form-data"
       args.setContentType( "Content-Type: " + contentType + "; boundary=" + boundary );
 #endif
-      NSData *postData = [NSData dataWithBytes:formData.data() length:formData.size()];
-      [attributes setObject:postData forKey:IFHTTPURLHandleRequestData];
-      [attributes setObject:@"POST" forKey:IFHTTPURLHandleRequestMethod];
-      // When posting, use the IFURLHandleFlagLoadFromOrigin load flag. 
-      // This prevents a potential bug which may cause a page
-      // with a form that uses itself as an action to be returned 
-      // from the cache without submitting.
-      loadFlags = IFURLHandleFlagLoadFromOrigin;
+    NSData *postData = [NSData dataWithBytes:formData.data() length:formData.size()];
+    [bridge postWithURL:u.getNSURL() data:postData];
   }
 
 #ifdef NEED_THIS
@@ -635,35 +587,23 @@ void KWQKHTMLPartImpl::submitForm( const char *action, const QString &url, const
   else
     emit d->m_extension->openURLRequest( u, args );
 #endif
-    IFWebDataSource *oldDataSource, *newDataSource;
-    IFWebFrame *frame;
-    
-    oldDataSource = getDataSource();
-    frame = [oldDataSource webFrame];
-
-    newDataSource = WCIFWebDataSourceMake(u.getNSURL(), attributes, loadFlags);
-    [newDataSource _setParent: [oldDataSource parent]];
-    
-    [frame setProvisionalDataSource: newDataSource];
-    [frame startLoading];
 }
 
 bool KWQKHTMLPartImpl::frameExists( const QString &frameName )
 {
-    return [getDataSource() frameExists: (NSString *)frameName.getCFMutableString()];
+    return [bridge frameNamed:frameName.getNSString()];
 }
 
 QPtrList<KParts::ReadOnlyPart> KWQKHTMLPartImpl::frames() const
 {
     QPtrList<KParts::ReadOnlyPart> res;
-    IFWebDataSource *thisDataSource = ((KWQKHTMLPartImpl *)this)->getDataSource();
-    NSArray *children = [thisDataSource children];
-    IFWebFrame *aFrame;
+    NSArray *children = [bridge children];
+    WebCoreBridge *childPart;
     unsigned int i;
     
     for (i = 0; i < [children count]; i++){
-        aFrame = [children objectAtIndex: i];
-        res.append( [[[aFrame dataSource] representation] part] );
+        childPart = [children objectAtIndex: i];
+        res.append([childPart part]);
     }
     return res;
 }
@@ -692,24 +632,15 @@ void KWQKHTMLPartImpl::setView(KHTMLView *view)
 
 void KWQKHTMLPartImpl::setTitle(const DOMString &title)
 {
-    [getDataSource() _setTitle:title.string().getNSString()];
-}
-
-void KWQKHTMLPartImpl::setDataSource(IFWebDataSource *dataSource)
-{
-    m_dataSource = dataSource; // not retained
+    [bridge setTitle:title.string().getNSString()];
 }
 
 IFWebDataSource *KWQKHTMLPartImpl::getDataSource()
 {
-    return m_dataSource;
+    return [bridge dataSource];
 }
 
-
 KHTMLPart *KWQKHTMLPartImpl::parentPart()
 {
-    IFWebDataSource *parent, *dataSource = getDataSource();
-    
-    parent = [dataSource parent];
-    return [[parent representation] part];
+    return [[bridge parent] part];
 }
diff --git a/WebCore/kwq/KWQKHTMLPartBrowserExtension.mm b/WebCore/kwq/KWQKHTMLPartBrowserExtension.mm
index 59a4dc6..cba08e3 100644
--- a/WebCore/kwq/KWQKHTMLPartBrowserExtension.mm
+++ b/WebCore/kwq/KWQKHTMLPartBrowserExtension.mm
@@ -25,7 +25,7 @@
 
 #import <khtml/khtml_ext.h>
 #import <khtml_part.h>
-#import <external.h>
+#import <WebCoreBridge.h>
 #import <KWQKHTMLPartImpl.h>
 
 KHTMLPartBrowserExtension::KHTMLPartBrowserExtension(KHTMLPart *part)
@@ -56,10 +56,14 @@ void KHTMLPartBrowserExtension::createNewWindow(const KURL &url,
 void KHTMLPartBrowserExtension::createNewWindow(const KURL &url, 
 						const KParts::URLArgs &urlArgs, 
 						const KParts::WindowArgs &winArgs, 
-						KParts::ReadOnlyPart **part)
+						KParts::ReadOnlyPart **partResult)
 { 
-    IFWebController *newController = [[m_part->impl->getDataSource() controller] openNewWindowWithURL:url.getNSURL()];
-    if (part != NULL) {
-	*part = [[[[newController mainFrame] provisionalDataSource] representation] part];
+    [m_part->impl->getBridge() openNewWindowWithURL:url.getNSURL()];
+    
+    // We can't return a KHTMLPart in all cases, because the new window might not even
+    // have HTML in it. And we don't create the KHTMLPart until we become "committed".
+    // So it's better not to try to return the KHTMLPart, and no callers currently need it.
+    if (partResult) {
+	*partResult = 0;
     }
 }
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.h b/WebCore/kwq/KWQKHTMLPartImpl.h
index 647d139..3a7e883 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.h
+++ b/WebCore/kwq/KWQKHTMLPartImpl.h
@@ -27,8 +27,10 @@
 
 #ifdef __OBJC__
 @class IFWebDataSource;
+ at class WebCoreBridge;
 #else
 class IFWebDataSource;
+class WebCoreBridge;
 #endif
 
 class KWQKHTMLPartImpl : public QObject
@@ -37,6 +39,8 @@ public:
     KWQKHTMLPartImpl(KHTMLPart *);
     ~KWQKHTMLPartImpl();
     
+    void setBridge(WebCoreBridge *p) { bridge = p; }
+    WebCoreBridge *getBridge() const { return bridge; }
     void setView(KHTMLView *view);
 
     bool openURLInFrame(const KURL &, const KParts::URLArgs &);
@@ -59,7 +63,6 @@ public:
     
     QString documentSource() const;
 
-    void setDataSource(IFWebDataSource *);
     IFWebDataSource *getDataSource();
 
     bool frameExists(const QString &frameName);
@@ -76,13 +79,14 @@ public:
 private:
     KHTMLPart *part;
     KHTMLPartPrivate *d;
+    
+    WebCoreBridge *bridge;
 
     int m_redirectionTimer;
     
     KURL m_baseURL;
     QString m_documentSource;
     bool m_decodingStarted;
-    IFWebDataSource *m_dataSource;
     
     friend class KHTMLPart;
 };
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.mm b/WebCore/kwq/KWQKHTMLPartImpl.mm
index fb3beee..a4bad96 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.mm
+++ b/WebCore/kwq/KWQKHTMLPartImpl.mm
@@ -35,21 +35,14 @@
 
 #import <khtmlpart_p.h>
 
-#import <WCPluginWidget.h>
+#import <WebCoreViewFactory.h>
+#import <WebCoreBridge.h>
 #import <WCWebDataSource.h>
-#import <external.h>
 
 #import <kwqdebug.h>
 
 #undef _KWQ_TIMING
 
-static WCIFWebDataSourceMakeFunc WCIFWebDataSourceMake;
-
-void WCSetIFWebDataSourceMakeFunc(WCIFWebDataSourceMakeFunc func)
-{
-    WCIFWebDataSourceMake = func;
-}
-
 static void recursive(const DOM::Node &pNode, const DOM::Node &node)
 {
     DOM::Node cur_child = node.lastChild();
@@ -68,7 +61,6 @@ KWQKHTMLPartImpl::KWQKHTMLPartImpl(KHTMLPart *p)
     , d(part->d)
     , m_redirectionTimer(0)
     , m_decodingStarted(false)
-    , m_dataSource(0)
 {
 }
 
@@ -79,29 +71,20 @@ KWQKHTMLPartImpl::~KWQKHTMLPartImpl()
 
 bool KWQKHTMLPartImpl::openURLInFrame( const KURL &url, const KParts::URLArgs &urlArgs )
 {
-  IFWebDataSource *oldDataSource, *newDataSource;
-  IFWebFrame *frame;
-
+    WebCoreBridge *frame;
 
-  if (!urlArgs.frameName.isEmpty()) {
-    frame = [[getDataSource() controller] frameNamed: QSTRING_TO_NSSTRING(urlArgs.frameName)];
-    oldDataSource = [frame dataSource];
-  } else {
-      oldDataSource = getDataSource();
-      frame = [oldDataSource webFrame];
-  }
-
-  if (frame == nil) {
-    frame = [[getDataSource() controller] mainFrame];
-  }
-
-  newDataSource = WCIFWebDataSourceMake(url.getNSURL(), nil, 0);
-  [newDataSource _setParent: [oldDataSource parent]];
+    if (!urlArgs.frameName.isEmpty()) {
+        frame = [bridge frameNamed:urlArgs.frameName.getNSString()];
+        if (frame == nil) {
+            frame = [bridge mainFrame];
+        }
+    } else {
+        frame = bridge;
+    }
 
-  [frame setProvisionalDataSource: newDataSource];
-  [frame startLoading];
+    [frame loadURL:url.getNSURL()];
 
-  return true;
+    return true;
 }
 
 void KWQKHTMLPartImpl::openURL(const KURL &url)
@@ -398,10 +381,9 @@ void KWQKHTMLPartImpl::redirectURL()
 
 void KWQKHTMLPartImpl::urlSelected( const QString &url, int button, int state, const QString &_target, KParts::URLArgs )
 {
-    IFWebDataSource *oldDataSource, *newDataSource;
     KURL clickedURL(part->completeURL( url));
-    IFWebFrame *frame, *currentFrame;
     KURL refLess(clickedURL);
+    WebCoreBridge *frame;
 	
     if ( url.find( QString::fromLatin1( "javascript:" ), 0, false ) == 0 )
     {
@@ -411,7 +393,7 @@ void KWQKHTMLPartImpl::urlSelected( const QString &url, int button, int state, c
 
     // Open new window on command-click
     if (state & MetaButton) {
-        [[getDataSource() controller] openNewWindowWithURL:clickedURL.getNSURL()];
+        [bridge openNewWindowWithURL:clickedURL.getNSURL()];
         return;
     }
 
@@ -423,86 +405,52 @@ void KWQKHTMLPartImpl::urlSelected( const QString &url, int button, int state, c
         return;
     }
     
-    oldDataSource = getDataSource();
-    currentFrame = [oldDataSource webFrame];
-    if (_target.isEmpty()){
-        // If we're the only frame in a frameset then pop
-        // the frame.
-        if ([[[oldDataSource parent] children] count] == 1){
-            frame = [[oldDataSource parent] webFrame];
+    if (_target.isEmpty()) {
+        // If we're the only frame in a frameset then pop the frame.
+        if ([[[bridge parent] children] count] == 1) {
+            frame = [bridge parent];
+        } else {
+            frame = bridge;
         }
-        else
-            frame = currentFrame;
     }
     else {
-        frame = [currentFrame frameNamed: QSTRING_TO_NSSTRING(_target)];
-        if (frame == nil){
-            // FIXME:  What is the correct behavior here?
-            NSLog (@"ERROR:  unable to find frame named %@\n",
-                        QSTRING_TO_NSSTRING(_target));
+        frame = [bridge frameNamed:_target.getNSString()];
+        if (frame == nil) {
+            // FIXME: What is the correct behavior here? Other browsers seem to open new windows.
+            NSLog (@"ERROR: unable to find frame named %@\n", _target.getNSString());
             return;
         }
-        oldDataSource = [frame dataSource];
     }
     
-    newDataSource = WCIFWebDataSourceMake(clickedURL.getNSURL(), nil, 0);
-    [newDataSource _setParent: [oldDataSource parent]];
-    
-    [frame setProvisionalDataSource: newDataSource];
-    [frame startLoading];
+    [frame loadURL:clickedURL.getNSURL()];
 }
 
 bool KWQKHTMLPartImpl::requestFrame( khtml::RenderPart *frame, const QString &url, const QString &frameName,
                                      const QStringList &params, bool isIFrame )
 {
-    NSString *nsframeName = QSTRING_TO_NSSTRING(frameName);
-    IFWebFrame *aFrame;
-    IFWebDataSource *dataSource;
-    
-    dataSource = getDataSource();
-
-    KWQDEBUGLEVEL (KWQ_LOG_FRAMES, "name %s\n", [nsframeName cString]);
-    aFrame =[dataSource frameNamed: nsframeName];
-    if (aFrame){
-        KWQDEBUGLEVEL (KWQ_LOG_FRAMES, "found %s\n", [nsframeName cString]);
-        QWidget *khtmlview = [[[aFrame webView] documentView] _provisionalWidget];
-        if (khtmlview)
-            frame->setWidget (khtmlview);
-        else
-            frame->setWidget ([[[aFrame webView] documentView] _widget]);
+    NSString *name = frameName.getNSString();
+
+    KWQDEBUGLEVEL(KWQ_LOG_FRAMES, "name %s\n", DEBUG_OBJECT(name));
+    WebCoreBridge *framePart = [bridge frameNamed:name];
+    if (framePart) {
+        KWQDEBUGLEVEL(KWQ_LOG_FRAMES, "found %s\n", DEBUG_OBJECT(name));
+        frame->setWidget([framePart widget]);
     }
     else {        
-        KWQDEBUGLEVEL (KWQ_LOG_FRAMES, "creating %s\n", [nsframeName cString]);
-        IFWebDataSource *oldDataSource, *newDataSource;
-        NSURL *childURL;
-        IFWebFrame *newFrame;
-        IFWebController *controller;
-        HTMLIFrameElementImpl *o = static_cast<HTMLIFrameElementImpl *>(frame->element());
-                
-        childURL = part->completeURL(url).getNSURL();
+        KWQDEBUGLEVEL(KWQ_LOG_FRAMES, "creating %s\n", DEBUG_OBJECT(name));
+        
+        NSURL *childURL = part->completeURL(url).getNSURL();
         if (childURL == nil || [childURL path] == nil) {
             NSLog (@"ERROR (probably need to fix CFURL): unable to create URL with path");
             return false;
         }
         
-        oldDataSource = getDataSource();
-        controller = [oldDataSource controller];
-        newFrame = [controller createFrameNamed: nsframeName for: nil inParent: oldDataSource inScrollView: o->scrollingMode() != QScrollView::AlwaysOff];
-        if (newFrame == nil) {
-            // Controller return NO to location change, now what?
+        HTMLIFrameElementImpl *o = static_cast<HTMLIFrameElementImpl *>(frame->element());
+        if (![bridge createNewFrameNamed:name withURL:childURL
+                renderPart:frame allowsScrolling:o->scrollingMode() != QScrollView::AlwaysOff
+                marginWidth:o->getMarginWidth() marginHeight:o->getMarginHeight()]) {
             return false;
         }
-        [newFrame _setRenderFramePart: frame];
-        
-        newDataSource = WCIFWebDataSourceMake(childURL, nil, 0);
-        [newDataSource _setParent: oldDataSource];
-        [newFrame setProvisionalDataSource: newDataSource];
-    
-        
-        [[newFrame webView] _setMarginWidth: o->getMarginWidth()];
-        [[newFrame webView] _setMarginHeight: o->getMarginHeight()];
-
-        [newFrame startLoading];
     }
 
 #ifdef _SUPPORT_JAVASCRIPT_URL_    
@@ -527,16 +475,29 @@ bool KWQKHTMLPartImpl::requestFrame( khtml::RenderPart *frame, const QString &ur
     return true;
 }
 
-bool KWQKHTMLPartImpl::requestObject( khtml::RenderPart *frame, const QString &url, const QString &serviceType,
-			              const QStringList &args )
+bool KWQKHTMLPartImpl::requestObject(khtml::RenderPart *frame, const QString &url, const QString &serviceType, const QStringList &args)
 {
-  if (url.isEmpty()) {
-    return false;
-  }
-  if (!frame->widget()) {
-    frame->setWidget(IFPluginWidgetCreate(part->completeURL(url).url(), serviceType, args, m_baseURL.url()));
-  }
-  return true;
+    if (url.isEmpty()) {
+        return false;
+    }
+    if (frame->widget()) {
+        return true;
+    }
+    
+    NSMutableArray *argsArray = [NSMutableArray arrayWithCapacity:args.count()];
+    for (uint i = 0; i < args.count(); i++) {
+        [argsArray addObject:args[i].getNSString()];
+    }
+    
+    QWidget *widget = new QWidget();
+    widget->setView([[WebCoreViewFactory sharedFactory]
+        viewForPluginWithURL:part->completeURL(url).url().getNSString()
+                    serviceType:serviceType.getNSString()
+                    arguments:argsArray
+                        baseURL:m_baseURL.url().getNSString()]);
+    frame->setWidget(widget);
+    
+    return true;
 }
 
 void KWQKHTMLPartImpl::submitForm( const char *action, const QString &url, const QByteArray &formData, const QString &_target, const QString& contentType, const QString& boundary )
@@ -569,9 +530,6 @@ void KWQKHTMLPartImpl::submitForm( const char *action, const QString &url, const
     return;
 #endif
 
-  NSMutableDictionary *attributes = [NSMutableDictionary dictionary];
-  unsigned loadFlags = 0;
-
 #ifdef NEED_THIS
   KParts::URLArgs args;
 
@@ -588,7 +546,7 @@ void KWQKHTMLPartImpl::submitForm( const char *action, const QString &url, const
   if ( strcmp( action, "get" ) == 0 )
   {
     u.setQuery( QString( formData.data(), formData.size() ) );
-    [attributes setObject:@"GET" forKey:IFHTTPURLHandleRequestMethod];
+    [bridge loadURL:u.getNSURL()];
 
 #ifdef NEED_THIS
     args.frameName = target;
@@ -608,14 +566,8 @@ void KWQKHTMLPartImpl::submitForm( const char *action, const QString &url, const
     else // contentType must be "multipart/form-data"
       args.setContentType( "Content-Type: " + contentType + "; boundary=" + boundary );
 #endif
-      NSData *postData = [NSData dataWithBytes:formData.data() length:formData.size()];
-      [attributes setObject:postData forKey:IFHTTPURLHandleRequestData];
-      [attributes setObject:@"POST" forKey:IFHTTPURLHandleRequestMethod];
-      // When posting, use the IFURLHandleFlagLoadFromOrigin load flag. 
-      // This prevents a potential bug which may cause a page
-      // with a form that uses itself as an action to be returned 
-      // from the cache without submitting.
-      loadFlags = IFURLHandleFlagLoadFromOrigin;
+    NSData *postData = [NSData dataWithBytes:formData.data() length:formData.size()];
+    [bridge postWithURL:u.getNSURL() data:postData];
   }
 
 #ifdef NEED_THIS
@@ -635,35 +587,23 @@ void KWQKHTMLPartImpl::submitForm( const char *action, const QString &url, const
   else
     emit d->m_extension->openURLRequest( u, args );
 #endif
-    IFWebDataSource *oldDataSource, *newDataSource;
-    IFWebFrame *frame;
-    
-    oldDataSource = getDataSource();
-    frame = [oldDataSource webFrame];
-
-    newDataSource = WCIFWebDataSourceMake(u.getNSURL(), attributes, loadFlags);
-    [newDataSource _setParent: [oldDataSource parent]];
-    
-    [frame setProvisionalDataSource: newDataSource];
-    [frame startLoading];
 }
 
 bool KWQKHTMLPartImpl::frameExists( const QString &frameName )
 {
-    return [getDataSource() frameExists: (NSString *)frameName.getCFMutableString()];
+    return [bridge frameNamed:frameName.getNSString()];
 }
 
 QPtrList<KParts::ReadOnlyPart> KWQKHTMLPartImpl::frames() const
 {
     QPtrList<KParts::ReadOnlyPart> res;
-    IFWebDataSource *thisDataSource = ((KWQKHTMLPartImpl *)this)->getDataSource();
-    NSArray *children = [thisDataSource children];
-    IFWebFrame *aFrame;
+    NSArray *children = [bridge children];
+    WebCoreBridge *childPart;
     unsigned int i;
     
     for (i = 0; i < [children count]; i++){
-        aFrame = [children objectAtIndex: i];
-        res.append( [[[aFrame dataSource] representation] part] );
+        childPart = [children objectAtIndex: i];
+        res.append([childPart part]);
     }
     return res;
 }
@@ -692,24 +632,15 @@ void KWQKHTMLPartImpl::setView(KHTMLView *view)
 
 void KWQKHTMLPartImpl::setTitle(const DOMString &title)
 {
-    [getDataSource() _setTitle:title.string().getNSString()];
-}
-
-void KWQKHTMLPartImpl::setDataSource(IFWebDataSource *dataSource)
-{
-    m_dataSource = dataSource; // not retained
+    [bridge setTitle:title.string().getNSString()];
 }
 
 IFWebDataSource *KWQKHTMLPartImpl::getDataSource()
 {
-    return m_dataSource;
+    return [bridge dataSource];
 }
 
-
 KHTMLPart *KWQKHTMLPartImpl::parentPart()
 {
-    IFWebDataSource *parent, *dataSource = getDataSource();
-    
-    parent = [dataSource parent];
-    return [[parent representation] part];
+    return [[bridge parent] part];
 }
diff --git a/WebCore/kwq/KWQKloader.mm b/WebCore/kwq/KWQKloader.mm
index bdfe7a4..c5a59ad 100644
--- a/WebCore/kwq/KWQKloader.mm
+++ b/WebCore/kwq/KWQKloader.mm
@@ -29,11 +29,64 @@
 #include <misc/loader.h>
 #include <KWQKHTMLPartImpl.h>
 
-#include <external.h>
 #include <WCLoadProgress.h>
 
 #include <kwqdebug.h>
 
+// ==== start of temporary section, formerly from external.h, to be killed ====
+
+ at class IFWebDataSource;
+ at class IFLoadProgress;
+
+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 IFLocationChangeHandler
+- (void)serverRedirectTo: (NSURL *)url forDataSource: (IFWebDataSource *)dataSource;
+ at end
+
+ at interface IFWebController <IFLocationChangeHandler>
+- (void)_receivedProgress: (IFLoadProgress *)progress forResource: (NSString *)resourceDescription fromDataSource: (IFWebDataSource *)dataSource;
+- (void)_receivedError: (IFError *)error forResource: (NSString *)resourceDescription partialProgress: (IFLoadProgress *)progress fromDataSource: (IFWebDataSource *)dataSource;
+- (void)_mainReceivedProgress: (IFLoadProgress *)progress forResource: (NSString *)resourceDescription fromDataSource: (IFWebDataSource *)dataSource;
+- (void)_mainReceivedError: (IFError *)error forResource: (NSString *)resourceDescription partialProgress: (IFLoadProgress *)progress fromDataSource: (IFWebDataSource *)dataSource;
+- (void)_didStartLoading: (NSURL *)url;
+- (void)_didStopLoading: (NSURL *)url;
+ at end
+
+ at interface IFWebDataSource : NSObject
+- (IFWebController *)controller;
+- (void)_addURLHandle: (IFURLHandle *)handle;
+- (void)_removeURLHandle: (IFURLHandle *)handle;
+- (void)_setFinalURL: (NSURL *)url;
+- representation;
+ at end
+
+ at interface IFHTMLRepresentation : NSObject
+- (KHTMLPart *)part;
+ 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
+
+// ==== end of temporary section, formerly from external.h, to be killed ====
+
 using khtml::DocLoader;
 using khtml::Loader;
 using khtml::Request;
@@ -45,9 +98,19 @@ void WCSetIFLoadProgressMakeFunc(WCIFLoadProgressMakeFunc func)
     WCIFLoadProgressMake = func;
 }
 
- at implementation URLLoadClient
+ at interface KWQURLLoadClient : NSObject <IFURLHandleClient>
+{
+    khtml::Loader *m_loader;
+    IFWebDataSource *m_dataSource;
+}
 
--(id)initWithLoader:(Loader *)loader dataSource: dataSource
+-(id)initWithLoader:(khtml::Loader *)loader dataSource:(IFWebDataSource *)dataSource;
+
+ at end
+
+ at implementation KWQURLLoadClient
+
+-(id)initWithLoader:(Loader *)loader dataSource:(IFWebDataSource *)dataSource
 {
     if ((self = [super init])) {
         m_loader = loader;
@@ -67,8 +130,8 @@ void WCSetIFLoadProgressMakeFunc(WCIFLoadProgressMakeFunc func)
 - (void)IFURLHandleResourceDidBeginLoading:(IFURLHandle *)sender
 {
     id controller;
-	int contentLength = [sender contentLength];
-	int contentLengthReceived = [sender contentLengthReceived];
+    int contentLength = [sender contentLength];
+    int contentLengthReceived = [sender contentLengthReceived];
     void *userData;
 
     userData = [[sender attributeForKey:IFURLHandleUserData] pointerValue];
@@ -226,7 +289,7 @@ KWQLoaderImpl::~KWQLoaderImpl()
 void KWQLoaderImpl::setClient(Request *req)
 {
     IFWebDataSource *dataSource = ((KHTMLPart *)((DocLoader *)req->object->loader())->part())->impl->getDataSource();
-    req->client = [[[URLLoadClient alloc] initWithLoader:loader dataSource: dataSource] autorelease];
+    req->client = [[[KWQURLLoadClient alloc] initWithLoader:loader dataSource: dataSource] autorelease];
 }
 
 void KWQLoaderImpl::serveRequest(Request *req, KIO::TransferJob *job)
@@ -235,17 +298,17 @@ void KWQLoaderImpl::serveRequest(Request *req, KIO::TransferJob *job)
           req->m_docLoader->part()->baseURL().url().latin1(), req->object->url().string().latin1());
     //job->begin(d->m_recv, job);
     
-    job->begin((URLLoadClient *)req->client, job);
-    if (job->handle() == nil){
+    job->begin(req->client, job);
+    if (job->handle() == nil) {
         // Must be a malformed URL.
         NSString *urlString = QSTRING_TO_NSSTRING(req->object->url().string());
         IFError *error = [IFError errorWithCode:IFURLHandleResultBadURLError inDomain:IFErrorCodeDomainWebFoundation isTerminal:YES];
 
-        id <IFLoadHandler> controller = [((URLLoadClient *)req->client)->m_dataSource controller];
-        [(IFWebController *)controller _receivedError: error forResource: urlString partialProgress: nil fromDataSource: ((URLLoadClient *)req->client)->m_dataSource];
+        id <IFLoadHandler> controller = [(req->client)->m_dataSource controller];
+        [(IFWebController *)controller _receivedError: error forResource: urlString partialProgress: nil fromDataSource: req->client->m_dataSource];
     }
     else {
-        [((URLLoadClient *)req->client)->m_dataSource _addURLHandle: job->handle()];
+        [req->client->m_dataSource _addURLHandle: job->handle()];
     }
 }
 
diff --git a/WebCore/kwq/KWQLoader.mm b/WebCore/kwq/KWQLoader.mm
index bdfe7a4..c5a59ad 100644
--- a/WebCore/kwq/KWQLoader.mm
+++ b/WebCore/kwq/KWQLoader.mm
@@ -29,11 +29,64 @@
 #include <misc/loader.h>
 #include <KWQKHTMLPartImpl.h>
 
-#include <external.h>
 #include <WCLoadProgress.h>
 
 #include <kwqdebug.h>
 
+// ==== start of temporary section, formerly from external.h, to be killed ====
+
+ at class IFWebDataSource;
+ at class IFLoadProgress;
+
+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 IFLocationChangeHandler
+- (void)serverRedirectTo: (NSURL *)url forDataSource: (IFWebDataSource *)dataSource;
+ at end
+
+ at interface IFWebController <IFLocationChangeHandler>
+- (void)_receivedProgress: (IFLoadProgress *)progress forResource: (NSString *)resourceDescription fromDataSource: (IFWebDataSource *)dataSource;
+- (void)_receivedError: (IFError *)error forResource: (NSString *)resourceDescription partialProgress: (IFLoadProgress *)progress fromDataSource: (IFWebDataSource *)dataSource;
+- (void)_mainReceivedProgress: (IFLoadProgress *)progress forResource: (NSString *)resourceDescription fromDataSource: (IFWebDataSource *)dataSource;
+- (void)_mainReceivedError: (IFError *)error forResource: (NSString *)resourceDescription partialProgress: (IFLoadProgress *)progress fromDataSource: (IFWebDataSource *)dataSource;
+- (void)_didStartLoading: (NSURL *)url;
+- (void)_didStopLoading: (NSURL *)url;
+ at end
+
+ at interface IFWebDataSource : NSObject
+- (IFWebController *)controller;
+- (void)_addURLHandle: (IFURLHandle *)handle;
+- (void)_removeURLHandle: (IFURLHandle *)handle;
+- (void)_setFinalURL: (NSURL *)url;
+- representation;
+ at end
+
+ at interface IFHTMLRepresentation : NSObject
+- (KHTMLPart *)part;
+ 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
+
+// ==== end of temporary section, formerly from external.h, to be killed ====
+
 using khtml::DocLoader;
 using khtml::Loader;
 using khtml::Request;
@@ -45,9 +98,19 @@ void WCSetIFLoadProgressMakeFunc(WCIFLoadProgressMakeFunc func)
     WCIFLoadProgressMake = func;
 }
 
- at implementation URLLoadClient
+ at interface KWQURLLoadClient : NSObject <IFURLHandleClient>
+{
+    khtml::Loader *m_loader;
+    IFWebDataSource *m_dataSource;
+}
 
--(id)initWithLoader:(Loader *)loader dataSource: dataSource
+-(id)initWithLoader:(khtml::Loader *)loader dataSource:(IFWebDataSource *)dataSource;
+
+ at end
+
+ at implementation KWQURLLoadClient
+
+-(id)initWithLoader:(Loader *)loader dataSource:(IFWebDataSource *)dataSource
 {
     if ((self = [super init])) {
         m_loader = loader;
@@ -67,8 +130,8 @@ void WCSetIFLoadProgressMakeFunc(WCIFLoadProgressMakeFunc func)
 - (void)IFURLHandleResourceDidBeginLoading:(IFURLHandle *)sender
 {
     id controller;
-	int contentLength = [sender contentLength];
-	int contentLengthReceived = [sender contentLengthReceived];
+    int contentLength = [sender contentLength];
+    int contentLengthReceived = [sender contentLengthReceived];
     void *userData;
 
     userData = [[sender attributeForKey:IFURLHandleUserData] pointerValue];
@@ -226,7 +289,7 @@ KWQLoaderImpl::~KWQLoaderImpl()
 void KWQLoaderImpl::setClient(Request *req)
 {
     IFWebDataSource *dataSource = ((KHTMLPart *)((DocLoader *)req->object->loader())->part())->impl->getDataSource();
-    req->client = [[[URLLoadClient alloc] initWithLoader:loader dataSource: dataSource] autorelease];
+    req->client = [[[KWQURLLoadClient alloc] initWithLoader:loader dataSource: dataSource] autorelease];
 }
 
 void KWQLoaderImpl::serveRequest(Request *req, KIO::TransferJob *job)
@@ -235,17 +298,17 @@ void KWQLoaderImpl::serveRequest(Request *req, KIO::TransferJob *job)
           req->m_docLoader->part()->baseURL().url().latin1(), req->object->url().string().latin1());
     //job->begin(d->m_recv, job);
     
-    job->begin((URLLoadClient *)req->client, job);
-    if (job->handle() == nil){
+    job->begin(req->client, job);
+    if (job->handle() == nil) {
         // Must be a malformed URL.
         NSString *urlString = QSTRING_TO_NSSTRING(req->object->url().string());
         IFError *error = [IFError errorWithCode:IFURLHandleResultBadURLError inDomain:IFErrorCodeDomainWebFoundation isTerminal:YES];
 
-        id <IFLoadHandler> controller = [((URLLoadClient *)req->client)->m_dataSource controller];
-        [(IFWebController *)controller _receivedError: error forResource: urlString partialProgress: nil fromDataSource: ((URLLoadClient *)req->client)->m_dataSource];
+        id <IFLoadHandler> controller = [(req->client)->m_dataSource controller];
+        [(IFWebController *)controller _receivedError: error forResource: urlString partialProgress: nil fromDataSource: req->client->m_dataSource];
     }
     else {
-        [((URLLoadClient *)req->client)->m_dataSource _addURLHandle: job->handle()];
+        [req->client->m_dataSource _addURLHandle: job->handle()];
     }
 }
 
diff --git a/WebCore/kwq/KWQLoaderImpl.mm b/WebCore/kwq/KWQLoaderImpl.mm
index bdfe7a4..c5a59ad 100644
--- a/WebCore/kwq/KWQLoaderImpl.mm
+++ b/WebCore/kwq/KWQLoaderImpl.mm
@@ -29,11 +29,64 @@
 #include <misc/loader.h>
 #include <KWQKHTMLPartImpl.h>
 
-#include <external.h>
 #include <WCLoadProgress.h>
 
 #include <kwqdebug.h>
 
+// ==== start of temporary section, formerly from external.h, to be killed ====
+
+ at class IFWebDataSource;
+ at class IFLoadProgress;
+
+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 IFLocationChangeHandler
+- (void)serverRedirectTo: (NSURL *)url forDataSource: (IFWebDataSource *)dataSource;
+ at end
+
+ at interface IFWebController <IFLocationChangeHandler>
+- (void)_receivedProgress: (IFLoadProgress *)progress forResource: (NSString *)resourceDescription fromDataSource: (IFWebDataSource *)dataSource;
+- (void)_receivedError: (IFError *)error forResource: (NSString *)resourceDescription partialProgress: (IFLoadProgress *)progress fromDataSource: (IFWebDataSource *)dataSource;
+- (void)_mainReceivedProgress: (IFLoadProgress *)progress forResource: (NSString *)resourceDescription fromDataSource: (IFWebDataSource *)dataSource;
+- (void)_mainReceivedError: (IFError *)error forResource: (NSString *)resourceDescription partialProgress: (IFLoadProgress *)progress fromDataSource: (IFWebDataSource *)dataSource;
+- (void)_didStartLoading: (NSURL *)url;
+- (void)_didStopLoading: (NSURL *)url;
+ at end
+
+ at interface IFWebDataSource : NSObject
+- (IFWebController *)controller;
+- (void)_addURLHandle: (IFURLHandle *)handle;
+- (void)_removeURLHandle: (IFURLHandle *)handle;
+- (void)_setFinalURL: (NSURL *)url;
+- representation;
+ at end
+
+ at interface IFHTMLRepresentation : NSObject
+- (KHTMLPart *)part;
+ 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
+
+// ==== end of temporary section, formerly from external.h, to be killed ====
+
 using khtml::DocLoader;
 using khtml::Loader;
 using khtml::Request;
@@ -45,9 +98,19 @@ void WCSetIFLoadProgressMakeFunc(WCIFLoadProgressMakeFunc func)
     WCIFLoadProgressMake = func;
 }
 
- at implementation URLLoadClient
+ at interface KWQURLLoadClient : NSObject <IFURLHandleClient>
+{
+    khtml::Loader *m_loader;
+    IFWebDataSource *m_dataSource;
+}
 
--(id)initWithLoader:(Loader *)loader dataSource: dataSource
+-(id)initWithLoader:(khtml::Loader *)loader dataSource:(IFWebDataSource *)dataSource;
+
+ at end
+
+ at implementation KWQURLLoadClient
+
+-(id)initWithLoader:(Loader *)loader dataSource:(IFWebDataSource *)dataSource
 {
     if ((self = [super init])) {
         m_loader = loader;
@@ -67,8 +130,8 @@ void WCSetIFLoadProgressMakeFunc(WCIFLoadProgressMakeFunc func)
 - (void)IFURLHandleResourceDidBeginLoading:(IFURLHandle *)sender
 {
     id controller;
-	int contentLength = [sender contentLength];
-	int contentLengthReceived = [sender contentLengthReceived];
+    int contentLength = [sender contentLength];
+    int contentLengthReceived = [sender contentLengthReceived];
     void *userData;
 
     userData = [[sender attributeForKey:IFURLHandleUserData] pointerValue];
@@ -226,7 +289,7 @@ KWQLoaderImpl::~KWQLoaderImpl()
 void KWQLoaderImpl::setClient(Request *req)
 {
     IFWebDataSource *dataSource = ((KHTMLPart *)((DocLoader *)req->object->loader())->part())->impl->getDataSource();
-    req->client = [[[URLLoadClient alloc] initWithLoader:loader dataSource: dataSource] autorelease];
+    req->client = [[[KWQURLLoadClient alloc] initWithLoader:loader dataSource: dataSource] autorelease];
 }
 
 void KWQLoaderImpl::serveRequest(Request *req, KIO::TransferJob *job)
@@ -235,17 +298,17 @@ void KWQLoaderImpl::serveRequest(Request *req, KIO::TransferJob *job)
           req->m_docLoader->part()->baseURL().url().latin1(), req->object->url().string().latin1());
     //job->begin(d->m_recv, job);
     
-    job->begin((URLLoadClient *)req->client, job);
-    if (job->handle() == nil){
+    job->begin(req->client, job);
+    if (job->handle() == nil) {
         // Must be a malformed URL.
         NSString *urlString = QSTRING_TO_NSSTRING(req->object->url().string());
         IFError *error = [IFError errorWithCode:IFURLHandleResultBadURLError inDomain:IFErrorCodeDomainWebFoundation isTerminal:YES];
 
-        id <IFLoadHandler> controller = [((URLLoadClient *)req->client)->m_dataSource controller];
-        [(IFWebController *)controller _receivedError: error forResource: urlString partialProgress: nil fromDataSource: ((URLLoadClient *)req->client)->m_dataSource];
+        id <IFLoadHandler> controller = [(req->client)->m_dataSource controller];
+        [(IFWebController *)controller _receivedError: error forResource: urlString partialProgress: nil fromDataSource: req->client->m_dataSource];
     }
     else {
-        [((URLLoadClient *)req->client)->m_dataSource _addURLHandle: job->handle()];
+        [req->client->m_dataSource _addURLHandle: job->handle()];
     }
 }
 
diff --git a/WebCore/kwq/KWQMap.h b/WebCore/kwq/KWQMap.h
index ed4720c..43a442f 100644
--- a/WebCore/kwq/KWQMap.h
+++ b/WebCore/kwq/KWQMap.h
@@ -31,7 +31,7 @@
 #include <KWQMapImpl.h>
 
 #ifdef _KWQ_IOSTREAM_
-#include <iostream>
+#include <ostream>
 #endif
 
 template <class K, class V> class QMap;
diff --git a/WebCore/kwq/KWQMemArray.h b/WebCore/kwq/KWQMemArray.h
index 76c2d45..88fa79b 100644
--- a/WebCore/kwq/KWQMemArray.h
+++ b/WebCore/kwq/KWQMemArray.h
@@ -29,6 +29,10 @@
 #include <KWQDef.h>
 #include <KWQArrayImpl.h>
 
+#ifdef _KWQ_IOSTREAM_
+#include <ostream>
+#endif
+
 template <class T> class QMemArray {
 public:
     QMemArray() : impl(sizeof(T)) {}
@@ -56,8 +60,6 @@ public:
 
 #ifdef _KWQ_IOSTREAM_
 
-#include <iostream>
-
 template<class T>
 inline std::ostream &operator<<(std::ostream &stream, const QMemArray<T>&a)
 {
diff --git a/WebCore/kwq/KWQPointArray.h b/WebCore/kwq/KWQPointArray.h
index 6864a8d..38c96d7 100644
--- a/WebCore/kwq/KWQPointArray.h
+++ b/WebCore/kwq/KWQPointArray.h
@@ -29,7 +29,7 @@
 #include <KWQDef.h>
 
 #ifdef _KWQ_IOSTREAM_
-#include <iostream>
+#include <iosfwd>
 #endif
 
 #include "qarray.h"
diff --git a/WebCore/kwq/KWQPtrList.h b/WebCore/kwq/KWQPtrList.h
index 6a22a92..7b3457c 100644
--- a/WebCore/kwq/KWQPtrList.h
+++ b/WebCore/kwq/KWQPtrList.h
@@ -31,7 +31,7 @@
 #include <KWQListImpl.h>
 
 #ifdef _KWQ_IOSTREAM_
-#include <iostream>
+#include <ostream>
 #endif
 
 template <class T> class QPtrListIterator;
diff --git a/WebCore/kwq/KWQPtrVector.h b/WebCore/kwq/KWQPtrVector.h
index 5d713de..ba42067 100644
--- a/WebCore/kwq/KWQPtrVector.h
+++ b/WebCore/kwq/KWQPtrVector.h
@@ -26,13 +26,15 @@
 #ifndef QVECTOR_H_
 #define QVECTOR_H_
 
-#include <iostream>
-
 #include <KWQDef.h>
 #include <qcollection.h>
 
 #include <KWQVectorImpl.h>
 
+#ifdef _KWQ_IOSTREAM_
+#include <ostream>
+#endif
+
 class QGVector : public QPtrCollection
 {
 public:
@@ -68,6 +70,8 @@ public:
     KWQVectorImpl impl;
 };
 
+#ifdef _KWQ_IOSTREAM_
+
 template<class T>
 inline std::ostream &operator<<(std::ostream &stream, const QPtrVector<T> &v)
 {
@@ -85,3 +89,5 @@ inline std::ostream &operator<<(std::ostream &stream, const QPtrVector<T> &v)
 }
 
 #endif
+
+#endif
diff --git a/WebCore/kwq/KWQScrollView.h b/WebCore/kwq/KWQScrollView.h
index 1391020..ce1ebc6 100644
--- a/WebCore/kwq/KWQScrollView.h
+++ b/WebCore/kwq/KWQScrollView.h
@@ -28,6 +28,12 @@
 
 #include <qframe.h>
 
+#ifdef __OBJC__
+ at class NSView;
+#else
+class NSView;
+#endif
+
 class QScrollView : public QFrame {
 public:
     enum ScrollBarMode { AlwaysOff, AlwaysOn, Auto };
@@ -72,6 +78,8 @@ public:
 
     void ensureVisible(int,int);
     void ensureVisible(int,int,int,int);
+    
+    NSView *getDocumentView() const;
 };
 
 #endif
diff --git a/WebCore/kwq/KWQScrollView.mm b/WebCore/kwq/KWQScrollView.mm
index 1ae3434..417205a 100644
--- a/WebCore/kwq/KWQScrollView.mm
+++ b/WebCore/kwq/KWQScrollView.mm
@@ -27,8 +27,6 @@
 
 #include <kwqdebug.h>
 
-#include <external.h>
-
 /*
     This class implementation does NOT actually emulate the Qt QScrollView.
     Instead our WebPageView, like any other NSView can be set as the document
@@ -43,6 +41,25 @@ QScrollView::QScrollView(QWidget *parent, const char *name, int f)
 {
 }
 
+static NSView *getDocumentView(NSView *view)
+{
+    if ([view respondsToSelector:@selector(documentView)]) {
+        id untypedView = view;
+        view = [untypedView documentView];
+    }
+    return view;
+}
+
+static NSView *getDocumentView(const QWidget *widget)
+{
+    return getDocumentView(widget->getView());
+}
+
+NSView *QScrollView::getDocumentView() const
+{
+    return ::getDocumentView(this);
+}
+
 QWidget* QScrollView::viewport() const
 {
     return const_cast<QScrollView *>(this);
@@ -63,7 +80,7 @@ int QScrollView::visibleWidth() const
 #else
     NSScrollView *view = (NSScrollView *)getView();
     int visibleWidth;
-    if (view != nil && [view isKindOfClass: [NSScrollView class]]){
+    if (view != nil && [view isKindOfClass:[NSScrollView class]]){
         visibleWidth = (int)[view documentVisibleRect].size.width;
     }
     else
@@ -92,7 +109,7 @@ int QScrollView::visibleHeight() const
     NSScrollView *view = (NSScrollView *)getView();
     int visibleHeight;
     
-    if (view != nil && [view isKindOfClass: [NSScrollView class]]){
+    if (view != nil && [view isKindOfClass:[NSScrollView class]]){
         visibleHeight = (int)[view documentVisibleRect].size.height;
     }
     else
@@ -107,25 +124,19 @@ int QScrollView::visibleHeight() const
 
 int QScrollView::contentsWidth() const
 {
-    NSScrollView *view = (NSScrollView *)getView();
-    if ([view respondsToSelector: @selector(documentView)])
-        return (int)[[view documentView] bounds].size.width;
-    return (int)[view bounds].size.width;
+    return (int)[getDocumentView() bounds].size.width;
 }
 
 
 int QScrollView::contentsHeight() const
 {
-    NSScrollView *view = (NSScrollView *)getView();
-    if ([view respondsToSelector: @selector(documentView)])
-        return (int)[[view documentView] bounds].size.height;
-    return (int)[view bounds].size.height;
+    return (int)[getDocumentView() bounds].size.height;
 }
 
 int QScrollView::contentsX() const
 {
     NSScrollView *view = (NSScrollView *)getView();
-    if ([view respondsToSelector: @selector(documentView)])
+    if ([view respondsToSelector:@selector(documentView)])
         return (int)[[view documentView] bounds].origin.x;
     return 0;
 }
@@ -133,7 +144,7 @@ int QScrollView::contentsX() const
 int QScrollView::contentsY() const
 {
     NSScrollView *view = (NSScrollView *)getView();
-    if ([view respondsToSelector: @selector(documentView)])
+    if ([view respondsToSelector:@selector(documentView)])
         return (int)[[view documentView] bounds].origin.y;
     return 0;
 }
@@ -155,17 +166,11 @@ void QScrollView::scrollBy(int dx, int dy)
 
 void QScrollView::setContentsPos(int x, int y)
 {
-    NSView *view = getView();    
-    if ([view isKindOfClass: [NSScrollView class]]) {
-        NSScrollView *scrollView = (NSScrollView *)view;
-        view = [scrollView documentView];
-    }
-
     if (x < 0)
         x = 0;
     if (y < 0)
         y = 0;
-    [view scrollPoint: NSMakePoint(x,y)];
+    [getDocumentView() scrollPoint: NSMakePoint(x,y)];
 }
 
 void QScrollView::setVScrollBarMode(ScrollBarMode)
@@ -185,16 +190,8 @@ void QScrollView::addChild(QWidget* child, int x, int y)
     if (child->x() != x || child->y() != y)
         child->move(x, y);
         
-    thisView = getView();
-    if ([thisView isKindOfClass: [NSScrollView class]]) {
-        NSScrollView *scrollView = thisView;
-        thisView = [scrollView documentView];
-    }
-
-    subView = child->getView();
-    if ([subView isKindOfClass: [NSScrollView class]]) {
-        subView = [subView superview];
-    }
+    thisView = getDocumentView();
+    subView = ::getDocumentView(child);
 
     if ([subView superview] == thisView) {
         return;
@@ -214,21 +211,20 @@ void QScrollView::removeChild(QWidget* child)
 void QScrollView::resizeContents(int w, int h)
 {
     KWQDEBUGLEVEL (KWQ_LOG_FRAMES, "%p %s at w %d h %d\n", getView(), [[[getView() class] className] cString], w, h);
-    if ([getView() isKindOfClass: [NSScrollView class]]){
-        NSScrollView *scrollView = (NSScrollView *)getView();
-        IFWebView *wview = [scrollView documentView];
+    if ([getView() isKindOfClass:[NSScrollView class]]){
+        NSView *wview = getDocumentView();
         
         KWQDEBUGLEVEL (KWQ_LOG_FRAMES, "%p %s at w %d h %d\n", wview, [[[wview class] className] cString], w, h);
         //w -= (int)[NSScroller scrollerWidth];
         //w -= 1;
         if (w < 0)
             w = 0;
-        // Why isn't there a scollerHeight?
+        // Why isn't there a scrollerHeight?
         //h -= (int)[NSScroller scrollerWidth];
         //h -= 1;
         if (h < 0)
             h = 0;
-        [wview setFrameSize: NSMakeSize (w,h)];
+        [wview setFrameSize:NSMakeSize(w,h)];
     }
     else {
         resize (w, h);
@@ -260,13 +256,7 @@ QPoint QScrollView::contentsToViewport(const QPoint &p)
 
 void QScrollView::contentsToViewport(int x, int y, int& vx, int& vy)
 {
-    NSView *view = getView();    
-    if ([view isKindOfClass: [NSScrollView class]]) {
-        NSScrollView *scrollView = (NSScrollView *)view;
-        view = [scrollView documentView];
-    }
-        
-    NSPoint np = [view convertPoint: NSMakePoint (x, y) toView: nil];
+    NSPoint np = [getDocumentView() convertPoint: NSMakePoint (x, y) toView: nil];
     
     vx = (int)np.x;
     vy = (int)np.y;
@@ -274,13 +264,7 @@ void QScrollView::contentsToViewport(int x, int y, int& vx, int& vy)
 
 void QScrollView::viewportToContents(int vx, int vy, int& x, int& y)
 {
-    NSView *view = getView();    
-    if ([view isKindOfClass: [NSScrollView class]]) {
-        NSScrollView *scrollView = (NSScrollView *)view;
-        view = [scrollView documentView];
-    }
-        
-    NSPoint np = [view convertPoint: NSMakePoint (vx, vy) fromView: nil];
+    NSPoint np = [getDocumentView() convertPoint: NSMakePoint (vx, vy) fromView: nil];
     
     x = (int)np.x;
     y = (int)np.y;
diff --git a/WebCore/kwq/KWQSize.h b/WebCore/kwq/KWQSize.h
index 6d6ae53..ac050f7 100644
--- a/WebCore/kwq/KWQSize.h
+++ b/WebCore/kwq/KWQSize.h
@@ -29,7 +29,7 @@
 #include <KWQDef.h>
 
 #ifdef _KWQ_IOSTREAM_
-#include <iostream>
+#include <iosfwd>
 #endif
 
 class QSize {
diff --git a/WebCore/kwq/KWQValueList.h b/WebCore/kwq/KWQValueList.h
index 3f910e5..244edf6 100644
--- a/WebCore/kwq/KWQValueList.h
+++ b/WebCore/kwq/KWQValueList.h
@@ -30,7 +30,7 @@
 #include <KWQValueListImpl.h>
 
 #ifdef _KWQ_IOSTREAM_
-#include <iostream>
+#include <ostream>
 #endif
 
 template <class T> class QValueList;
diff --git a/WebCore/kwq/KWQWidget.mm b/WebCore/kwq/KWQWidget.mm
index 56e4bee..eb0dc51 100644
--- a/WebCore/kwq/KWQWidget.mm
+++ b/WebCore/kwq/KWQWidget.mm
@@ -23,11 +23,11 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-#include <qwidget.h>
+#import <qwidget.h>
 
-#include <external.h>
+#import <WebCoreViewFactory.h>
 
-#include <kwqdebug.h>
+#import <kwqdebug.h>
 
 #import <KWQView.h>
 
@@ -250,7 +250,7 @@ QSize QWidget::minimumSizeHint() const
 {
     NSView *view = getView();
     
-    if ([view isKindOfClass: [NSControl class]]) {
+    if ([view isKindOfClass:[NSControl class]]) {
         NSControl *control = (NSControl *)view;
         [control sizeToFit];
         NSRect frame = [view frame];
diff --git a/WebCore/kwq/Makefile.am b/WebCore/kwq/Makefile.am
index ffc8a65..eb08f10 100644
--- a/WebCore/kwq/Makefile.am
+++ b/WebCore/kwq/Makefile.am
@@ -110,7 +110,7 @@ libkwq_o_SOURCES = \
 	KWQtextstream.mm \
 	KWQxml.mm \
 	kwqdebug.mm \
-	WCPluginWidget.mm \
+	WebCoreBridge.mm \
 	WebCoreImageRendererFactory.m \
 	WebCoreTextRendererFactory.m \
 	WebCoreViewFactory.m \
diff --git a/WebCore/kwq/WCPluginWidget.h b/WebCore/kwq/WCPluginWidget.h
deleted file mode 100644
index d041430..0000000
--- a/WebCore/kwq/WCPluginWidget.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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 WCPluginWidget_H_
-#define WCPluginWidget_H_
-
-class QString;
-class QStringList;
-class QWidget;
-
-QWidget *IFPluginWidgetCreate(const QString &url, const QString &serviceType, const QStringList &args, const QString &baseURL);    
-
-#endif
diff --git a/WebCore/kwq/WCPluginWidget.mm b/WebCore/kwq/WCPluginWidget.mm
deleted file mode 100644
index 3715ee4..0000000
--- a/WebCore/kwq/WCPluginWidget.mm
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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. 
- */
- 
-#import "WCPluginWidget.h"
-#import <qwidget.h>
-#import <WebCoreViewFactory.h>
-
-QWidget *IFPluginWidgetCreate(const QString &url, const QString &serviceType, const QStringList &args, const QString &baseURL)
-{
-    NSMutableArray *argsArray = [NSMutableArray arrayWithCapacity:args.count()];
-    for (uint i = 0; i < args.count(); i++) {
-        [argsArray addObject:args[i].getNSString()];
-    }
-    QWidget *widget = new QWidget();
-    widget->setView([[WebCoreViewFactory sharedFactory]
-        viewForPluginWithURL:url.getNSString()
-                    serviceType:serviceType.getNSString()
-                    arguments:argsArray
-                        baseURL:baseURL.getNSString()]);
-    return widget;
-}
diff --git a/WebCore/kwq/KWQLoader.h b/WebCore/kwq/WebCoreBridge.h
similarity index 59%
copy from WebCore/kwq/KWQLoader.h
copy to WebCore/kwq/WebCoreBridge.h
index a1e4de3..982dc73 100644
--- a/WebCore/kwq/KWQLoader.h
+++ b/WebCore/kwq/WebCoreBridge.h
@@ -23,29 +23,43 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
+#import <Foundation/Foundation.h>
+
+class KHTMLPart;
+class KHTMLView;
+
 namespace khtml {
-    class CachedObject;
-    class Loader;
-    class Request;
+    class RenderPart;
 }
 
-namespace KIO {
-    class TransferJob;
-}
+ at class IFWebDataSource; // temporary -- here only until I finish KWQKloader.mm
 
-class KWQLoaderImpl
+ at interface WebCoreBridge : NSObject
 {
-public:
-    KWQLoaderImpl(khtml::Loader *);
-    ~KWQLoaderImpl();
-    
-    void setClient(khtml::Request *);
-    void serveRequest(khtml::Request *, KIO::TransferJob *);
-    void objectFinished(khtml::CachedObject *);
-
-private:
-    KWQLoaderImpl(const KWQLoaderImpl&);
-    KWQLoaderImpl& operator=(const KWQLoaderImpl&);
-    
-    khtml::Loader *loader;
-};
+    KHTMLPart *part;
+}
+
+- (KHTMLPart *)part;
+
+- (WebCoreBridge *)parent;
+- (NSArray *)children; // WebCoreBridge objects
+
+- (WebCoreBridge *)mainFrame;
+- (WebCoreBridge *)frameNamed:(NSString *)name; // always searches entire hierarchy starting with mainFrame
+
+- (void)setTitle:(NSString *)title;
+
+- (void)loadURL:(NSURL *)URL;
+- (void)postWithURL:(NSURL *)URL data:(NSData *)data;
+
+- (BOOL)createNewFrameNamed:(NSString *)frameName
+    withURL:(NSURL *)URL renderPart:(khtml::RenderPart *)renderPart
+    allowsScrolling:(BOOL)allowsScrolling marginWidth:(int)width marginHeight:(int)height;
+
+- (void)openNewWindowWithURL:(NSURL *)URL;
+
+- (KHTMLView *)widget;
+
+- (IFWebDataSource *)dataSource; // temporary -- here only until I finish KWQKloader.mm
+
+ at end
diff --git a/WebCore/kwq/WebCoreViewFactory.m b/WebCore/kwq/WebCoreBridge.mm
similarity index 62%
copy from WebCore/kwq/WebCoreViewFactory.m
copy to WebCore/kwq/WebCoreBridge.mm
index a2c0dfe..b54afcf 100644
--- a/WebCore/kwq/WebCoreViewFactory.m
+++ b/WebCore/kwq/WebCoreBridge.mm
@@ -23,39 +23,83 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-#import "WebCoreViewFactory.h"
-#import <kwqdebug.h>
+#import <WebCoreBridge.h>
 
- at implementation WebCoreViewFactory
+#import <KWQKHTMLPartImpl.h>
 
-static WebCoreViewFactory *sharedFactory;
-
-+ (WebCoreViewFactory *)sharedFactory
-{
-    return sharedFactory;
-}
+ at implementation WebCoreBridge
 
 - init
 {
     [super init];
     
-    KWQ_ASSERT(!sharedFactory);
-    sharedFactory = [self retain];
+    part = new KHTMLPart;
+    part->impl->setBridge(self);
     
     return self;
 }
 
-- (NSView *)viewForPluginWithURL:(NSString *)url serviceType:(NSString *)serviceType arguments:(NSArray *)arguments baseURL:(NSString *)baseURL;
+- (void)dealloc
+{
+    part->deref();
+    
+    [super dealloc];
+}
+
+- (KHTMLPart *)part
+{
+    return part;
+}
+
+- (WebCoreBridge *)parent
+{
+    return nil;
+}
+
+- (NSArray *)children
+{
+    return nil;
+}
+
+- (void)loadURL:(NSURL *)URL
+{
+}
+
+- (void)postWithURL:(NSURL *)URL data:(NSData *)data
+{
+}
+
+- (BOOL)createNewFrameNamed:(NSString *)frameName
+    withURL:(NSURL *)URL renderPart:(khtml::RenderPart *)renderPart
+    allowsScrolling:(BOOL)allowsScrolling marginWidth:(int)width marginHeight:(int)height
+{
+    return NO;
+}
+
+- (void)openNewWindowWithURL:(NSURL *)URL
+{
+}
+
+- (void)setTitle:(NSString *)title
+{
+}
+
+- (WebCoreBridge *)mainFrame
 {
     return nil;
 }
 
-- (NSArray *)pluginsInfo
+- (WebCoreBridge *)frameNamed:(NSString *)name
 {
     return nil;
 }
 
-- (NSView *)viewForJavaAppletWithArguments:(NSDictionary *)arguments
+- (KHTMLView *)widget
+{
+    return 0;
+}
+
+- (IFWebDataSource *)dataSource
 {
     return nil;
 }
diff --git a/WebCore/kwq/WebCoreViewFactory.h b/WebCore/kwq/WebCoreViewFactory.h
index 8157faf..eb07f27 100644
--- a/WebCore/kwq/WebCoreViewFactory.h
+++ b/WebCore/kwq/WebCoreViewFactory.h
@@ -29,9 +29,6 @@
 @class NSString;
 @class NSView;
 
-typedef NSView *(*IFPluginViewCreationFunction)();
-void IFSetPluginViewCreationFunction(IFPluginViewCreationFunction);
-
 @interface WebCoreViewFactory : NSObject
 {
 }
@@ -54,3 +51,7 @@ void IFSetPluginViewCreationFunction(IFPluginViewCreationFunction);
 - (NSArray *)mimeTypes; // array of NSArrays with 3 parts of MIME type in each
 
 @end
+
+ at protocol WebCoreCursorSetting
+- (void)setCursor:(NSCursor *)cursor;
+ at end
diff --git a/WebCore/kwq/qt/qarray.h b/WebCore/kwq/qt/qarray.h
index 76c2d45..88fa79b 100644
--- a/WebCore/kwq/qt/qarray.h
+++ b/WebCore/kwq/qt/qarray.h
@@ -29,6 +29,10 @@
 #include <KWQDef.h>
 #include <KWQArrayImpl.h>
 
+#ifdef _KWQ_IOSTREAM_
+#include <ostream>
+#endif
+
 template <class T> class QMemArray {
 public:
     QMemArray() : impl(sizeof(T)) {}
@@ -56,8 +60,6 @@ public:
 
 #ifdef _KWQ_IOSTREAM_
 
-#include <iostream>
-
 template<class T>
 inline std::ostream &operator<<(std::ostream &stream, const QMemArray<T>&a)
 {
diff --git a/WebCore/kwq/qt/qcstring.h b/WebCore/kwq/qt/qcstring.h
index 2a5cfa6..8fd0868 100644
--- a/WebCore/kwq/qt/qcstring.h
+++ b/WebCore/kwq/qt/qcstring.h
@@ -28,11 +28,6 @@
 
 #include <qarray.h>
 #include <string.h>
-#include <KWQDef.h>
-
-#ifdef _KWQ_IOSTREAM_
-#include <iostream>
-#endif
 
 typedef QMemArray<char> QByteArray;
 
diff --git a/WebCore/kwq/qt/qdatetime.h b/WebCore/kwq/qt/qdatetime.h
index 1c352f2..7676ec5 100644
--- a/WebCore/kwq/qt/qdatetime.h
+++ b/WebCore/kwq/qt/qdatetime.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2001, 2002 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
@@ -26,7 +26,11 @@
 #ifndef QDATETIME_H_
 #define QDATETIME_H_
 
-#include <iostream>
+#include <KWQDef.h>
+
+#ifdef _KWQ_IOSTREAM_
+#include <iosfwd>
+#endif
 
 class QTime {
 public:
@@ -50,7 +54,9 @@ private:
     uint timeMS;  // time is stored in milliseconds 
     
     friend class QDateTime;
+#ifdef _KWQ_IOSTREAM_
     friend std::ostream &operator<<( std::ostream &, const QTime & );
+#endif
     
 };
 
@@ -77,7 +83,9 @@ private:
     void setCurrentDate();
     
     friend class QDateTime;
+#ifdef _KWQ_IOSTREAM_
     friend std::ostream &operator<<( std::ostream &, const QDate & );
+#endif
 
 };
 
@@ -97,7 +105,9 @@ private:
     QTime timeDT;
     QDate dateDT;
 
+#ifdef _KWQ_IOSTREAM_
     friend std::ostream &operator<<( std::ostream &, const QDateTime & );
+#endif
 };
 
 #endif
diff --git a/WebCore/kwq/qt/qlist.h b/WebCore/kwq/qt/qlist.h
index 6a22a92..7b3457c 100644
--- a/WebCore/kwq/qt/qlist.h
+++ b/WebCore/kwq/qt/qlist.h
@@ -31,7 +31,7 @@
 #include <KWQListImpl.h>
 
 #ifdef _KWQ_IOSTREAM_
-#include <iostream>
+#include <ostream>
 #endif
 
 template <class T> class QPtrListIterator;
diff --git a/WebCore/kwq/qt/qmap.h b/WebCore/kwq/qt/qmap.h
index ed4720c..43a442f 100644
--- a/WebCore/kwq/qt/qmap.h
+++ b/WebCore/kwq/qt/qmap.h
@@ -31,7 +31,7 @@
 #include <KWQMapImpl.h>
 
 #ifdef _KWQ_IOSTREAM_
-#include <iostream>
+#include <ostream>
 #endif
 
 template <class K, class V> class QMap;
diff --git a/WebCore/kwq/qt/qpoint.h b/WebCore/kwq/qt/qpoint.h
index 6864a8d..38c96d7 100644
--- a/WebCore/kwq/qt/qpoint.h
+++ b/WebCore/kwq/qt/qpoint.h
@@ -29,7 +29,7 @@
 #include <KWQDef.h>
 
 #ifdef _KWQ_IOSTREAM_
-#include <iostream>
+#include <iosfwd>
 #endif
 
 #include "qarray.h"
diff --git a/WebCore/kwq/qt/qscrollview.h b/WebCore/kwq/qt/qscrollview.h
index 1391020..ce1ebc6 100644
--- a/WebCore/kwq/qt/qscrollview.h
+++ b/WebCore/kwq/qt/qscrollview.h
@@ -28,6 +28,12 @@
 
 #include <qframe.h>
 
+#ifdef __OBJC__
+ at class NSView;
+#else
+class NSView;
+#endif
+
 class QScrollView : public QFrame {
 public:
     enum ScrollBarMode { AlwaysOff, AlwaysOn, Auto };
@@ -72,6 +78,8 @@ public:
 
     void ensureVisible(int,int);
     void ensureVisible(int,int,int,int);
+    
+    NSView *getDocumentView() const;
 };
 
 #endif
diff --git a/WebCore/kwq/qt/qsize.h b/WebCore/kwq/qt/qsize.h
index 6d6ae53..ac050f7 100644
--- a/WebCore/kwq/qt/qsize.h
+++ b/WebCore/kwq/qt/qsize.h
@@ -29,7 +29,7 @@
 #include <KWQDef.h>
 
 #ifdef _KWQ_IOSTREAM_
-#include <iostream>
+#include <iosfwd>
 #endif
 
 class QSize {
diff --git a/WebCore/kwq/qt/qvaluelist.h b/WebCore/kwq/qt/qvaluelist.h
index 3f910e5..244edf6 100644
--- a/WebCore/kwq/qt/qvaluelist.h
+++ b/WebCore/kwq/qt/qvaluelist.h
@@ -30,7 +30,7 @@
 #include <KWQValueListImpl.h>
 
 #ifdef _KWQ_IOSTREAM_
-#include <iostream>
+#include <ostream>
 #endif
 
 template <class T> class QValueList;
diff --git a/WebCore/kwq/qt/qvector.h b/WebCore/kwq/qt/qvector.h
index 5d713de..ba42067 100644
--- a/WebCore/kwq/qt/qvector.h
+++ b/WebCore/kwq/qt/qvector.h
@@ -26,13 +26,15 @@
 #ifndef QVECTOR_H_
 #define QVECTOR_H_
 
-#include <iostream>
-
 #include <KWQDef.h>
 #include <qcollection.h>
 
 #include <KWQVectorImpl.h>
 
+#ifdef _KWQ_IOSTREAM_
+#include <ostream>
+#endif
+
 class QGVector : public QPtrCollection
 {
 public:
@@ -68,6 +70,8 @@ public:
     KWQVectorImpl impl;
 };
 
+#ifdef _KWQ_IOSTREAM_
+
 template<class T>
 inline std::ostream &operator<<(std::ostream &stream, const QPtrVector<T> &v)
 {
@@ -85,3 +89,5 @@ inline std::ostream &operator<<(std::ostream &stream, const QPtrVector<T> &v)
 }
 
 #endif
+
+#endif
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 12adf17..fd078e6 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,39 @@
+2002-06-14  Darin Adler  <darin at apple.com>
+
+	Add the new bridge class that connects us to WebCore in a nicer way.
+	Started to use it for some things. More to come.
+
+	* WebKit.pbproj/project.pbxproj:
+	* IFWebCoreBridge.h: Added.
+	* IFWebCoreBridge.mm: Added.
+
+	* Misc.subproj/IFDownloadHandler.mm:
+	(-[IFDownloadHandler initWithDataSource:]): Call [super init].
+	(-[IFDownloadHandler dealloc]): Call [super dealloc].
+	* Plugins.subproj/IFPluginNullEventSender.m:
+	(-[IFPluginNullEventSender initializeWithNPP:functionPointer:window:]): Call [super init].
+	(-[IFPluginNullEventSender dealloc]): Call [super dealloc].
+	* WebView.subproj/IFDOMNode.mm: (-[IFDOMNode dealloc]): Call [super dealloc].
+	* WebView.subproj/IFImageView.m: (-[IFImageView dealloc]): Call [super dealloc].
+	* WebView.subproj/IFRenderNode.mm: (-[IFRenderNode dealloc]): Call [super dealloc].
+
+	* WebView.subproj/IFHTMLRepresentation.h: Moved variables into a private structure so
+	this class can be made public.
+	* WebView.subproj/IFHTMLRepresentationPrivate.h: Added. Has _bridge method.
+	* WebView.subproj/IFHTMLRepresentation.mm:
+	(-[IFHTMLRepresentation init]): Call [super init]. Also use the new private structure,
+	and allocate the IFWebCoreBridge.
+	(-[IFHTMLRepresentation dealloc]): Release the private structure and the IFWebCoreBridge.
+	Also, call [super dealloc].
+	(-[IFHTMLRepresentation _bridge]): Private method to get to the bridge.
+	(-[IFHTMLRepresentation receivedData:withDataSource:]): Use IFWebCoreBridge.
+
+	* WebView.subproj/IFWebViewPrivate.h: Add _setMarginWidth and _setMarginHeight.
+
+	* WebView.subproj/IFWebDataSourcePrivate.h: Tweak.
+	* WebView.subproj/IFWebDataSource.mm: Tweak.
+	* History.subproj/IFWebHistoryPrivate.m: Tweak.
+
 2002-06-14  Richard Williamson  <rjw at apple.com>
 
     Lots of frame related cleanup.  Added attempt to get
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 12adf17..fd078e6 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,39 @@
+2002-06-14  Darin Adler  <darin at apple.com>
+
+	Add the new bridge class that connects us to WebCore in a nicer way.
+	Started to use it for some things. More to come.
+
+	* WebKit.pbproj/project.pbxproj:
+	* IFWebCoreBridge.h: Added.
+	* IFWebCoreBridge.mm: Added.
+
+	* Misc.subproj/IFDownloadHandler.mm:
+	(-[IFDownloadHandler initWithDataSource:]): Call [super init].
+	(-[IFDownloadHandler dealloc]): Call [super dealloc].
+	* Plugins.subproj/IFPluginNullEventSender.m:
+	(-[IFPluginNullEventSender initializeWithNPP:functionPointer:window:]): Call [super init].
+	(-[IFPluginNullEventSender dealloc]): Call [super dealloc].
+	* WebView.subproj/IFDOMNode.mm: (-[IFDOMNode dealloc]): Call [super dealloc].
+	* WebView.subproj/IFImageView.m: (-[IFImageView dealloc]): Call [super dealloc].
+	* WebView.subproj/IFRenderNode.mm: (-[IFRenderNode dealloc]): Call [super dealloc].
+
+	* WebView.subproj/IFHTMLRepresentation.h: Moved variables into a private structure so
+	this class can be made public.
+	* WebView.subproj/IFHTMLRepresentationPrivate.h: Added. Has _bridge method.
+	* WebView.subproj/IFHTMLRepresentation.mm:
+	(-[IFHTMLRepresentation init]): Call [super init]. Also use the new private structure,
+	and allocate the IFWebCoreBridge.
+	(-[IFHTMLRepresentation dealloc]): Release the private structure and the IFWebCoreBridge.
+	Also, call [super dealloc].
+	(-[IFHTMLRepresentation _bridge]): Private method to get to the bridge.
+	(-[IFHTMLRepresentation receivedData:withDataSource:]): Use IFWebCoreBridge.
+
+	* WebView.subproj/IFWebViewPrivate.h: Add _setMarginWidth and _setMarginHeight.
+
+	* WebView.subproj/IFWebDataSourcePrivate.h: Tweak.
+	* WebView.subproj/IFWebDataSource.mm: Tweak.
+	* History.subproj/IFWebHistoryPrivate.m: Tweak.
+
 2002-06-14  Richard Williamson  <rjw at apple.com>
 
     Lots of frame related cleanup.  Added attempt to get
diff --git a/WebKit/History.subproj/IFWebHistoryPrivate.m b/WebKit/History.subproj/IFWebHistoryPrivate.m
index c752aec..1498e14 100644
--- a/WebKit/History.subproj/IFWebHistoryPrivate.m
+++ b/WebKit/History.subproj/IFWebHistoryPrivate.m
@@ -429,7 +429,7 @@
     start = CFAbsoluteTimeGetCurrent();
     result = [self _loadHistoryGuts: &numberOfItems];
 
-    if (result == YES) {
+    if (result) {
         duration = CFAbsoluteTimeGetCurrent() - start;
         WEBKITDEBUGLEVEL (WEBKIT_LOG_TIMING, "loading %d history entries from %s took %f seconds\n",
                            numberOfItems, DEBUG_OBJECT([self file]), duration);
@@ -469,7 +469,7 @@
     start = CFAbsoluteTimeGetCurrent();
     result = [self _saveHistoryGuts: &numberOfItems];
 
-    if (result == YES) {
+    if (result) {
         duration = CFAbsoluteTimeGetCurrent() - start;
         WEBKITDEBUGLEVEL (WEBKIT_LOG_TIMING, "saving %d history entries to %s took %f seconds\n",
                            numberOfItems, DEBUG_OBJECT([self file]), duration);
diff --git a/WebKit/History.subproj/WebHistoryPrivate.m b/WebKit/History.subproj/WebHistoryPrivate.m
index c752aec..1498e14 100644
--- a/WebKit/History.subproj/WebHistoryPrivate.m
+++ b/WebKit/History.subproj/WebHistoryPrivate.m
@@ -429,7 +429,7 @@
     start = CFAbsoluteTimeGetCurrent();
     result = [self _loadHistoryGuts: &numberOfItems];
 
-    if (result == YES) {
+    if (result) {
         duration = CFAbsoluteTimeGetCurrent() - start;
         WEBKITDEBUGLEVEL (WEBKIT_LOG_TIMING, "loading %d history entries from %s took %f seconds\n",
                            numberOfItems, DEBUG_OBJECT([self file]), duration);
@@ -469,7 +469,7 @@
     start = CFAbsoluteTimeGetCurrent();
     result = [self _saveHistoryGuts: &numberOfItems];
 
-    if (result == YES) {
+    if (result) {
         duration = CFAbsoluteTimeGetCurrent() - start;
         WEBKITDEBUGLEVEL (WEBKIT_LOG_TIMING, "saving %d history entries to %s took %f seconds\n",
                            numberOfItems, DEBUG_OBJECT([self file]), duration);
diff --git a/WebKit/IFWebCoreBridge.h b/WebKit/IFWebCoreBridge.h
new file mode 100644
index 0000000..983412e
--- /dev/null
+++ b/WebKit/IFWebCoreBridge.h
@@ -0,0 +1,20 @@
+//
+//  IFWebCoreBridge.h
+//  WebKit
+//
+//  Created by Darin Adler on Thu Jun 13 2002.
+//  Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
+//
+
+#import <WebCoreBridge.h>
+
+ at class IFWebDataSource;
+
+ at interface IFWebCoreBridge : WebCoreBridge
+{
+    IFWebDataSource *dataSource;
+}
+
+- (void)receivedData:(NSData *)data withDataSource:(IFWebDataSource *)dataSource;
+
+ at end
diff --git a/WebKit/IFWebCoreBridge.mm b/WebKit/IFWebCoreBridge.mm
new file mode 100644
index 0000000..df2bbde
--- /dev/null
+++ b/WebKit/IFWebCoreBridge.mm
@@ -0,0 +1,181 @@
+//
+//  IFWebCoreBridge.mm
+//  WebKit
+//
+//  Created by Darin Adler on Thu Jun 13 2002.
+//  Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
+//
+
+#import <WebKit/IFWebCoreBridge.h>
+
+#import <WebKit/IFWebController.h>
+#import <WebKit/IFWebFramePrivate.h>
+#import <WebKit/IFWebDataSourcePrivate.h>
+#import <WebKit/IFWebViewPrivate.h>
+#import <WebKit/IFHTMLRepresentation.h>
+#import <WebKit/IFHTMLViewPrivate.h>
+#import <WebFoundation/IFURLCacheLoaderConstants.h>
+#import <KWQKHTMLPartImpl.h>
+
+#import <WebKit/WebKitDebug.h>
+
+ at interface IFWebDataSource (IFWebCoreBridge)
+- (IFWebCoreBridge *)_bridge;
+ at end
+
+ at interface IFWebFrame (IFWebCoreBridge)
+- (IFWebCoreBridge *)_bridge;
+ at end
+
+ at implementation IFWebDataSource (IFWebCoreBridge)
+
+- (IFWebCoreBridge *)_bridge
+{
+    return [[self representation] _bridge];
+}
+
+ at end
+
+ at implementation IFWebFrame (IFWebCoreBridge)
+
+- (IFWebCoreBridge *)_bridge
+{
+    return [[self dataSource] _bridge];
+}
+
+ at end
+
+ at implementation IFWebCoreBridge
+
+- (IFWebFrame *)frame
+{
+    return [dataSource webFrame];
+}
+
+- (IFWebController *)controller
+{
+    return [[self frame] controller];
+}
+
+- (IFWebView *)view
+{
+    return [[self frame] webView];
+}
+
+- (IFHTMLView *)HTMLView
+{
+    return [[self view] documentView];
+}
+
+- (WebCoreBridge *)parent
+{
+    return [[dataSource parent] _bridge];
+}
+
+- (NSArray *)children
+{
+    NSArray *frames = [dataSource children];
+    NSEnumerator *e = [frames objectEnumerator];
+    NSMutableArray *children = [NSMutableArray arrayWithCapacity:[frames count]];
+    IFWebFrame *frame;
+    while ((frame = [e nextObject])) {
+        [children addObject:[frame _bridge]];
+    }
+    return children;
+}
+
+- (void)loadURL:(NSURL *)URL attributes:(NSDictionary *)attributes flags:(unsigned)flags inFrame:(IFWebFrame *)frame withParent:(WebCoreBridge *)parent
+{
+    IFWebDataSource *newDataSource = [[IFWebDataSource alloc] initWithURL:URL attributes:attributes flags:flags];
+    IFWebCoreBridge *parentPrivate = (IFWebCoreBridge *)parent;
+    [newDataSource _setParent:[parentPrivate dataSource]];
+    [frame setProvisionalDataSource:newDataSource];
+    [newDataSource release];
+    [frame startLoading];
+}
+
+- (void)loadURL:(NSURL *)URL
+{
+    [self loadURL:URL attributes:nil flags:0 inFrame:[self frame] withParent:[self parent]];
+}
+
+- (void)postWithURL:(NSURL *)URL data:(NSData *)data
+{
+    // When posting, use the IFURLHandleFlagLoadFromOrigin load flag. 
+    // This prevents a potential bug which may cause a page
+    // with a form that uses itself as an action to be returned 
+    // from the cache without submitting.
+    NSDictionary *attributes = [[NSDictionary alloc] initWithObjectsAndKeys:
+        data, IFHTTPURLHandleRequestData,
+        @"POST", IFHTTPURLHandleRequestMethod,
+        nil];
+    [self loadURL:URL attributes:attributes flags:IFURLHandleFlagLoadFromOrigin inFrame:[self frame] withParent:[self parent]];
+    [attributes release];
+}
+
+- (BOOL)createNewFrameNamed:(NSString *)frameName
+    withURL:(NSURL *)URL renderPart:(khtml::RenderPart *)renderPart
+    allowsScrolling:(BOOL)allowsScrolling marginWidth:(int)width marginHeight:(int)height
+{
+    IFWebFrame *frame = [[self controller] createFrameNamed:frameName for:nil inParent:dataSource inScrollView:allowsScrolling];
+    if (frame == nil) {
+        return NO;
+    }
+    
+    [frame _setRenderFramePart:renderPart];
+    
+    [[frame webView] _setMarginWidth:width];
+    [[frame webView] _setMarginHeight:height];
+
+    [self loadURL:URL attributes:nil flags:0 inFrame:frame withParent:self];
+    
+    return YES;
+}
+
+- (void)openNewWindowWithURL:(NSURL *)url
+{
+    [[self controller] openNewWindowWithURL:url];
+}
+
+- (void)setTitle:(NSString *)title
+{
+    [dataSource _setTitle:title];
+}
+
+- (WebCoreBridge *)mainFrame
+{
+    return [[[self controller] mainFrame] _bridge];
+}
+
+- (WebCoreBridge *)frameNamed:(NSString *)name
+{
+    return [[[self controller] frameNamed:name] _bridge];
+}
+
+- (KHTMLView *)widget
+{
+    KHTMLView *widget = [[self HTMLView] _provisionalWidget];
+    if (widget) {
+        return widget;
+    }
+    return [[self HTMLView] _widget];
+}
+
+- (void)receivedData:(NSData *)data withDataSource:(IFWebDataSource *)withDataSource
+{
+    if (dataSource == nil) {
+        dataSource = withDataSource;
+        [self part]->openURL([[[dataSource inputURL] absoluteString] cString]);
+    } else {
+        WEBKIT_ASSERT(dataSource == withDataSource);
+    }
+    
+    [self part]->impl->slotData([dataSource encoding], (const char *)[data bytes], [data length], NO);
+}
+
+- (IFWebDataSource *)dataSource
+{
+    return dataSource;
+}
+
+ at end
diff --git a/WebKit/Misc.subproj/IFDownloadHandler.mm b/WebKit/Misc.subproj/IFDownloadHandler.mm
index 72b51ac..28874a7 100644
--- a/WebKit/Misc.subproj/IFDownloadHandler.mm
+++ b/WebKit/Misc.subproj/IFDownloadHandler.mm
@@ -14,6 +14,8 @@
 
 - initWithDataSource:(IFWebDataSource *)dSource
 {
+    [super init];
+    
     dataSource = [dSource retain];
     WEBKITDEBUGLEVEL(WEBKIT_LOG_DOWNLOAD, "Download started for: %s", [[[dSource inputURL] absoluteString] cString]);
     return self;
@@ -23,6 +25,8 @@
 {
     [fileHandle release];
     [dataSource release];
+    
+    [super dealloc];
 }
 
 - (void)receivedData:(NSData *)data
diff --git a/WebKit/Misc.subproj/WebDownloadHandler.m b/WebKit/Misc.subproj/WebDownloadHandler.m
index 72b51ac..28874a7 100644
--- a/WebKit/Misc.subproj/WebDownloadHandler.m
+++ b/WebKit/Misc.subproj/WebDownloadHandler.m
@@ -14,6 +14,8 @@
 
 - initWithDataSource:(IFWebDataSource *)dSource
 {
+    [super init];
+    
     dataSource = [dSource retain];
     WEBKITDEBUGLEVEL(WEBKIT_LOG_DOWNLOAD, "Download started for: %s", [[[dSource inputURL] absoluteString] cString]);
     return self;
@@ -23,6 +25,8 @@
 {
     [fileHandle release];
     [dataSource release];
+    
+    [super dealloc];
 }
 
 - (void)receivedData:(NSData *)data
diff --git a/WebKit/Plugins.subproj/IFPluginNullEventSender.m b/WebKit/Plugins.subproj/IFPluginNullEventSender.m
index 591dbf1..016be20 100644
--- a/WebKit/Plugins.subproj/IFPluginNullEventSender.m
+++ b/WebKit/Plugins.subproj/IFPluginNullEventSender.m
@@ -12,16 +12,21 @@
 
 -(id)initializeWithNPP:(NPP)pluginInstance functionPointer:(NPP_HandleEventProcPtr)handleEventFunction window:(NSWindow *)theWindow
 {
+    [super init];
+    
     instance = pluginInstance;
     NPP_HandleEvent = handleEventFunction;
     shouldStop = FALSE;
     window = [theWindow retain];
+    
     return self;
 }
 
 -(void) dealloc
 {
     [window release];
+    
+    [super dealloc];
 }
 
 -(void)sendNullEvents
diff --git a/WebKit/Plugins.subproj/WebPluginNullEventSender.m b/WebKit/Plugins.subproj/WebPluginNullEventSender.m
index 591dbf1..016be20 100644
--- a/WebKit/Plugins.subproj/WebPluginNullEventSender.m
+++ b/WebKit/Plugins.subproj/WebPluginNullEventSender.m
@@ -12,16 +12,21 @@
 
 -(id)initializeWithNPP:(NPP)pluginInstance functionPointer:(NPP_HandleEventProcPtr)handleEventFunction window:(NSWindow *)theWindow
 {
+    [super init];
+    
     instance = pluginInstance;
     NPP_HandleEvent = handleEventFunction;
     shouldStop = FALSE;
     window = [theWindow retain];
+    
     return self;
 }
 
 -(void) dealloc
 {
     [window release];
+    
+    [super dealloc];
 }
 
 -(void)sendNullEvents
diff --git a/WebKit/WebKit.pbproj/project.pbxproj b/WebKit/WebKit.pbproj/project.pbxproj
index e30899f..4b57b25 100644
--- a/WebKit/WebKit.pbproj/project.pbxproj
+++ b/WebKit/WebKit.pbproj/project.pbxproj
@@ -252,7 +252,9 @@
 				35081DAF02B6D4F50ACA2ACA,
 				F508946B02B71D59018A9CD4,
 				F5FBAB9102B88CBF01FF6074,
+				F5AFB46002B94DC8018635CA,
 				F5E0A77002B8FEE401C1A525,
+				F5A55DC802BAA2E8018635CC,
 			);
 			isa = PBXHeadersBuildPhase;
 		};
@@ -327,6 +329,7 @@
 				35081DAD02B6D4E40ACA2ACA,
 				F508946C02B71D59018A9CD4,
 				F5FBAB9202B88CBF01FF6074,
+				F5AFB46102B94DC8018635CA,
 				F5E0A77102B8FEE401C1A525,
 			);
 			isa = PBXSourcesBuildPhase;
@@ -1131,6 +1134,7 @@
 				F5143A370221DCCE01A80181,
 				9CF0E249021361B00ECA16EA,
 				9CF0E24A021361B00ECA16EA,
+				F5A55DC702BAA2E8018635CC,
 			);
 			isa = PBXGroup;
 			name = WebView;
@@ -1599,6 +1603,18 @@
 			settings = {
 			};
 		};
+		F5A55DC702BAA2E8018635CC = {
+			isa = PBXFileReference;
+			name = IFHTMLRepresentationPrivate.h;
+			path = WebView.subproj/IFHTMLRepresentationPrivate.h;
+			refType = 4;
+		};
+		F5A55DC802BAA2E8018635CC = {
+			fileRef = F5A55DC702BAA2E8018635CC;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
 		F5A672B70263866E01000102 = {
 			isa = PBXFileReference;
 			name = IFPluginNullEventSender.h;
@@ -1659,6 +1675,28 @@
 			settings = {
 			};
 		};
+		F5AFB45E02B94DC8018635CA = {
+			isa = PBXFileReference;
+			path = IFWebCoreBridge.h;
+			refType = 4;
+		};
+		F5AFB45F02B94DC8018635CA = {
+			isa = PBXFileReference;
+			path = IFWebCoreBridge.mm;
+			refType = 4;
+		};
+		F5AFB46002B94DC8018635CA = {
+			fileRef = F5AFB45E02B94DC8018635CA;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		F5AFB46102B94DC8018635CA = {
+			fileRef = F5AFB45F02B94DC8018635CA;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
 		F5B36B400281DE87018635CB = {
 			children = (
 				F5B36B450281DF9C018635CB,
@@ -1671,6 +1709,8 @@
 				9CE1F8A102A5C6F30ECA2ACD,
 				9CE1F8A202A5C6F30ECA2ACD,
 				9CE1F8A302A5C6F30ECA2ACD,
+				F5AFB45E02B94DC8018635CA,
+				F5AFB45F02B94DC8018635CA,
 			);
 			isa = PBXGroup;
 			name = "WebCore Support";
diff --git a/WebKit/WebView.subproj/IFDOMNode.mm b/WebKit/WebView.subproj/IFDOMNode.mm
index 23ca798..8550602 100644
--- a/WebKit/WebView.subproj/IFDOMNode.mm
+++ b/WebKit/WebView.subproj/IFDOMNode.mm
@@ -47,6 +47,8 @@
     [value release];
     [source release];
     [children release];
+    
+    [super dealloc];
 }
 
 - (NSArray *)children
diff --git a/WebKit/WebView.subproj/IFHTMLRepresentation.h b/WebKit/WebView.subproj/IFHTMLRepresentation.h
index 76cf639..7dc0f38 100644
--- a/WebKit/WebView.subproj/IFHTMLRepresentation.h
+++ b/WebKit/WebView.subproj/IFHTMLRepresentation.h
@@ -8,15 +8,17 @@
 
 @class IFError;
 @class IFWebDataSource;
+ at class IFWebCoreBridge;
 
 class KHTMLPart;
 
 @protocol IFDocumentRepresentation;
 
+ at class IFHTMLRepresentationPrivate;
+
 @interface IFHTMLRepresentation : NSObject <IFDocumentRepresentation>
 {
-    KHTMLPart *part;
-    BOOL isFirstChunk;
+    IFHTMLRepresentationPrivate *_private;
 }
 
 - (KHTMLPart *)part;
diff --git a/WebKit/WebView.subproj/IFHTMLRepresentation.mm b/WebKit/WebView.subproj/IFHTMLRepresentation.mm
index 198c9b7..d1a193b 100644
--- a/WebKit/WebView.subproj/IFHTMLRepresentation.mm
+++ b/WebKit/WebView.subproj/IFHTMLRepresentation.mm
@@ -5,40 +5,51 @@
 
 #import <WebKit/IFHTMLRepresentation.h>
 #import <WebKit/IFWebDataSource.h>
+#import <WebKit/IFWebCoreBridge.h>
 #import <KWQKHTMLPartImpl.h>
 
+ at interface IFHTMLRepresentationPrivate : NSObject
+{
+    IFWebCoreBridge *bridge;
+}
+ at end
+
+ at implementation IFHTMLRepresentationPrivate
+ at end
+
 @implementation IFHTMLRepresentation
 
 - init
 {
-    part = new KHTMLPart();
-    isFirstChunk = YES;
+    [super init];
+    
+    _private = [[IFHTMLRepresentationPrivate alloc] init];
+    _private->bridge = [[IFWebCoreBridge alloc] init];
     
     return self;
 }
 
 - (void)dealloc
 {
-    part->deref();
+    [_private->bridge release];
+    [_private release];
+
+    [super dealloc];
+}
+
+- (IFWebCoreBridge *)_bridge
+{
+    return _private->bridge;
 }
 
 - (KHTMLPart *)part
 {
-    return part;
+    return [_private->bridge KHTMLPart];
 }
 
 - (void)receivedData:(NSData *)data withDataSource:(IFWebDataSource *)dataSource
 {
-    if(isFirstChunk){
-        // FIXME [rjw]:  Do any work need in the kde engine.  This should be removed.
-        // We should move any code needed out of KWQ.
-        part->openURL([[[dataSource inputURL] absoluteString] cString]);
-        part->impl->setDataSource(dataSource);
-    }
-    
-    part->impl->slotData([dataSource encoding], (const char *)[data bytes], [data length], NO);
-    
-    isFirstChunk = NO;
+    [_private->bridge receivedData:data withDataSource:dataSource];
 }
 
 - (void)receivedError:(IFError *)error withDataSource:(IFWebDataSource *)dataSource
diff --git a/WebKit/WebView.subproj/IFHTMLRepresentationPrivate.h b/WebKit/WebView.subproj/IFHTMLRepresentationPrivate.h
new file mode 100644
index 0000000..4242361
--- /dev/null
+++ b/WebKit/WebView.subproj/IFHTMLRepresentationPrivate.h
@@ -0,0 +1,10 @@
+/*	
+    IFHTMLRepresentationPrivate.h
+	Copyright 2002, Apple, Inc. All rights reserved.
+*/
+
+#import <WebKit/IFHTMLRepresentation.h>
+
+ at interface IFHTMLRepresentation <IFPrivate>
+- (IFWebCoreBridge *)_bridge;
+ at end
diff --git a/WebKit/WebView.subproj/IFImageView.m b/WebKit/WebView.subproj/IFImageView.m
index 050e5d7..d6dc566 100644
--- a/WebKit/WebView.subproj/IFImageView.m
+++ b/WebKit/WebView.subproj/IFImageView.m
@@ -26,6 +26,8 @@
 {
     [[representation image] stopAnimation];
     [representation release];
+    
+    [super dealloc];
 }
 
 - (BOOL)isFlipped 
diff --git a/WebKit/WebView.subproj/IFRenderNode.mm b/WebKit/WebView.subproj/IFRenderNode.mm
index b239f10..0edde02 100644
--- a/WebKit/WebView.subproj/IFRenderNode.mm
+++ b/WebKit/WebView.subproj/IFRenderNode.mm
@@ -62,6 +62,8 @@
 {
     [name release];
     [children release];
+    
+    [super dealloc];
 }
 
 - (NSArray *)children
diff --git a/WebKit/WebView.subproj/IFWebDataSource.mm b/WebKit/WebView.subproj/IFWebDataSource.mm
index 171bbae..523dd04 100644
--- a/WebKit/WebView.subproj/IFWebDataSource.mm
+++ b/WebKit/WebView.subproj/IFWebDataSource.mm
@@ -24,16 +24,6 @@
 
 @implementation IFWebDataSource
 
-static id IFWebDataSourceMake(void *url, void *attributes, unsigned flags) 
-{
-    return [[[IFWebDataSource alloc] initWithURL:(NSURL *)url attributes:(NSDictionary *)attributes flags:flags] autorelease];
-}
-
-+ (void)load
-{
-    WCSetIFWebDataSourceMakeFunc(IFWebDataSourceMake);
-}
-
 - (void)_commonInitialization
 {
     _private = [[IFWebDataSourcePrivate alloc] init];
@@ -161,9 +151,9 @@ static id IFWebDataSourceMake(void *url, void *attributes, unsigned flags)
 
 - (IFWebController *)controller
 {
-    // All data sources used in a document share the same
-    // controller.  A single document may have many datasource corresponding to
-    // frame or iframes.
+    // All data sources used in a document share the same controller.
+    // A single document may have many data sources corresponding to
+    // frames or iframes.
     if (_private->parent != nil)
         return [_private->parent controller];
     return _private->controller;
diff --git a/WebKit/WebView.subproj/IFWebDataSourcePrivate.h b/WebKit/WebView.subproj/IFWebDataSourcePrivate.h
index 397bb6b..53efdb0 100644
--- a/WebKit/WebView.subproj/IFWebDataSourcePrivate.h
+++ b/WebKit/WebView.subproj/IFWebDataSourcePrivate.h
@@ -69,9 +69,6 @@
     BOOL loading; // self and controller are retained while loading
 }
 
-- init;
-- (void)dealloc;
-
 @end
 
 @interface IFWebDataSource (IFPrivate)
diff --git a/WebKit/WebView.subproj/IFWebViewPrivate.h b/WebKit/WebView.subproj/IFWebViewPrivate.h
index d3f06f6..0431b51 100644
--- a/WebKit/WebView.subproj/IFWebViewPrivate.h
+++ b/WebKit/WebView.subproj/IFWebViewPrivate.h
@@ -30,9 +30,11 @@ class QWidget;
 
 @interface IFWebView (IFPrivate)
 - (void)_setDocumentView:(id <IFDocumentLoading>)view;
-- (void)_setController: (IFWebController *)controller;
+- (void)_setController:(IFWebController *)controller;
 - (int)_marginWidth;
 - (int)_marginHeight;
+- (void)_setMarginWidth:(int)w;
+- (void)_setMarginHeight:(int)h;
 + (NSMutableDictionary *)_viewTypes;
 + (BOOL)_canShowMIMEType:(NSString *)MIMEType;
 @end
diff --git a/WebKit/WebView.subproj/WebDOMNode.m b/WebKit/WebView.subproj/WebDOMNode.m
index 23ca798..8550602 100644
--- a/WebKit/WebView.subproj/WebDOMNode.m
+++ b/WebKit/WebView.subproj/WebDOMNode.m
@@ -47,6 +47,8 @@
     [value release];
     [source release];
     [children release];
+    
+    [super dealloc];
 }
 
 - (NSArray *)children
diff --git a/WebKit/WebView.subproj/WebDataSource.m b/WebKit/WebView.subproj/WebDataSource.m
index 171bbae..523dd04 100644
--- a/WebKit/WebView.subproj/WebDataSource.m
+++ b/WebKit/WebView.subproj/WebDataSource.m
@@ -24,16 +24,6 @@
 
 @implementation IFWebDataSource
 
-static id IFWebDataSourceMake(void *url, void *attributes, unsigned flags) 
-{
-    return [[[IFWebDataSource alloc] initWithURL:(NSURL *)url attributes:(NSDictionary *)attributes flags:flags] autorelease];
-}
-
-+ (void)load
-{
-    WCSetIFWebDataSourceMakeFunc(IFWebDataSourceMake);
-}
-
 - (void)_commonInitialization
 {
     _private = [[IFWebDataSourcePrivate alloc] init];
@@ -161,9 +151,9 @@ static id IFWebDataSourceMake(void *url, void *attributes, unsigned flags)
 
 - (IFWebController *)controller
 {
-    // All data sources used in a document share the same
-    // controller.  A single document may have many datasource corresponding to
-    // frame or iframes.
+    // All data sources used in a document share the same controller.
+    // A single document may have many data sources corresponding to
+    // frames or iframes.
     if (_private->parent != nil)
         return [_private->parent controller];
     return _private->controller;
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.h b/WebKit/WebView.subproj/WebDataSourcePrivate.h
index 397bb6b..53efdb0 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.h
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.h
@@ -69,9 +69,6 @@
     BOOL loading; // self and controller are retained while loading
 }
 
-- init;
-- (void)dealloc;
-
 @end
 
 @interface IFWebDataSource (IFPrivate)
diff --git a/WebKit/WebView.subproj/WebDebugDOMNode.m b/WebKit/WebView.subproj/WebDebugDOMNode.m
index 23ca798..8550602 100644
--- a/WebKit/WebView.subproj/WebDebugDOMNode.m
+++ b/WebKit/WebView.subproj/WebDebugDOMNode.m
@@ -47,6 +47,8 @@
     [value release];
     [source release];
     [children release];
+    
+    [super dealloc];
 }
 
 - (NSArray *)children
diff --git a/WebKit/WebView.subproj/WebFrameViewInternal.h b/WebKit/WebView.subproj/WebFrameViewInternal.h
index d3f06f6..0431b51 100644
--- a/WebKit/WebView.subproj/WebFrameViewInternal.h
+++ b/WebKit/WebView.subproj/WebFrameViewInternal.h
@@ -30,9 +30,11 @@ class QWidget;
 
 @interface IFWebView (IFPrivate)
 - (void)_setDocumentView:(id <IFDocumentLoading>)view;
-- (void)_setController: (IFWebController *)controller;
+- (void)_setController:(IFWebController *)controller;
 - (int)_marginWidth;
 - (int)_marginHeight;
+- (void)_setMarginWidth:(int)w;
+- (void)_setMarginHeight:(int)h;
 + (NSMutableDictionary *)_viewTypes;
 + (BOOL)_canShowMIMEType:(NSString *)MIMEType;
 @end
diff --git a/WebKit/WebView.subproj/WebFrameViewPrivate.h b/WebKit/WebView.subproj/WebFrameViewPrivate.h
index d3f06f6..0431b51 100644
--- a/WebKit/WebView.subproj/WebFrameViewPrivate.h
+++ b/WebKit/WebView.subproj/WebFrameViewPrivate.h
@@ -30,9 +30,11 @@ class QWidget;
 
 @interface IFWebView (IFPrivate)
 - (void)_setDocumentView:(id <IFDocumentLoading>)view;
-- (void)_setController: (IFWebController *)controller;
+- (void)_setController:(IFWebController *)controller;
 - (int)_marginWidth;
 - (int)_marginHeight;
+- (void)_setMarginWidth:(int)w;
+- (void)_setMarginHeight:(int)h;
 + (NSMutableDictionary *)_viewTypes;
 + (BOOL)_canShowMIMEType:(NSString *)MIMEType;
 @end
diff --git a/WebKit/WebView.subproj/WebHTMLRepresentation.h b/WebKit/WebView.subproj/WebHTMLRepresentation.h
index 76cf639..7dc0f38 100644
--- a/WebKit/WebView.subproj/WebHTMLRepresentation.h
+++ b/WebKit/WebView.subproj/WebHTMLRepresentation.h
@@ -8,15 +8,17 @@
 
 @class IFError;
 @class IFWebDataSource;
+ at class IFWebCoreBridge;
 
 class KHTMLPart;
 
 @protocol IFDocumentRepresentation;
 
+ at class IFHTMLRepresentationPrivate;
+
 @interface IFHTMLRepresentation : NSObject <IFDocumentRepresentation>
 {
-    KHTMLPart *part;
-    BOOL isFirstChunk;
+    IFHTMLRepresentationPrivate *_private;
 }
 
 - (KHTMLPart *)part;
diff --git a/WebKit/WebView.subproj/WebHTMLRepresentation.m b/WebKit/WebView.subproj/WebHTMLRepresentation.m
index 198c9b7..d1a193b 100644
--- a/WebKit/WebView.subproj/WebHTMLRepresentation.m
+++ b/WebKit/WebView.subproj/WebHTMLRepresentation.m
@@ -5,40 +5,51 @@
 
 #import <WebKit/IFHTMLRepresentation.h>
 #import <WebKit/IFWebDataSource.h>
+#import <WebKit/IFWebCoreBridge.h>
 #import <KWQKHTMLPartImpl.h>
 
+ at interface IFHTMLRepresentationPrivate : NSObject
+{
+    IFWebCoreBridge *bridge;
+}
+ at end
+
+ at implementation IFHTMLRepresentationPrivate
+ at end
+
 @implementation IFHTMLRepresentation
 
 - init
 {
-    part = new KHTMLPart();
-    isFirstChunk = YES;
+    [super init];
+    
+    _private = [[IFHTMLRepresentationPrivate alloc] init];
+    _private->bridge = [[IFWebCoreBridge alloc] init];
     
     return self;
 }
 
 - (void)dealloc
 {
-    part->deref();
+    [_private->bridge release];
+    [_private release];
+
+    [super dealloc];
+}
+
+- (IFWebCoreBridge *)_bridge
+{
+    return _private->bridge;
 }
 
 - (KHTMLPart *)part
 {
-    return part;
+    return [_private->bridge KHTMLPart];
 }
 
 - (void)receivedData:(NSData *)data withDataSource:(IFWebDataSource *)dataSource
 {
-    if(isFirstChunk){
-        // FIXME [rjw]:  Do any work need in the kde engine.  This should be removed.
-        // We should move any code needed out of KWQ.
-        part->openURL([[[dataSource inputURL] absoluteString] cString]);
-        part->impl->setDataSource(dataSource);
-    }
-    
-    part->impl->slotData([dataSource encoding], (const char *)[data bytes], [data length], NO);
-    
-    isFirstChunk = NO;
+    [_private->bridge receivedData:data withDataSource:dataSource];
 }
 
 - (void)receivedError:(IFError *)error withDataSource:(IFWebDataSource *)dataSource
diff --git a/WebKit/WebView.subproj/WebHTMLRepresentationPrivate.h b/WebKit/WebView.subproj/WebHTMLRepresentationPrivate.h
new file mode 100644
index 0000000..4242361
--- /dev/null
+++ b/WebKit/WebView.subproj/WebHTMLRepresentationPrivate.h
@@ -0,0 +1,10 @@
+/*	
+    IFHTMLRepresentationPrivate.h
+	Copyright 2002, Apple, Inc. All rights reserved.
+*/
+
+#import <WebKit/IFHTMLRepresentation.h>
+
+ at interface IFHTMLRepresentation <IFPrivate>
+- (IFWebCoreBridge *)_bridge;
+ at end
diff --git a/WebKit/WebView.subproj/WebImageView.m b/WebKit/WebView.subproj/WebImageView.m
index 050e5d7..d6dc566 100644
--- a/WebKit/WebView.subproj/WebImageView.m
+++ b/WebKit/WebView.subproj/WebImageView.m
@@ -26,6 +26,8 @@
 {
     [[representation image] stopAnimation];
     [representation release];
+    
+    [super dealloc];
 }
 
 - (BOOL)isFlipped 
diff --git a/WebKit/WebView.subproj/WebRenderNode.m b/WebKit/WebView.subproj/WebRenderNode.m
index b239f10..0edde02 100644
--- a/WebKit/WebView.subproj/WebRenderNode.m
+++ b/WebKit/WebView.subproj/WebRenderNode.m
@@ -62,6 +62,8 @@
 {
     [name release];
     [children release];
+    
+    [super dealloc];
 }
 
 - (NSArray *)children

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list