mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 08:12:05 +00:00
Bug 1666184 - Defer loading object when setting attribute; r=nika a=pascalc
Differential Revision: https://phabricator.services.mozilla.com/D116819
This commit is contained in:
parent
6c2757cba8
commit
9d021e6dbd
@ -128,8 +128,14 @@ nsresult HTMLEmbedElement::AfterMaybeChangeAttr(int32_t aNamespaceID,
|
||||
// a document, just in case that the caller wants to set additional
|
||||
// attributes before inserting the node into the document.
|
||||
if (aNotify && IsInComposedDoc() && !BlockEmbedOrObjectContentLoading()) {
|
||||
nsresult rv = LoadObject(aNotify, true);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
nsContentUtils::AddScriptRunner(NS_NewRunnableFunction(
|
||||
"HTMLEmbedElement::LoadObject",
|
||||
[self = RefPtr<HTMLEmbedElement>(this), aNotify]() {
|
||||
if (self->IsInComposedDoc()) {
|
||||
self->LoadObject(aNotify, true);
|
||||
}
|
||||
}));
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -145,7 +145,14 @@ nsresult HTMLObjectElement::AfterMaybeChangeAttr(int32_t aNamespaceID,
|
||||
// attributes before inserting the node into the document.
|
||||
if (aNotify && IsInComposedDoc() && mIsDoneAddingChildren &&
|
||||
aName == nsGkAtoms::data && !BlockEmbedOrObjectContentLoading()) {
|
||||
return LoadObject(aNotify, true);
|
||||
nsContentUtils::AddScriptRunner(NS_NewRunnableFunction(
|
||||
"HTMLObjectElement::LoadObject",
|
||||
[self = RefPtr<HTMLObjectElement>(this), aNotify]() {
|
||||
if (self->IsInComposedDoc()) {
|
||||
self->LoadObject(aNotify, true);
|
||||
}
|
||||
}));
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user