mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 23:38:38 +09:00
Bug 1396620 - Part 2: Fix compartment mismatch crash when doing old prototype swizzling for custom element
Tag UXP Issue #1344
This commit is contained in:
parent
baa035c5c4
commit
3639f0e2bd
1 changed files with 4 additions and 0 deletions
|
|
@ -482,6 +482,10 @@ Element::WrapObject(JSContext *aCx, JS::Handle<JSObject*> aGivenProto)
|
|||
data->GetCustomElementType(), &customProto);
|
||||
if (customProto &&
|
||||
NodePrincipal()->SubsumesConsideringDomain(nsContentUtils::ObjectPrincipal(customProto))) {
|
||||
// The custom element prototype could be in different compartment.
|
||||
if (!JS_WrapObject(aCx, &customProto)) {
|
||||
return nullptr;
|
||||
}
|
||||
// Just go ahead and create with the right proto up front. Set
|
||||
// customProto to null to flag that we don't need to do any post-facto
|
||||
// proto fixups here.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue