Commit fcdd4691 authored by hyatt's avatar hyatt

Make sure framesets don't get built twice when FOUC delays

	their loading.

        Reviewed by gramps

        * khtml/css/cssstyleselector.cpp:
        * khtml/css/cssstyleselector.h:
        * khtml/html/html_baseimpl.cpp:
        (HTMLFrameSetElementImpl::attach):
        * khtml/rendering/render_style.cpp:
        (RenderStyle::operator==):
        (RenderStyle::isStyleAvailable):
        * khtml/rendering/render_style.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3064 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 3aaa7d9f
2002-12-15 David Hyatt <hyatt@apple.com>
Make sure framesets don't get built twice when FOUC delays
their loading.
Reviewed by gramps
* khtml/css/cssstyleselector.cpp:
* khtml/css/cssstyleselector.h:
* khtml/html/html_baseimpl.cpp:
(HTMLFrameSetElementImpl::attach):
* khtml/rendering/render_style.cpp:
(RenderStyle::operator==):
(RenderStyle::isStyleAvailable):
* khtml/rendering/render_style.h:
2002-12-15 Darin Adler <darin@apple.com>
Reviewed by Dave.
......
2002-12-15 David Hyatt <hyatt@apple.com>
Make sure framesets don't get built twice when FOUC delays
their loading.
Reviewed by gramps
* khtml/css/cssstyleselector.cpp:
* khtml/css/cssstyleselector.h:
* khtml/html/html_baseimpl.cpp:
(HTMLFrameSetElementImpl::attach):
* khtml/rendering/render_style.cpp:
(RenderStyle::operator==):
(RenderStyle::isStyleAvailable):
* khtml/rendering/render_style.h:
2002-12-15 Darin Adler <darin@apple.com>
Reviewed by Dave.
......
......@@ -72,7 +72,7 @@ CSSStyleSelectorList *CSSStyleSelector::defaultStyle = 0;
CSSStyleSelectorList *CSSStyleSelector::defaultQuirksStyle = 0;
CSSStyleSelectorList *CSSStyleSelector::defaultPrintStyle = 0;
CSSStyleSheetImpl *CSSStyleSelector::defaultSheet = 0;
RenderStyle* CSSStyleSelector::displayNoneStyle = 0;
RenderStyle* CSSStyleSelector::styleNotYetAvailable = 0;
static CSSStyleSelector::Encodedurl *encodedurl = 0;
......@@ -221,12 +221,12 @@ void CSSStyleSelector::clear()
delete defaultQuirksStyle;
delete defaultPrintStyle;
delete defaultSheet;
delete displayNoneStyle;
delete styleNotYetAvailable;
defaultStyle = 0;
defaultQuirksStyle = 0;
defaultPrintStyle = 0;
defaultSheet = 0;
displayNoneStyle = 0;
styleNotYetAvailable = 0;
}
#define MAXFONTSIZES 15
......@@ -299,12 +299,12 @@ static inline void bubbleSort( CSSOrderedProperty **b, CSSOrderedProperty **e )
RenderStyle *CSSStyleSelector::styleForElement(ElementImpl *e, int state)
{
if (!e->getDocument()->haveStylesheetsLoaded()) {
if (!displayNoneStyle) {
displayNoneStyle = new RenderStyle();
displayNoneStyle->setDisplay(NONE);
displayNoneStyle->ref();
}
return displayNoneStyle;
if (!styleNotYetAvailable) {
styleNotYetAvailable = new RenderStyle();
styleNotYetAvailable->setDisplay(NONE);
styleNotYetAvailable->ref();
}
return styleNotYetAvailable;
}
// set some variables we will need
......
......@@ -165,7 +165,8 @@ namespace khtml
CSSStyleSelectorList *userStyle;
DOM::CSSStyleSheetImpl *userSheet;
static RenderStyle* displayNoneStyle;
public:
static RenderStyle* styleNotYetAvailable;
private:
void init();
......
......@@ -476,11 +476,15 @@ void HTMLFrameSetElementImpl::attach()
assert(parentNode());
assert(parentNode()->renderer());
// ignore display: none
m_render = new (getDocument()->renderArena()) RenderFrameSet(this);
m_render->setStyle(getDocument()->styleSelector()->styleForElement(this));
parentNode()->renderer()->addChild(m_render, nextRenderer());
// ignore display: none but do pay attention if a stylesheet has caused us to delay
// our loading.
RenderStyle* style = getDocument()->styleSelector()->styleForElement(this);
if (style->isStyleAvailable()) {
m_render = new (getDocument()->renderArena()) RenderFrameSet(this);
m_render->setStyle(style);
parentNode()->renderer()->addChild(m_render, nextRenderer());
}
NodeBaseImpl::attach();
}
......
......@@ -23,6 +23,7 @@
#include "xml/dom_stringimpl.h"
#include "render_style.h"
#include "css/cssstyleselector.h"
#include "kdebug.h"
......@@ -238,6 +239,11 @@ bool RenderStyle::operator==(const RenderStyle& o) const
inherited == o.inherited);
}
bool RenderStyle::isStyleAvailable() const
{
return this != CSSStyleSelector::styleNotYetAvailable;
}
RenderStyle* RenderStyle::getPseudoStyle(PseudoId pid)
{
RenderStyle *ps = 0;
......
......@@ -650,6 +650,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; }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment