Stop blocking the parser on CSS stylesheet loads. We still block script

execution on them, however.  Bug 84582, r+sr=sicking


git-svn-id: svn://10.0.0.236/trunk@224813 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzbarsky%mit.edu
2007-04-20 22:59:18 +00:00
parent 8d22ae89ff
commit 9b9e29922e
24 changed files with 378 additions and 352 deletions

View File

@@ -392,8 +392,6 @@ NS_IMETHODIMP CViewSourceHTML::BuildModel(nsIParser* aParser,nsITokenizer* aToke
if(!mHasOpenRoot) {
// For the stack-allocated tokens below, it's safe to pass a null
// token allocator, because there are no attributes on the tokens.
PRBool didBlock = PR_FALSE;
CStartToken htmlToken(NS_LITERAL_STRING("HTML"), eHTMLTag_html);
nsCParserNode htmlNode(&htmlToken, 0/*stack token*/);
mSink->OpenContainer(htmlNode);
@@ -443,17 +441,13 @@ NS_IMETHODIMP CViewSourceHTML::BuildModel(nsIParser* aParser,nsITokenizer* aToke
NS_LITERAL_STRING("href"),
NS_LITERAL_STRING("resource://gre/res/viewsource.css"));
result = mSink->AddLeaf(theNode);
didBlock = result == NS_ERROR_HTMLPARSER_BLOCK;
mSink->AddLeaf(theNode);
}
}
result = mSink->CloseContainer(eHTMLTag_head);
if(NS_SUCCEEDED(result)) {
mHasOpenRoot = PR_TRUE;
if (didBlock) {
result = NS_ERROR_HTMLPARSER_BLOCK;
}
}
}
if (NS_SUCCEEDED(result) && !mHasOpenBody) {
@@ -511,8 +505,7 @@ NS_IMETHODIMP CViewSourceHTML::BuildModel(nsIParser* aParser,nsITokenizer* aToke
result = NS_ERROR_HTMLPARSER_INTERRUPTED;
break;
}
}
else if(NS_ERROR_HTMLPARSER_BLOCK!=result){
} else {
mTokenizer->PushTokenFront(theToken);
}
}