FOUC
Alexander Kellett
lypanov@kde.org
Sun, 12 Jan 2003 16:15:28 +0100
--huq684BweRXVnRxX
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
On Sun, Jan 12, 2003 at 01:40:35AM +0200, Antti Koivisto wrote:
> Well, FOUC code does not work correctly with blockBidi in its current form, so
> in that sense the changes are related.
i've tried without the blockbidi changes and with the
attached patch (against head again) it appears to work quite well.
only problem is that on for example nvidia.com an assert(style->display != NONE)
fails. i removed that assert rather than debugging that actual
problem and fouc appears to work here now :)
think its pretty clean of all non-related changes,
but I may have missed a few related patches.
anyways, i've learnt plenty about khtml now and have
read the safari patch in full at last :)
Alex
--
"[...] Konqueror open source project. Weighing in at less than
one tenth the size of another open source renderer"
Apple, Jan 2003 (http://www.apple.com/safari/)
--huq684BweRXVnRxX
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="fouc-all-v3.patch"
Index: css/cssstyleselector.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/css/cssstyleselector.cpp,v
retrieving revision 1.246
diff -u -p -B -w -r1.246 cssstyleselector.cpp
--- css/cssstyleselector.cpp 9 Jan 2003 07:14:24 -0000 1.246
+++ css/cssstyleselector.cpp 12 Jan 2003 15:19:26 -0000
@@ -73,6 +73,7 @@ CSSStyleSelectorList *CSSStyleSelector::
CSSStyleSelectorList *CSSStyleSelector::defaultQuirksStyle = 0;
CSSStyleSelectorList *CSSStyleSelector::defaultPrintStyle = 0;
CSSStyleSheetImpl *CSSStyleSelector::defaultSheet = 0;
+RenderStyle* CSSStyleSelector::styleNotYetAvailable = 0;
enum PseudoState { PseudoUnknown, PseudoNone, PseudoLink, PseudoVisited};
static PseudoState pseudoState;
@@ -220,10 +221,12 @@ void CSSStyleSelector::clear()
delete defaultQuirksStyle;
delete defaultPrintStyle;
delete defaultSheet;
+ delete styleNotYetAvailable;
defaultStyle = 0;
defaultQuirksStyle = 0;
defaultPrintStyle = 0;
defaultSheet = 0;
+ styleNotYetAvailable = 0;
}
#define MAXFONTSIZES 15
@@ -292,6 +295,15 @@ static inline void bubbleSort( CSSOrdere
RenderStyle *CSSStyleSelector::styleForElement(ElementImpl *e, int state)
{
+ if (!e->getDocument()->haveStylesheetsLoaded()) {
+ if (!styleNotYetAvailable) {
+ styleNotYetAvailable = new RenderStyle();
+ styleNotYetAvailable->setDisplay(NONE);
+ styleNotYetAvailable->ref();
+ }
+ return styleNotYetAvailable;
+ }
+
// set some variables we will need
dynamicState = state;
usedDynamicStates = StyleSelector::None;
Index: css/cssstyleselector.h
===================================================================
RCS file: /home/kde/kdelibs/khtml/css/cssstyleselector.h,v
retrieving revision 1.30
diff -u -p -B -w -r1.30 cssstyleselector.h
--- css/cssstyleselector.h 8 Jan 2003 18:15:50 -0000 1.30
+++ css/cssstyleselector.h 12 Jan 2003 15:19:26 -0000
@@ -162,6 +162,9 @@ namespace khtml
CSSStyleSelectorList *authorStyle;
CSSStyleSelectorList *userStyle;
DOM::CSSStyleSheetImpl *userSheet;
+ public:
+ static RenderStyle *styleNotYetAvailable;
+
public:
private:
Index: html/html_baseimpl.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/html/html_baseimpl.cpp,v
retrieving revision 1.175
diff -u -p -B -w -r1.175 html_baseimpl.cpp
--- html/html_baseimpl.cpp 10 Jan 2003 04:34:18 -0000 1.175
+++ html/html_baseimpl.cpp 12 Jan 2003 15:19:26 -0000
@@ -297,7 +297,6 @@ void HTMLFrameElementImpl::attach()
{
assert(!attached());
assert(parentNode());
- assert(parentNode()->renderer());
// we should first look up via id, then via name.
// this shortterm hack fixes the ugly case. ### rewrite needed for next release
@@ -369,12 +368,14 @@ void HTMLFrameElementImpl::setFocus(bool
DocumentImpl* HTMLFrameElementImpl::contentDocument() const
{
- if ( !m_render ) return 0;
-
- RenderPart* render = static_cast<RenderPart*>( m_render );
+ KHTMLView* w = getDocument()->view();
- if(render->widget() && render->widget()->inherits("KHTMLView"))
- return static_cast<KHTMLView*>( render->widget() )->part()->xmlDocImpl();
+ if (w) {
+ KHTMLPart *part = w->part()->findFrame( name.string() );
+ if (part) {
+ return part->xmlDocImpl();
+ }
+ }
return 0;
}
@@ -476,10 +477,16 @@ void HTMLFrameSetElementImpl::attach()
node = static_cast<HTMLElementImpl*>(node->parentNode());
}
- // ignore display: none
+ // ignore display: none but do pay attention if a stylesheet has caused us to delay
+ // our loading.
+ RenderStyle* style = getDocument()->styleSelector()->styleForElement(this);
+ style->ref();
+ if (style->isStyleAvailable()) {
m_render = new RenderFrameSet(this);
- m_render->setStyle(getDocument()->styleSelector()->styleForElement(this));
+ m_render->setStyle(style);
parentNode()->renderer()->addChild(m_render, nextRenderer());
+ }
+ style->deref();
NodeBaseImpl::attach();
}
Index: html/html_documentimpl.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/html/html_documentimpl.cpp,v
retrieving revision 1.144
diff -u -p -B -w -r1.144 html_documentimpl.cpp
--- html/html_documentimpl.cpp 8 Jan 2003 18:16:56 -0000 1.144
+++ html/html_documentimpl.cpp 12 Jan 2003 15:19:26 -0000
@@ -303,6 +303,13 @@ void HTMLDocumentImpl::close()
getDocument()->dispatchWindowEvent(EventImpl::LOAD_EVENT, false, false);
updateRendering();
+
+ // Always do a layout/repaint after loading.
+ if (renderer()) {
+ if (!renderer()->layouted())
+ renderer()->layout();
+ renderer()->repaint();
+ }
}
}
Index: html/html_elementimpl.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/html/html_elementimpl.cpp,v
retrieving revision 1.151
diff -u -p -B -w -r1.151 html_elementimpl.cpp
--- html/html_elementimpl.cpp 10 Jan 2003 04:32:53 -0000 1.151
+++ html/html_elementimpl.cpp 12 Jan 2003 15:19:26 -0000
@@ -56,6 +56,48 @@ HTMLElementImpl::~HTMLElementImpl()
{
}
+bool HTMLElementImpl::isInline() const
+{
+ if (renderer())
+ return ElementImpl::isInline();
+
+ switch(id()) {
+ case ID_A:
+ case ID_FONT:
+ case ID_TT:
+ case ID_U:
+ case ID_B:
+ case ID_I:
+ case ID_S:
+ case ID_STRIKE:
+ case ID_BIG:
+ case ID_SMALL:
+
+ // %phrase
+ case ID_EM:
+ case ID_STRONG:
+ case ID_DFN:
+ case ID_CODE:
+ case ID_SAMP:
+ case ID_KBD:
+ case ID_VAR:
+ case ID_CITE:
+ case ID_ABBR:
+ case ID_ACRONYM:
+
+ // %special
+ case ID_SUB:
+ case ID_SUP:
+ case ID_SPAN:
+ case ID_NOBR:
+ case ID_WBR:
+ return true;
+
+ default:
+ return ElementImpl::isInline();
+ }
+}
+
void HTMLElementImpl::parseAttribute(AttributeImpl *attr)
{
DOMString indexstring;
Index: html/html_elementimpl.h
===================================================================
RCS file: /home/kde/kdelibs/khtml/html/html_elementimpl.h,v
retrieving revision 1.62
diff -u -p -B -w -r1.62 html_elementimpl.h
--- html/html_elementimpl.h 10 Jan 2003 04:32:53 -0000 1.62
+++ html/html_elementimpl.h 12 Jan 2003 15:19:26 -0000
@@ -41,6 +41,8 @@ public:
virtual bool isHTMLElement() const { return true; }
+ virtual bool isInline() const;
+
virtual Id id() const = 0;
virtual void parseAttribute(AttributeImpl *token);
Index: html/html_formimpl.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/html/html_formimpl.cpp,v
retrieving revision 1.308
diff -u -p -B -w -r1.308 html_formimpl.cpp
--- html/html_formimpl.cpp 11 Jan 2003 00:38:44 -0000 1.308
+++ html/html_formimpl.cpp 12 Jan 2003 15:19:27 -0000
@@ -584,10 +584,16 @@ void HTMLGenericFormElementImpl::attach(
if (m_render) {
assert(m_render->style());
parentNode()->renderer()->addChild(m_render, nextRenderer());
- m_render->updateFromElement();
}
NodeBaseImpl::attach();
+
+ // The call to updateFromElement() needs to go after the call through
+ // to the base class's attach() because that can sometimes do a close
+ // on the renderer.
+ if (m_render)
+ m_render->updateFromElement();
+
}
HTMLFormElementImpl *HTMLGenericFormElementImpl::getForm() const
Index: html/html_headimpl.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/html/html_headimpl.cpp,v
retrieving revision 1.95
diff -u -p -B -w -r1.95 html_headimpl.cpp
--- html/html_headimpl.cpp 9 Dec 2002 07:21:44 -0000 1.95
+++ html/html_headimpl.cpp 12 Jan 2003 15:19:27 -0000
@@ -158,6 +158,13 @@ void HTMLLinkElementImpl::process()
// ### there may be in some situations e.g. for an editor or script to manipulate
if( m_media.isNull() || m_media.contains("screen") || m_media.contains("all") || m_media.contains("print") ) {
m_loading = true;
+
+ // Add ourselves as a pending sheet, but only if we aren't an alternate
+ // stylesheet. Alternate stylesheets don't hold up render tree construction.
+ m_alternate = rel.contains("alternate");
+ if (!isAlternate())
+ getDocument()->addPendingSheet();
+
QString chset = getAttribute( ATTR_CHARSET ).string();
if (m_cachedSheet)
m_cachedSheet->deref(this);
@@ -203,7 +210,9 @@ void HTMLLinkElementImpl::setStyleSheet(
m_loading = false;
- getDocument()->updateStyleSelector();
+ // Tell the doc about the sheet.
+ if (!isLoading() && m_sheet && !isAlternate())
+ getDocument()->stylesheetLoaded();
}
bool HTMLLinkElementImpl::isLoading() const
@@ -217,7 +226,8 @@ bool HTMLLinkElementImpl::isLoading() co
void HTMLLinkElementImpl::sheetLoaded()
{
- getDocument()->updateStyleSelector();
+ if (!isLoading() && !isAlternate())
+ getDocument()->stylesheetLoaded();
}
// -------------------------------------------------------------------------
@@ -315,12 +325,14 @@ void HTMLStyleElementImpl::parseAttribut
void HTMLStyleElementImpl::insertedIntoDocument()
{
HTMLElementImpl::insertedIntoDocument();
+ if (m_sheet)
getDocument()->updateStyleSelector();
}
void HTMLStyleElementImpl::removedFromDocument()
{
HTMLElementImpl::removedFromDocument();
+ if (m_sheet)
getDocument()->updateStyleSelector();
}
@@ -337,23 +349,36 @@ void HTMLStyleElementImpl::childrenChang
text += c->nodeValue();
}
- if(m_sheet)
+ if (m_sheet) {
m_sheet->deref();
+ m_sheet = 0;
+ }
+
+ m_loading = false;
+
+ getDocument()->addPendingSheet();
+ m_loading = true;
m_sheet = new CSSStyleSheetImpl(this);
m_sheet->ref();
m_sheet->parseString( text, (getDocument()->parseMode() == DocumentImpl::Strict) );
- getDocument()->updateStyleSelector();
+ m_loading = false;
+
+ if (!isLoading() && m_sheet)
+ getDocument()->stylesheetLoaded();
+
}
bool HTMLStyleElementImpl::isLoading() const
{
+ if(m_loading) return true;
if(!m_sheet) return false;
return static_cast<CSSStyleSheetImpl *>(m_sheet)->isLoading();
}
void HTMLStyleElementImpl::sheetLoaded()
{
- getDocument()->updateStyleSelector();
+ if (!isLoading())
+ getDocument()->stylesheetLoaded();
}
// -------------------------------------------------------------------------
Index: html/html_headimpl.h
===================================================================
RCS file: /home/kde/kdelibs/khtml/html/html_headimpl.h,v
retrieving revision 1.38
diff -u -p -B -w -r1.38 html_headimpl.h
--- html/html_headimpl.h 9 Dec 2002 07:21:44 -0000 1.38
+++ html/html_headimpl.h 12 Jan 2003 15:19:27 -0000
@@ -71,7 +71,7 @@ class HTMLLinkElementImpl : public khtml
{
public:
HTMLLinkElementImpl(DocumentPtr *doc)
- : HTMLElementImpl(doc), m_cachedSheet(0), m_sheet(0), m_loading(false) {}
+ : HTMLElementImpl(doc), m_cachedSheet(0), m_sheet(0), m_loading(false), m_alternate(false) {}
~HTMLLinkElementImpl();
@@ -92,6 +92,7 @@ public:
bool isLoading() const;
void sheetLoaded();
+ bool isAlternate() const { return m_alternate; }
protected:
khtml::CachedCSSStyleSheet *m_cachedSheet;
@@ -101,6 +102,8 @@ protected:
QString m_media;
DOMString m_rel;
bool m_loading;
+ bool m_alternate;
+
QString m_data; // needed for temporarily storing the loaded style sheet data
};
@@ -143,7 +146,7 @@ class HTMLStyleElementImpl : public HTML
{
public:
HTMLStyleElementImpl(DocumentPtr *doc)
- : HTMLElementImpl(doc), m_sheet(0) {}
+ : HTMLElementImpl(doc), m_sheet(0), m_loading(false) {}
~HTMLStyleElementImpl();
virtual Id id() const;
@@ -161,6 +164,7 @@ public:
protected:
StyleSheetImpl *m_sheet;
+ bool m_loading;
};
// -------------------------------------------------------------------------
Index: html/html_inlineimpl.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/html/html_inlineimpl.cpp,v
retrieving revision 1.117
diff -u -p -B -w -r1.117 html_inlineimpl.cpp
Index: html/html_objectimpl.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/html/html_objectimpl.cpp,v
retrieving revision 1.97
diff -u -p -B -w -r1.97 html_objectimpl.cpp
--- html/html_objectimpl.cpp 10 Jan 2003 15:09:03 -0000 1.97
+++ html/html_objectimpl.cpp 12 Jan 2003 15:19:27 -0000
@@ -430,7 +430,7 @@ void HTMLObjectElementImpl::attach()
void HTMLObjectElementImpl::detach()
{
- if (attached())
+ if (attached() && m_render)
// ### do this when we are actualy removed from document instead
dispatchHTMLEvent(EventImpl::UNLOAD_EVENT,false,false);
Index: html/htmlparser.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/html/htmlparser.cpp,v
retrieving revision 1.317
diff -u -p -B -w -r1.317 htmlparser.cpp
--- html/htmlparser.cpp 11 Jan 2003 01:03:03 -0000 1.317
+++ html/htmlparser.cpp 12 Jan 2003 15:19:27 -0000
@@ -331,8 +331,7 @@ bool KHTMLParser::insertNode(NodeImpl *n
QString state(document->document()->nextState());
if (!state.isNull()) n->restoreState(state);
}
- if(n->renderer())
- n->renderer()->close();
+ n->closeRenderer();
#endif
if(n->isInline()) m_inline = true;
}
@@ -1185,8 +1184,7 @@ void KHTMLParser::popOneBlock()
QString state(document->document()->nextState());
if (!state.isNull()) current->restoreState(state);
}
- if (current->renderer())
- current->renderer()->close();
+ current->closeRenderer();
}
#endif
Index: rendering/render_container.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/rendering/render_container.cpp,v
retrieving revision 1.37
diff -u -p -B -w -r1.37 render_container.cpp
--- rendering/render_container.cpp 10 Jan 2003 11:59:38 -0000 1.37
+++ rendering/render_container.cpp 12 Jan 2003 15:19:27 -0000
@@ -98,7 +98,8 @@ void RenderContainer::addChild(RenderObj
needsTable = true;
break;
case NONE:
- KHTMLAssert(false);
+ kdWarning() << "DOH! - KHTMLAssert(false)!!!!" << endl;
+ // KHTMLAssert(false);
break;
}
}
Index: rendering/render_style.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/rendering/render_style.cpp,v
retrieving revision 1.55
diff -u -p -B -w -r1.55 render_style.cpp
--- rendering/render_style.cpp 8 Jan 2003 06:23:16 -0000 1.55
+++ rendering/render_style.cpp 12 Jan 2003 15:19:27 -0000
@@ -25,6 +25,7 @@
*/
#include "xml/dom_stringimpl.h"
+#include "css/cssstyleselector.h"
#include "render_style.h"
@@ -231,6 +232,11 @@ bool RenderStyle::operator==(const Rende
background == o.background &&
surround == o.surround &&
inherited == o.inherited);
+}
+
+bool RenderStyle::isStyleAvailable() const
+{
+ return this != CSSStyleSelector::styleNotYetAvailable;
}
RenderStyle* RenderStyle::getPseudoStyle(PseudoId pid)
Index: rendering/render_style.h
===================================================================
RCS file: /home/kde/kdelibs/khtml/rendering/render_style.h,v
retrieving revision 1.80
diff -u -p -B -w -r1.80 render_style.h
--- rendering/render_style.h 28 Dec 2002 14:05:05 -0000 1.80
+++ rendering/render_style.h 12 Jan 2003 15:19:27 -0000
@@ -640,6 +640,8 @@ public:
bool visuallyOrdered() const { return inherited_flags._visuallyOrdered; }
void setVisuallyOrdered(bool b) { inherited_flags._visuallyOrdered = b; }
+ bool isStyleAvailable() const;
+
// attribute getter methods
EDisplay display() const { return noninherited_flags._display; }
Index: xml/dom_docimpl.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/xml/dom_docimpl.cpp,v
retrieving revision 1.211
diff -u -p -B -w -r1.211 dom_docimpl.cpp
--- xml/dom_docimpl.cpp 11 Jan 2003 00:19:56 -0000 1.211
+++ xml/dom_docimpl.cpp 12 Jan 2003 15:19:27 -0000
@@ -1749,6 +1749,16 @@ StyleSheetListImpl* DocumentImpl::styleS
return m_styleSheets;
}
+// This method is called whenever a top-level stylesheet has finished loading.
+void DocumentImpl::stylesheetLoaded()
+{
+ // Make sure we knew this sheet was pending, and that our count isn't out of sync.
+ assert(m_pendingStylesheets > 0);
+
+ m_pendingStylesheets--;
+ updateStyleSelector();
+}
+
DOMString DocumentImpl::selectedStylesheetSet() const
{
if (!view()) return DOMString();
@@ -1767,6 +1777,10 @@ void DocumentImpl::setSelectedStylesheet
void DocumentImpl::updateStyleSelector()
{
+ // Don't bother updating, since we haven't loaded all our style info yet.
+ if (m_pendingStylesheets > 0)
+ return;
+
recalcStyleSelector();
recalcStyle(Force);
#if 0
Index: xml/dom_docimpl.h
===================================================================
RCS file: /home/kde/kdelibs/khtml/xml/dom_docimpl.h,v
retrieving revision 1.103
diff -u -p -B -w -r1.103 dom_docimpl.h
--- xml/dom_docimpl.h 11 Jan 2003 00:19:56 -0000 1.103
+++ xml/dom_docimpl.h 12 Jan 2003 15:19:27 -0000
@@ -164,6 +164,24 @@ public:
khtml::CSSStyleSelector *styleSelector() { return m_styleSelector; }
/**
+ * Updates the pending sheet count and then calls updateStyleSelector.
+ */
+ void stylesheetLoaded();
+
+ /**
+ * This method returns true if all top-level stylesheets have loaded (including
+ * any @imports that they may be loading).
+ */
+ bool haveStylesheetsLoaded() { return m_pendingStylesheets <= 0; }
+
+ /**
+ * Increments the number of pending sheets. The <link> elements
+ * invoke this to add themselves to the loading list.
+ */
+ void addPendingSheet() { m_pendingStylesheets++; }
+
+
+ /**
* Called when one or more stylesheets in the document may have been added, removed or changed.
*
* Creates a new style selector and assign it to this document. This is done by iterating through all nodes in
@@ -399,6 +417,12 @@ protected:
QString m_usersheet;
QString m_printSheet;
QStringList m_availableSheets;
+
+ // Track the number of currently loading top-level stylesheets. Sheets
+ // loaded using the @import directive are not included in this count.
+ // We use this count of pending sheets to detect when we can begin attaching
+ // elements.
+ int m_pendingStylesheets;
CSSStyleSheetImpl *m_elemSheet;
Index: xml/dom_nodeimpl.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/xml/dom_nodeimpl.cpp,v
retrieving revision 1.200
diff -u -p -B -w -r1.200 dom_nodeimpl.cpp
--- xml/dom_nodeimpl.cpp 11 Jan 2003 00:17:13 -0000 1.200
+++ xml/dom_nodeimpl.cpp 12 Jan 2003 15:19:27 -0000
@@ -62,7 +62,8 @@ NodeImpl::NodeImpl(DocumentPtr *doc)
m_focused( false ),
m_active( false ),
m_styleElement( false ),
- m_implicit( false )
+ m_implicit( false ),
+ m_rendererNeedsClose( false )
{
if (document)
document->ref();
@@ -888,10 +889,28 @@ void NodeImpl::dump(QTextStream *stream,
}
#endif
+void NodeImpl::closeRenderer()
+{
+ // It's important that we close the renderer, even if it hasn't been
+ // created yet. This happens even more because of the FOUC fixes we did
+ // at Apple, which prevent renderers from being created until the stylesheets
+ // are all loaded. If the renderer is not here to be closed, we set a flag,
+ // then close it later when it's attached.
+ assert(!m_rendererNeedsClose);
+ if (m_render)
+ m_render->close();
+ else
+ m_rendererNeedsClose = true;
+}
+
void NodeImpl::attach()
{
assert(!attached());
assert(!m_render || (m_render->style() && m_render->parent()));
+ if (m_render && m_rendererNeedsClose) {
+ m_render->close();
+ m_rendererNeedsClose = false;
+ }
m_attached = true;
}
Index: xml/dom_nodeimpl.h
===================================================================
RCS file: /home/kde/kdelibs/khtml/xml/dom_nodeimpl.h,v
retrieving revision 1.140
diff -u -p -B -w -r1.140 dom_nodeimpl.h
--- xml/dom_nodeimpl.h 8 Jan 2003 19:24:00 -0000 1.140
+++ xml/dom_nodeimpl.h 12 Jan 2003 15:19:27 -0000
@@ -290,6 +290,8 @@ public:
*/
virtual void detach();
+ void closeRenderer();
+
// -----------------------------------------------------------------------------
// Methods for maintaining the state of the element between history navigation
@@ -371,8 +373,9 @@ protected:
bool m_active : 1;
bool m_styleElement : 1; // contains stylesheet text
bool m_implicit : 1; // implicitely generated by the parser
+ bool m_rendererNeedsClose : 1;
- // 2 bits unused
+ // 1 bits unused
};
// this is the full Node Implementation with parents and children.
Index: xml/xml_tokenizer.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/xml/xml_tokenizer.cpp,v
retrieving revision 1.40
diff -u -p -B -w -r1.40 xml_tokenizer.cpp
--- xml/xml_tokenizer.cpp 11 Dec 2002 21:11:53 -0000 1.40
+++ xml/xml_tokenizer.cpp 12 Jan 2003 15:19:27 -0000
@@ -113,8 +113,7 @@ bool XMLHandler::endElement( const QStri
if (m_currentNode->nodeType() == Node::TEXT_NODE)
exitText();
if (m_currentNode->parentNode() != 0) {
- if (m_currentNode->renderer())
- m_currentNode->renderer()->close();
+ m_currentNode->closeRenderer();
m_currentNode = m_currentNode->parentNode();
}
// ### else error
@@ -385,9 +384,9 @@ void XMLTokenizer::finish()
// Close the renderers so that they update their display correctly
// ### this should not be necessary, but requires changes in the rendering code...
- h1->renderer()->close();
- pre->renderer()->close();
- body->renderer()->close();
+ h1->closeRenderer();
+ pre->closeRenderer();
+ body->closeRenderer();
m_doc->document()->recalcStyle( NodeImpl::Inherit );
m_doc->document()->updateRendering();
--huq684BweRXVnRxX--