Bug 153600: Make <script>s with neither src attribute or childNodes not block the parser.

r=bz sr=jst
This commit is contained in:
sicking%bigfoot.com 2002-06-26 21:07:37 +00:00
Родитель 9a80772b0c
Коммит 35cd33f17a
1 изменённых файлов: 15 добавлений и 7 удалений

Просмотреть файл

@ -447,13 +447,21 @@ nsHTMLScriptElement::GetLineNumber(PRUint32* aLineNumber)
void
nsHTMLScriptElement::MaybeProcessScript()
{
if (!mIsEvaluated && mDocument && mParent &&
(HasAttr(kNameSpaceID_None, nsHTMLAtoms::src) || mChildren.Count())) {
if (mIsEvaluated || !mDocument || !mParent) {
return;
}
// We'll always call this to make sure that
// ScriptAvailable/ScriptEvaluated gets called. See bug 153600
nsCOMPtr<nsIScriptLoader> loader;
mDocument->GetScriptLoader(getter_AddRefs(loader));
if (loader) {
loader->ProcessScriptElement(this, this);
}
// But we'll only set mIsEvaluated if we did really load or evaluate
// something
if (HasAttr(kNameSpaceID_None, nsHTMLAtoms::src) || mChildren.Count()) {
mIsEvaluated = PR_TRUE;
nsCOMPtr<nsIScriptLoader> loader;
mDocument->GetScriptLoader(getter_AddRefs(loader));
if (loader) {
loader->ProcessScriptElement(this, this);
}
}
}