mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-05 23:07:31 +09:00
[DOM/NPAPI] Defer loading object when setting attribute.
This commit is contained in:
parent
9aed4d8a38
commit
d1d00498ae
2 changed files with 14 additions and 3 deletions
|
|
@ -193,7 +193,13 @@ HTMLObjectElement::AfterMaybeChangeAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
// attributes before inserting the node into the document.
|
// attributes before inserting the node into the document.
|
||||||
if (aNotify && IsInComposedDoc() && mIsDoneAddingChildren &&
|
if (aNotify && IsInComposedDoc() && mIsDoneAddingChildren &&
|
||||||
aName == nsGkAtoms::data) {
|
aName == nsGkAtoms::data) {
|
||||||
return LoadObject(aNotify, true);
|
nsContentUtils::AddScriptRunner(NS_NewRunnableFunction(
|
||||||
|
[self = RefPtr<HTMLObjectElement>(this), aNotify]() {
|
||||||
|
if (self->IsInComposedDoc()) {
|
||||||
|
self->LoadObject(aNotify, true);
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
return NS_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -177,8 +177,13 @@ HTMLSharedObjectElement::AfterMaybeChangeAttr(int32_t aNamespaceID,
|
||||||
// a document, just in case that the caller wants to set additional
|
// a document, just in case that the caller wants to set additional
|
||||||
// attributes before inserting the node into the document.
|
// attributes before inserting the node into the document.
|
||||||
if (aNotify && IsInComposedDoc() && mIsDoneAddingChildren) {
|
if (aNotify && IsInComposedDoc() && mIsDoneAddingChildren) {
|
||||||
nsresult rv = LoadObject(aNotify, true);
|
nsContentUtils::AddScriptRunner(NS_NewRunnableFunction(
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
[self = RefPtr<HTMLSharedObjectElement>(this), aNotify]() {
|
||||||
|
if (self->IsInComposedDoc()) {
|
||||||
|
self->LoadObject(aNotify, true);
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
return NS_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue