26 #include "css/cssstyleselector.h"
27 #include "css/css_mediaquery.h"
28 #include "html/html_imageimpl.h"
29 #include "rendering/render_style.h"
30 #include "rendering/break_lines.h"
31 #include "misc/htmlnames.h"
32 #include "misc/loader.h"
33 #include "misc/arena.h"
34 #include "misc/paintbuffer.h"
36 #include <QtCore/QLinkedList>
51 unsigned long int KHTMLGlobal::s_refcnt = 0;
57 static QLinkedList<KHTMLPart*> *
s_parts = 0;
58 static QLinkedList<DOM::DocumentImpl*> *
s_docs = 0;
68 khtml::NamespaceFactory::initIdTable();
69 khtml::PrefixFactory::initIdTable();
70 khtml::LocalNameFactory::initIdTable();
71 DOM::emptyLocalName = DOM::LocalName::fromId(0);
72 DOM::emptyPrefixName = DOM::PrefixName::fromId(0);
73 DOM::emptyNamespaceName = DOM::NamespaceName::fromId(DOM::emptyNamespace);
84 delete s_componentData;
87 delete KHTMLSettings::avFamilies;
103 KHTMLSettings::avFamilies = 0;
106 khtml::CSSStyleSelector::clear();
107 khtml::RenderStyle::cleanup();
108 khtml::RenderObject::cleanup();
109 khtml::PaintBuffer::cleanup();
110 khtml::MediaQueryEvaluator::cleanup();
111 khtml::Cache::clear();
112 khtml::cleanup_thaibreaks();
113 khtml::ArenaFinish();
119 void KHTMLGlobal::ref()
121 if ( !s_refcnt && !s_self )
140 void KHTMLGlobal::deref()
143 if ( !--s_refcnt && s_self )
154 s_parts =
new QLinkedList<KHTMLPart*>;
156 if ( !
s_parts->contains( part ) ) {
167 if (
s_parts->removeAll( part ) ) {
180 s_docs =
new QLinkedList<DOM::DocumentImpl*>;
182 if ( !
s_docs->contains( doc ) ) {
193 if (
s_docs->removeAll( doc ) ) {
194 if (
s_docs->isEmpty() ) {
206 if ( !s_componentData )
209 ki18n(
"Embeddable HTML component" ),
224 return *s_componentData;
252 kWarning(6000) <<
"Part" << part->
url() <<
"was not deleted";
256 Q_FOREACH(DOM::DocumentImpl *doc, *
s_docs) {
257 kWarning(6000) <<
"Document" << doc->URL() <<
"was not deleted";