/* * Copyright (c) 2024, Andrew Kaster * * SPDX-License-Identifier: BSD-2-Clause */ #include #include #include #include #include #include namespace Web::CSS { JS_DEFINE_ALLOCATOR(FontFaceSet); JS::NonnullGCPtr FontFaceSet::construct_impl(JS::Realm& realm, Vector> initial_faces) { return realm.heap().allocate(realm, realm, move(initial_faces)); } JS::NonnullGCPtr FontFaceSet::create(JS::Realm& realm) { return construct_impl(realm, {}); } FontFaceSet::FontFaceSet(JS::Realm& realm, Vector>) : Bindings::PlatformObject(realm) { } void FontFaceSet::initialize(JS::Realm& realm) { Base::initialize(realm); WEB_SET_PROTOTYPE_FOR_INTERFACE(FontFaceSet); } // https://drafts.csswg.org/css-font-loading/#dom-fontfaceset-add JS::NonnullGCPtr FontFaceSet::add(JS::Handle) { // FIXME: Do the steps return *this; } // https://drafts.csswg.org/css-font-loading/#dom-fontfaceset-load JS::ThrowCompletionOr> FontFaceSet::load(String const&, String const&) { // FIXME: Do the steps auto promise = WebIDL::create_rejected_promise(realm(), WebIDL::NotSupportedError::create(realm(), "FontFaceSet::load is not yet implemented"_fly_string)); return verify_cast(*promise->promise()); } }