Commit 8e5c5e36 authored by darin's avatar darin

WebCore:

	Cut down our copied and pasted code even more.

	* WebCore.exp: Change what's exported for things that moved from
	KHTMLPart into KWQKHTMLPartImpl.

	* khtml/.cvsignore:
	* khtml/css/.cvsignore:
	* khtml/dom/.cvsignore:
	* khtml/ecma/.cvsignore:
	* khtml/html/.cvsignore:
	* khtml/java/.cvsignore:
	* khtml/misc/.cvsignore:
	* khtml/rendering/.cvsignore:
	* khtml/xml/.cvsignore:
	Some .cvsignore hygiene.

	* khtml/khtml_part.cpp: Use a lot more of this file, rather than using a copy inside
	the kwq directory. Now we have KWQKHTMLPartImpl for the part that does need to be in kwq.
	* khtml/khtml_part.h: Add KWQKHTMLPartImpl pointer, remove most of the other APPLE_CHANGES.
	* khtml/khtmlpart_p.h: Remove almost all of the APPLE_CHANGES.
	* kwq/KWQKHTMLPart.mm: Changed everything from being part of KHTMLPart to be a separate
	KWQKHTMLPartImpl class. Minimized copied and pasted code; still more to do.
	* kwq/KWQKHTMLPartImpl.h: Added. Interface so KHTMLPart can call into kwq as necessary.

	* khtml/misc/Makefile.am: Added loader.cpp.
	* khtml/misc/loader.cpp: Added from KDE 3.0. Rolled most of the changes from KWQKloader.mm
	in here. The kwq-specific part is now in a KWQLoaderImpl class.
	* khtml/misc/loader.h: Replace LoaderPrivate with KWQLoaderImpl.
	* khtml/misc/loader.moc: Added empty file.
	* kwq/KWQKloader.mm: Changed everything to be a separate KWQLoaderImpl class.
	Minimized copied and pasted code.
	* kwq/KWQLoaderImpl.h: Added. Interface so loader can call into kwq as necessary.
	* kwq/loader.moc: Removed empty file.

	* kwq/kparts/historyprovider.h: Add HistoryProvider::insert.
	* kwq/KWQKHistoryProvider.mm: Add HistoryProvider::insert.

	* kwq/KWQKLocale.mm: (KLocale::language): Simplify.

	* kwq/KWQListBox.h:
	* kwq/KWQNSTextField.h:
	Use import instead of include for Cocoa.h.

	* kwq/KWQScrollView.mm: (QScrollView::contentsToViewport): Implement this.

	* kwq/external.h: Add declarations so this can be included cleanly.

	* kwq/khtml/khtml_pagecache.h: Put a no-op cache in here so we don't have to do so
	many APPLE_CHANGES ifdefs.

	* kwq/kparts/part.h: Put ref/deref and event/customEvent in here so they don't need
	to be added to KHTMLPart.

	* kwq/kio/scheduler.h: Add <qtimer.h> include to help us build (not sure if it's
	really needed.
	* kwq/kparts/partmanager.h: Add <qdatetime.h> include to help us build (not sure if it's
	really needed.

WebKit:

	Use methods in KWQKHTMLPartImpl that were moved there from KHTMLPart.

	* WebView.subproj/IFMainURLHandleClient.mm:
	(-[IFMainURLHandleClient IFURLHandle:didRedirectToURL:]):
	(-[IFMainURLHandleClient processData:isComplete:allDataReceived:]):
	* WebView.subproj/IFWebDataSource.mm:
	(-[IFWebDataSource documentText]):
	* WebView.subproj/IFWebDataSourcePrivate.mm:
	(-[IFWebDataSource _setController:]):
	* WebView.subproj/IFWebFramePrivate.mm:
	(-[IFWebFrame _isLoadComplete]):
	* WebView.subproj/IFWebView.mm:
	(-[IFWebView provisionalDataSourceChanged:]):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1240 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 50e4b8ba
2002-05-30 Darin Adler <darin@apple.com>
Cut down our copied and pasted code even more.
* WebCore.exp: Change what's exported for things that moved from
KHTMLPart into KWQKHTMLPartImpl.
* khtml/.cvsignore:
* khtml/css/.cvsignore:
* khtml/dom/.cvsignore:
* khtml/ecma/.cvsignore:
* khtml/html/.cvsignore:
* khtml/java/.cvsignore:
* khtml/misc/.cvsignore:
* khtml/rendering/.cvsignore:
* khtml/xml/.cvsignore:
Some .cvsignore hygiene.
* khtml/khtml_part.cpp: Use a lot more of this file, rather than using a copy inside
the kwq directory. Now we have KWQKHTMLPartImpl for the part that does need to be in kwq.
* khtml/khtml_part.h: Add KWQKHTMLPartImpl pointer, remove most of the other APPLE_CHANGES.
* khtml/khtmlpart_p.h: Remove almost all of the APPLE_CHANGES.
* kwq/KWQKHTMLPart.mm: Changed everything from being part of KHTMLPart to be a separate
KWQKHTMLPartImpl class. Minimized copied and pasted code; still more to do.
* kwq/KWQKHTMLPartImpl.h: Added. Interface so KHTMLPart can call into kwq as necessary.
* khtml/misc/Makefile.am: Added loader.cpp.
* khtml/misc/loader.cpp: Added from KDE 3.0. Rolled most of the changes from KWQKloader.mm
in here. The kwq-specific part is now in a KWQLoaderImpl class.
* khtml/misc/loader.h: Replace LoaderPrivate with KWQLoaderImpl.
* khtml/misc/loader.moc: Added empty file.
* kwq/KWQKloader.mm: Changed everything to be a separate KWQLoaderImpl class.
Minimized copied and pasted code.
* kwq/KWQLoaderImpl.h: Added. Interface so loader can call into kwq as necessary.
* kwq/loader.moc: Removed empty file.
* kwq/kparts/historyprovider.h: Add HistoryProvider::insert.
* kwq/KWQKHistoryProvider.mm: Add HistoryProvider::insert.
* kwq/KWQKLocale.mm: (KLocale::language): Simplify.
* kwq/KWQListBox.h:
* kwq/KWQNSTextField.h:
Use import instead of include for Cocoa.h.
* kwq/KWQScrollView.mm: (QScrollView::contentsToViewport): Implement this.
* kwq/external.h: Add declarations so this can be included cleanly.
* kwq/khtml/khtml_pagecache.h: Put a no-op cache in here so we don't have to do so
many APPLE_CHANGES ifdefs.
* kwq/kparts/part.h: Put ref/deref and event/customEvent in here so they don't need
to be added to KHTMLPart.
* kwq/kio/scheduler.h: Add <qtimer.h> include to help us build (not sure if it's
really needed.
* kwq/kparts/partmanager.h: Add <qdatetime.h> include to help us build (not sure if it's
really needed.
=== Alexander-7 ===
2002-05-29 Richard Williamson <rjw@apple.com>
......
2002-05-30 Darin Adler <darin@apple.com>
Cut down our copied and pasted code even more.
* WebCore.exp: Change what's exported for things that moved from
KHTMLPart into KWQKHTMLPartImpl.
* khtml/.cvsignore:
* khtml/css/.cvsignore:
* khtml/dom/.cvsignore:
* khtml/ecma/.cvsignore:
* khtml/html/.cvsignore:
* khtml/java/.cvsignore:
* khtml/misc/.cvsignore:
* khtml/rendering/.cvsignore:
* khtml/xml/.cvsignore:
Some .cvsignore hygiene.
* khtml/khtml_part.cpp: Use a lot more of this file, rather than using a copy inside
the kwq directory. Now we have KWQKHTMLPartImpl for the part that does need to be in kwq.
* khtml/khtml_part.h: Add KWQKHTMLPartImpl pointer, remove most of the other APPLE_CHANGES.
* khtml/khtmlpart_p.h: Remove almost all of the APPLE_CHANGES.
* kwq/KWQKHTMLPart.mm: Changed everything from being part of KHTMLPart to be a separate
KWQKHTMLPartImpl class. Minimized copied and pasted code; still more to do.
* kwq/KWQKHTMLPartImpl.h: Added. Interface so KHTMLPart can call into kwq as necessary.
* khtml/misc/Makefile.am: Added loader.cpp.
* khtml/misc/loader.cpp: Added from KDE 3.0. Rolled most of the changes from KWQKloader.mm
in here. The kwq-specific part is now in a KWQLoaderImpl class.
* khtml/misc/loader.h: Replace LoaderPrivate with KWQLoaderImpl.
* khtml/misc/loader.moc: Added empty file.
* kwq/KWQKloader.mm: Changed everything to be a separate KWQLoaderImpl class.
Minimized copied and pasted code.
* kwq/KWQLoaderImpl.h: Added. Interface so loader can call into kwq as necessary.
* kwq/loader.moc: Removed empty file.
* kwq/kparts/historyprovider.h: Add HistoryProvider::insert.
* kwq/KWQKHistoryProvider.mm: Add HistoryProvider::insert.
* kwq/KWQKLocale.mm: (KLocale::language): Simplify.
* kwq/KWQListBox.h:
* kwq/KWQNSTextField.h:
Use import instead of include for Cocoa.h.
* kwq/KWQScrollView.mm: (QScrollView::contentsToViewport): Implement this.
* kwq/external.h: Add declarations so this can be included cleanly.
* kwq/khtml/khtml_pagecache.h: Put a no-op cache in here so we don't have to do so
many APPLE_CHANGES ifdefs.
* kwq/kparts/part.h: Put ref/deref and event/customEvent in here so they don't need
to be added to KHTMLPart.
* kwq/kio/scheduler.h: Add <qtimer.h> include to help us build (not sure if it's
really needed.
* kwq/kparts/partmanager.h: Add <qdatetime.h> include to help us build (not sure if it's
really needed.
=== Alexander-7 ===
2002-05-29 Richard Williamson <rjw@apple.com>
......
2002-05-30 Darin Adler <darin@apple.com>
Cut down our copied and pasted code even more.
* WebCore.exp: Change what's exported for things that moved from
KHTMLPart into KWQKHTMLPartImpl.
* khtml/.cvsignore:
* khtml/css/.cvsignore:
* khtml/dom/.cvsignore:
* khtml/ecma/.cvsignore:
* khtml/html/.cvsignore:
* khtml/java/.cvsignore:
* khtml/misc/.cvsignore:
* khtml/rendering/.cvsignore:
* khtml/xml/.cvsignore:
Some .cvsignore hygiene.
* khtml/khtml_part.cpp: Use a lot more of this file, rather than using a copy inside
the kwq directory. Now we have KWQKHTMLPartImpl for the part that does need to be in kwq.
* khtml/khtml_part.h: Add KWQKHTMLPartImpl pointer, remove most of the other APPLE_CHANGES.
* khtml/khtmlpart_p.h: Remove almost all of the APPLE_CHANGES.
* kwq/KWQKHTMLPart.mm: Changed everything from being part of KHTMLPart to be a separate
KWQKHTMLPartImpl class. Minimized copied and pasted code; still more to do.
* kwq/KWQKHTMLPartImpl.h: Added. Interface so KHTMLPart can call into kwq as necessary.
* khtml/misc/Makefile.am: Added loader.cpp.
* khtml/misc/loader.cpp: Added from KDE 3.0. Rolled most of the changes from KWQKloader.mm
in here. The kwq-specific part is now in a KWQLoaderImpl class.
* khtml/misc/loader.h: Replace LoaderPrivate with KWQLoaderImpl.
* khtml/misc/loader.moc: Added empty file.
* kwq/KWQKloader.mm: Changed everything to be a separate KWQLoaderImpl class.
Minimized copied and pasted code.
* kwq/KWQLoaderImpl.h: Added. Interface so loader can call into kwq as necessary.
* kwq/loader.moc: Removed empty file.
* kwq/kparts/historyprovider.h: Add HistoryProvider::insert.
* kwq/KWQKHistoryProvider.mm: Add HistoryProvider::insert.
* kwq/KWQKLocale.mm: (KLocale::language): Simplify.
* kwq/KWQListBox.h:
* kwq/KWQNSTextField.h:
Use import instead of include for Cocoa.h.
* kwq/KWQScrollView.mm: (QScrollView::contentsToViewport): Implement this.
* kwq/external.h: Add declarations so this can be included cleanly.
* kwq/khtml/khtml_pagecache.h: Put a no-op cache in here so we don't have to do so
many APPLE_CHANGES ifdefs.
* kwq/kparts/part.h: Put ref/deref and event/customEvent in here so they don't need
to be added to KHTMLPart.
* kwq/kio/scheduler.h: Add <qtimer.h> include to help us build (not sure if it's
really needed.
* kwq/kparts/partmanager.h: Add <qdatetime.h> include to help us build (not sure if it's
really needed.
=== Alexander-7 ===
2002-05-29 Richard Williamson <rjw@apple.com>
......
......@@ -2,7 +2,13 @@
.objc_class_name_WebCoreViewFactory
.objc_class_name_WebCoreImageRendererFactory
__Z27WCSetIFLoadProgressMakeFuncPFP11objc_objectvE
__Z28WCSetIFWebDataSourceMakeFuncPFP11objc_objectPvS1_jE
__ZN11QMouseEventC1EN6QEvent4TypeERK6QPointii
__ZN16KWQKHTMLPartImpl10setBaseURLERK4KURL
__ZN16KWQKHTMLPartImpl13setDataSourceEP15IFWebDataSource
__ZN16KWQKHTMLPartImpl14gotoBaseAnchorEv
__ZN16KWQKHTMLPartImpl7setViewEP9KHTMLView
__ZN16KWQKHTMLPartImpl8slotDataEP8NSStringPKcib
__ZN3DOM12DocumentImpl19updateStyleSelectorEv
__ZN3DOM9DOMStringD1Ev
__ZN3DOM9DomShared3refEv
......@@ -12,27 +18,21 @@ __ZN4KURLD1Ev
__ZN5khtml5Cache13getStatisticsEv
__ZN5khtml5Cache16setCacheDisabledEb
__ZN5khtml5Cache8flushAllEv
__ZN6QPointC1Eii
__ZN6QEventD2Ev
__ZN6QPointC1Eii
__ZN7QString12fromNSStringEP8NSString
__ZN7QStringD1Ev
__ZN7QWidget7setViewEP6NSView
__ZN8QPainterC1EP7QWidget
__ZN8QPainterD1Ev
__ZN9KHTMLPart10setBaseURLERK4KURL
__ZN9KHTMLPart13setDataSourceEP15IFWebDataSource
__ZN9KHTMLPart14gotoBaseAnchorEv
__ZN9KHTMLPart7setViewEP9KHTMLView
__ZN9KHTMLPart8slotDataEP8NSStringPKcib
__ZN9KHTMLPartC1EP7QWidgetPKcP7QObjectS3_NS_10GUIProfileE
__ZN9KHTMLView6layoutEv
__ZN9KHTMLViewC1EP9KHTMLPartP7QWidgetPKc
__ZN9QKeyEventC1EN6QEvent4TypeEiiiRK7QStringbt
__ZNK16KWQKHTMLPartImpl14documentSourceEv
__ZNK3DOM8NodeImpl16recursive_toHTMLEb
__ZNK3DOM8NodeImpl8rendererEv
__ZNK3DOM9DOMString6stringEv
__ZNK7QString6latin1Ev
__ZNK7QWidget7getViewEv
__ZNK9KHTMLPart10xmlDocImplEv
__ZNK9KHTMLPart14documentSourceEv
__Z28WCSetIFWebDataSourceMakeFuncPFP11objc_objectPvS1_jE
__ZN7QString12fromNSStringEP8NSString
__ZN9QKeyEventC1EN6QEvent4TypeEiiiRK7QStringbt
Makefile
Makefile.in
testkhtml
testcss
testrender
SunWS_cache
ir.out
testkhtml_static
*.moc
.deps
.libs
*.lo
*.la
......@@ -9,6 +9,3 @@ cssproperties.strip
cssproperties.h
.deps
*-stamp
*.lo
*.la
.libs
Makefile.in
Makefile
.deps
.libs
*.lo
*.la
Makefile.in
Makefile
testecma
.deps
.libs
*.la
*.lo
*.moc
*.lut.h
Makefile
Makefile.in
*.moc
kentities.c
Makefile
Makefile.in
.deps
.libs
*.lo
*.la
*.moc
......@@ -31,6 +31,7 @@
#define DIRECT_LINKAGE_TO_ECMA
#define QT_NO_CLIPBOARD
#define QT_NO_DRAGANDDROP
#include <KWQKHTMLPartImpl.h>
#endif
#include "khtml_pagecache.h"
......@@ -133,6 +134,8 @@ FrameList::Iterator FrameList::find( const QString &name )
return it;
}
#endif // APPLE_CHANGES
KHTMLPart::KHTMLPart( QWidget *parentWidget, const char *widgetname, QObject *parent, const char *name,
GUIProfile prof )
: KParts::ReadOnlyPart( parent, name )
......@@ -140,9 +143,15 @@ KHTMLPart::KHTMLPart( QWidget *parentWidget, const char *widgetname, QObject *pa
d = 0;
KHTMLFactory::registerPart( this );
setInstance( KHTMLFactory::instance(), prof == BrowserViewGUI && !parentPart() );
#ifdef APPLE_CHANGES
init( 0, prof );
#else
init( new KHTMLView( this, parentWidget, widgetname ), prof );
#endif
}
#ifndef APPLE_CHANGES
KHTMLPart::KHTMLPart( KHTMLView *view, QObject *parent, const char *name, GUIProfile prof )
: KParts::ReadOnlyPart( parent, name )
{
......@@ -153,7 +162,7 @@ KHTMLPart::KHTMLPart( KHTMLView *view, QObject *parent, const char *name, GUIPro
init( view, prof );
}
#endif
#endif // APPLE_CHANGES
void KHTMLPart::init( KHTMLView *view, GUIProfile prof )
{
......@@ -244,15 +253,15 @@ void KHTMLPart::init( KHTMLView *view, GUIProfile prof )
d->m_dcopobject = new KHTMLPartIface(this);
#endif
#ifdef APPLE_CHANGES
impl = new KWQKHTMLPartImpl(this);
#endif
}
KHTMLPart::~KHTMLPart()
{
//kdDebug(6050) << "KHTMLPart::~KHTMLPart " << this << endl;
#ifdef APPLE_CHANGES
killTimer(d->m_redirectionTimer);
d->m_redirectionTimer = 0;
#endif
#ifndef APPLE_CHANGES
if ( d->m_findDialog )
disconnect( d->m_findDialog, SIGNAL( destroyed() ),
......@@ -293,6 +302,10 @@ KHTMLPart::~KHTMLPart()
d->m_view->viewport()->hide();
d->m_view->m_part = 0;
}
#ifdef APPLE_CHANGES
delete impl;
#endif
delete d; d = 0;
KHTMLFactory::deregisterPart( this );
......@@ -330,9 +343,9 @@ bool KHTMLPart::restoreURL( const KURL &url )
m_url = url;
#ifndef APPLE_CHANGES
KHTMLPageCache::self()->fetchData( d->m_cacheId, this, SLOT(slotRestoreData(const QByteArray &)));
#ifndef APPLE_CHANGES
emit started( 0L );
#endif
......@@ -340,10 +353,12 @@ bool KHTMLPart::restoreURL( const KURL &url )
}
#ifndef APPLE_CHANGES
bool KHTMLPart::openURL( const KURL &url )
{
#ifdef APPLE_CHANGES
impl->openURL(url);
return true;
#else
kdDebug( 6050 ) << "KHTMLPart(" << this << ")::openURL " << url.url() << endl;
d->m_redirectionTimer.stop();
......@@ -472,17 +487,15 @@ bool KHTMLPart::openURL( const KURL &url )
emit started( 0L );
return true;
#endif // APPLE_CHANGES
}
#endif
bool KHTMLPart::closeURL()
{
if ( d->m_job )
{
#ifndef APPLE_CHANGES
KHTMLPageCache::self()->cancelEntry(d->m_cacheId);
#endif
d->m_job->kill();
d->m_job = 0;
}
......@@ -502,9 +515,7 @@ bool KHTMLPart::closeURL()
d->m_bLoadEventEmitted = true; // don't want that one either
d->m_bReloading = false;
#ifndef APPLE_CHANGES
KHTMLPageCache::self()->cancelFetch(this);
#endif
if ( d->m_doc && d->m_doc->parsing() )
{
kdDebug( 6050 ) << " was still parsing... calling end " << endl;
......@@ -523,10 +534,10 @@ bool KHTMLPart::closeURL()
d->m_workingURL = KURL();
#ifndef APPLE_CHANGES
if ( d->m_doc && d->m_doc->docLoader() )
khtml::Cache::loader()->cancelRequests( d->m_doc->docLoader() );
#ifndef APPLE_CHANGES
// tell all subframes to stop as well
ConstFrameIt it = d->m_frames.begin();
ConstFrameIt end = d->m_frames.end();
......@@ -753,6 +764,8 @@ bool KHTMLPart::pluginsEnabled() const
return d->m_bPluginsEnabled;
}
#ifndef APPLE_CHANGES
void KHTMLPart::slotShowDocument( const QString &url, const QString &target )
{
// this is mostly copied from KHTMLPart::slotChildURLRequest. The better approach
......@@ -784,7 +797,6 @@ void KHTMLPart::slotShowDocument( const QString &url, const QString &target )
}
else if ( frameName != QString::fromLatin1( "_self" ) )
{
#ifndef APPLE_CHANGES
khtml::ChildFrame *_frame = recursiveFrameRequest( url, args );
if ( !_frame )
......@@ -794,7 +806,6 @@ void KHTMLPart::slotShowDocument( const QString &url, const QString &target )
}
child = _frame;
#endif
}
}
......@@ -814,6 +825,8 @@ void KHTMLPart::slotShowDocument( const QString &url, const QString &target )
}
}
#endif // APPLE_CHANGES
void KHTMLPart::slotDebugDOMTree()
{
if ( d->m_doc && d->m_doc->firstChild() )
......@@ -1017,9 +1030,7 @@ void KHTMLPart::slotData( KIO::Job* kio_job, const QByteArray &data )
d->m_doc->docLoader()->setReloading(d->m_bReloading);
d->m_workingURL = KURL();
#ifndef APPLE_CHANGES
d->m_cacheId = KHTMLPageCache::self()->createCacheEntry();
#endif
// When the first data arrives, the metadata has just been made available
d->m_bSecurityInQuestion = false;
......@@ -1110,9 +1121,7 @@ void KHTMLPart::slotData( KIO::Job* kio_job, const QByteArray &data )
//kdDebug() << "KHTMLPart::slotData metadata modified: " << d->m_lastModified << endl;
}
#ifndef APPLE_CHANGES
KHTMLPageCache::self()->addData(d->m_cacheId, data);
#endif
write( data.data(), data.size() );
}
......@@ -1265,9 +1274,7 @@ void KHTMLPart::slotFinished( KIO::Job * job )
{
if (job->error())
{
#ifndef APPLE_CHANGES
KHTMLPageCache::self()->cancelEntry(d->m_cacheId);
#endif
d->m_job = 0L;
#ifndef APPLE_CHANGES
emit canceled( job->errorString() );
......@@ -1281,9 +1288,7 @@ void KHTMLPart::slotFinished( KIO::Job * job )
}
//kdDebug( 6050 ) << "slotFinished" << endl;
#ifndef APPLE_CHANGES
KHTMLPageCache::self()->endData(d->m_cacheId);
#endif
if ( d->m_doc && d->m_doc->docLoader()->expireDate() && m_url.protocol().lower().startsWith("http"))
KIO::http_update_cache(m_url, false, d->m_doc->docLoader()->expireDate());
......@@ -1295,17 +1300,17 @@ void KHTMLPart::slotFinished( KIO::Job * job )
end(); //will emit completed()
}
#ifndef APPLE_CHANGES
void KHTMLPart::begin( const KURL &url, int xOffset, int yOffset )
{
#ifdef APPLE_CHANGES
impl->begin(url, xOffset, xOffset);
#else
clear();
d->m_bCleared = false;
d->m_cacheId = 0;
d->m_bComplete = false;
d->m_bLoadEventEmitted = false;
#ifndef APPLE_CHANGES
if(url.isValid()) {
QString urlString = url.url();
KHTMLFactory::vLinks()->insert( urlString );
......@@ -1314,7 +1319,6 @@ void KHTMLPart::begin( const KURL &url, int xOffset, int yOffset )
KHTMLFactory::vLinks()->insert( urlString2 );
}
}
#endif
// ###
//stopParser();
......@@ -1328,7 +1332,6 @@ void KHTMLPart::begin( const KURL &url, int xOffset, int yOffset )
m_url = url;
KURL baseurl;
#ifndef APPLE_CHANGES
if ( !m_url.isEmpty() )
{
KURL::List lst = KURL::split( m_url );
......@@ -1342,7 +1345,6 @@ void KHTMLPart::begin( const KURL &url, int xOffset, int yOffset )
}
else
emit setWindowCaption( i18n( "no title", "* Unknown *" ) );
#endif
// ### not sure if XHTML documents served as text/xml should use DocumentImpl or HTMLDocumentImpl
if (args.serviceType == "text/xml")
......@@ -1357,11 +1359,8 @@ void KHTMLPart::begin( const KURL &url, int xOffset, int yOffset )
// We prefer m_baseURL over m_url because m_url changes when we are
// about to load a new page.
d->m_doc->setBaseURL( baseurl.url() );
#ifndef APPLE_CHANGES
d->m_doc->docLoader()->setShowAnimations( KHTMLFactory::defaultHTMLSettings()->showAnimations() );
#endif
#ifndef APPLE_CHANGES
// Inherit domain from parent
KHTMLPart* parent = parentPart();
if (d->m_doc->isHTMLDocument() && parent && parent->d->m_doc && parent->d->m_doc->isHTMLDocument()) {
......@@ -1372,30 +1371,29 @@ void KHTMLPart::begin( const KURL &url, int xOffset, int yOffset )
d->m_paUseStylesheet->setItems(QStringList());
d->m_paUseStylesheet->setEnabled( false );
#endif
setAutoloadImages( KHTMLFactory::defaultHTMLSettings()->autoLoadImages() );
QString userStyleSheet = KHTMLFactory::defaultHTMLSettings()->userStyleSheet();
if ( !userStyleSheet.isEmpty() )
setUserStyleSheet( KURL( userStyleSheet ) );
#ifndef APPLE_CHANGES
d->m_doc->setRestoreState(args.docState);
#endif
d->m_doc->open();
// clear widget
d->m_view->resizeContents( 0, 0 );
connect(d->m_doc,SIGNAL(finishedParsing()),this,SLOT(slotFinishedParsing()));
#ifndef APPLE_CHANGES
emit d->m_extension->enableAction( "print", true );
#endif
d->m_doc->setParsing(true);
#endif // APPLE_CHANGES
}
void KHTMLPart::write( const char *str, int len )
{
#ifdef APPLE_CHANGES
impl->write(str, len);
#else
if ( !d->m_decoder ) {
d->m_decoder = new khtml::Decoder();
if(d->m_encoding != QString::null)
......@@ -1429,10 +1427,9 @@ void KHTMLPart::write( const char *str, int len )
Tokenizer* t = d->m_doc->tokenizer();
if(t)
t->write( decoded, true );
#endif // APPLE_CHANGES
}
#endif
void KHTMLPart::write( const QString &str )
{
if ( str.isNull() )
......@@ -1450,18 +1447,19 @@ void KHTMLPart::write( const QString &str )
t->write( str, true );
}
#ifndef APPLE_CHANGES
void KHTMLPart::end()
{
#ifdef APPLE_CHANGES
impl->end();
#else
// make sure nothing's left in there...
if(d->m_decoder)
write(d->m_decoder->flush());
if (d->m_doc)
d->m_doc->finishParsing();
#endif
}
#endif
void KHTMLPart::paint(QPainter *p, const QRect &rc, int yOff, bool *more)
{
......@@ -1655,19 +1653,19 @@ void KHTMLPart::checkCompleted()
void KHTMLPart::checkEmitLoadEvent()
{
#ifndef APPLE_CHANGES
if ( d->m_bLoadEventEmitted || !d->m_doc || d->m_doc->parsing() ) return;
#ifndef APPLE_CHANGES
ConstFrameIt it = d->m_frames.begin();
ConstFrameIt end = d->m_frames.end();
for (; it != end; ++it )
if ( !(*it).m_bCompleted ) // still got a frame running -> too early
return;
#endif
d->m_bLoadEventEmitted = true;
if (d->m_doc)
d->m_doc->close();
#endif
}
const KHTMLSettings *KHTMLPart::settings() const
......@@ -1701,12 +1699,13 @@ KURL KHTMLPart::completeURL( const QString &url )
return KURL( d->m_doc->completeURL( url ) );
}