LibWeb: Resolve FontFaceSet::load promise with all loaded FontFaces
Some checks failed
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
Build Dev Container Image / build (push) Has been cancelled

The resulting array is required on https://www.canva.com/
This commit is contained in:
Luke Wilde 2025-07-21 13:15:47 +01:00 committed by Sam Atkins
commit 8210a7b3e3
Notes: github-actions[bot] 2025-07-21 15:31:12 +00:00
6 changed files with 60 additions and 2 deletions

View file

@ -264,9 +264,10 @@ JS::ThrowCompletionOr<GC::Ref<WebIDL::Promise>> FontFaceSet::load(String const&
WebIDL::wait_for_all(
realm, promises,
[&realm, promise](auto const&) {
[&realm, promise](auto const& fonts) {
HTML::TemporaryExecutionContext execution_context { realm, HTML::TemporaryExecutionContext::CallbacksEnabled::Yes };
WebIDL::resolve_promise(realm, promise);
auto fonts_array = JS::Array::create_from(realm, fonts);
WebIDL::resolve_promise(realm, promise, fonts_array);
},
[&realm, promise](auto error) {
HTML::TemporaryExecutionContext execution_context { realm, HTML::TemporaryExecutionContext::CallbacksEnabled::Yes };