Merge mozilla-central to mozilla-inbound
This commit is contained in:
@@ -745,12 +745,8 @@ nsHtml5TreeOpExecutor::RunScript(nsIContent* aScriptElement)
|
||||
}
|
||||
|
||||
if (sele->GetScriptDeferred() || sele->GetScriptAsync()) {
|
||||
#ifdef DEBUG
|
||||
nsresult rv =
|
||||
#endif
|
||||
aScriptElement->DoneAddingChildren(true); // scripts ignore the argument
|
||||
NS_ASSERTION(rv != NS_ERROR_HTMLPARSER_BLOCK,
|
||||
"Defer or async script tried to block.");
|
||||
DebugOnly<bool> block = sele->AttemptToExecute();
|
||||
NS_ASSERTION(!block, "Defer or async script tried to block.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -767,13 +763,12 @@ nsHtml5TreeOpExecutor::RunScript(nsIContent* aScriptElement)
|
||||
|
||||
// Copied from nsXMLContentSink
|
||||
// Now tell the script that it's ready to go. This may execute the script
|
||||
// or return NS_ERROR_HTMLPARSER_BLOCK. Or neither if the script doesn't
|
||||
// need executing.
|
||||
nsresult rv = aScriptElement->DoneAddingChildren(true);
|
||||
// or return true, or neither if the script doesn't need executing.
|
||||
bool block = sele->AttemptToExecute();
|
||||
|
||||
// If the act of insertion evaluated the script, we're fine.
|
||||
// Else, block the parser till the script has loaded.
|
||||
if (rv == NS_ERROR_HTMLPARSER_BLOCK) {
|
||||
if (block) {
|
||||
mScriptElements.AppendObject(sele);
|
||||
if (mParser) {
|
||||
mParser->BlockParser();
|
||||
|
||||
Reference in New Issue
Block a user