Bug 642145 - Avoid firing document-element-inserted for non-element insertions to the document node. r=jonas.

This commit is contained in:
Henri Sivonen 2011-04-08 09:07:28 +03:00
parent 5d947243ad
commit e9f116d66d

View File

@ -260,9 +260,10 @@ nsHtml5TreeOperation::AppendToDocument(nsIContent* aNode,
NS_ASSERTION(!nsContentUtils::IsSafeToRunScript(),
"Someone forgot to block scripts");
nsContentUtils::AddScriptRunner(
new nsDocElementCreatedNotificationRunner(doc));
if (aNode->IsElement()) {
nsContentUtils::AddScriptRunner(
new nsDocElementCreatedNotificationRunner(doc));
}
return rv;
}