forked from mirrors/gecko-dev
Bug 1851523 - Don't dispatch DOMHeadElementParsed on data documents, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D187406
This commit is contained in:
parent
28647db072
commit
7b8bd15a92
1 changed files with 9 additions and 9 deletions
|
|
@ -49,17 +49,17 @@ void HTMLSharedElement::GetHref(nsAString& aValue) {
|
||||||
|
|
||||||
void HTMLSharedElement::DoneAddingChildren(bool aHaveNotified) {
|
void HTMLSharedElement::DoneAddingChildren(bool aHaveNotified) {
|
||||||
if (mNodeInfo->Equals(nsGkAtoms::head)) {
|
if (mNodeInfo->Equals(nsGkAtoms::head)) {
|
||||||
nsCOMPtr<Document> doc = GetUncomposedDoc();
|
if (nsCOMPtr<Document> doc = GetUncomposedDoc()) {
|
||||||
if (doc) {
|
|
||||||
doc->OnL10nResourceContainerParsed();
|
doc->OnL10nResourceContainerParsed();
|
||||||
|
if (!doc->IsLoadedAsData()) {
|
||||||
|
RefPtr<AsyncEventDispatcher> asyncDispatcher =
|
||||||
|
new AsyncEventDispatcher(this, u"DOMHeadElementParsed"_ns,
|
||||||
|
CanBubble::eYes, ChromeOnlyDispatch::eYes);
|
||||||
|
// Always run async in order to avoid running script when the content
|
||||||
|
// sink isn't expecting it.
|
||||||
|
asyncDispatcher->PostDOMEvent();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RefPtr<AsyncEventDispatcher> asyncDispatcher =
|
|
||||||
new AsyncEventDispatcher(this, u"DOMHeadElementParsed"_ns,
|
|
||||||
CanBubble::eYes, ChromeOnlyDispatch::eYes);
|
|
||||||
// Always run async in order to avoid running script when the content
|
|
||||||
// sink isn't expecting it.
|
|
||||||
asyncDispatcher->PostDOMEvent();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue