mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 07:18:39 +09:00
[Layout] Hold stronger references to FontFaces.
This commit is contained in:
parent
0c2770ff7b
commit
5e12078904
1 changed files with 13 additions and 8 deletions
|
|
@ -324,10 +324,18 @@ FontFaceSet::Load(JSContext* aCx,
|
|||
|
||||
nsTArray<RefPtr<Promise>> promises;
|
||||
|
||||
nsTArray<FontFace*> faces;
|
||||
FindMatchingFontFaces(aFont, aText, faces, aRv);
|
||||
if (aRv.Failed()) {
|
||||
return nullptr;
|
||||
nsTArray<RefPtr<FontFace>> faces;
|
||||
{
|
||||
nsTArray<FontFace*> weakFaces;
|
||||
FindMatchingFontFaces(aFont, aText, weakFaces, aRv);
|
||||
if (aRv.Failed()) {
|
||||
return nullptr;
|
||||
}
|
||||
if (!faces.AppendElements(weakFaces, fallible) ||
|
||||
!promises.SetCapacity(weakFaces.Length(), fallible)) {
|
||||
aRv.Throw(NS_ERROR_FAILURE);
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
for (FontFace* f : faces) {
|
||||
|
|
@ -335,10 +343,7 @@ FontFaceSet::Load(JSContext* aCx,
|
|||
if (aRv.Failed()) {
|
||||
return nullptr;
|
||||
}
|
||||
if (!promises.AppendElement(promise, fallible)) {
|
||||
aRv.Throw(NS_ERROR_FAILURE);
|
||||
return nullptr;
|
||||
}
|
||||
promises.AppendElement(promise);
|
||||
}
|
||||
|
||||
return Promise::All(aCx, promises, aRv);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue