mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-28 21:26:22 +00:00
Everywhere: Hoist the Libraries folder to the top-level
This commit is contained in:
parent
950e819ee7
commit
93712b24bf
Notes:
github-actions[bot]
2024-11-10 11:51:52 +00:00
Author: https://github.com/trflynn89
Commit: 93712b24bf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2256
Reviewed-by: https://github.com/sideshowbarker
4547 changed files with 104 additions and 113 deletions
64
Libraries/LibWeb/CSS/FontFaceSet.h
Normal file
64
Libraries/LibWeb/CSS/FontFaceSet.h
Normal file
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
* Copyright (c) 2024, Andrew Kaster <akaster@serenityos.org>
|
||||
* Copyright (c) 2024, Jamie Mansfield <jmansfield@cadixdev.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibJS/Runtime/Set.h>
|
||||
#include <LibJS/Runtime/SetIterator.h>
|
||||
#include <LibWeb/Bindings/FontFaceSetPrototype.h>
|
||||
#include <LibWeb/Bindings/PlatformObject.h>
|
||||
#include <LibWeb/CSS/FontFace.h>
|
||||
#include <LibWeb/DOM/EventTarget.h>
|
||||
|
||||
namespace Web::CSS {
|
||||
|
||||
class FontFaceSet final : public DOM::EventTarget {
|
||||
WEB_PLATFORM_OBJECT(FontFaceSet, DOM::EventTarget);
|
||||
JS_DECLARE_ALLOCATOR(FontFaceSet);
|
||||
|
||||
public:
|
||||
[[nodiscard]] static JS::NonnullGCPtr<FontFaceSet> construct_impl(JS::Realm&, Vector<JS::Handle<FontFace>> const& initial_faces);
|
||||
[[nodiscard]] static JS::NonnullGCPtr<FontFaceSet> create(JS::Realm&);
|
||||
virtual ~FontFaceSet() override = default;
|
||||
|
||||
JS::NonnullGCPtr<JS::Set> set_entries() const { return m_set_entries; }
|
||||
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<FontFaceSet>> add(JS::Handle<FontFace>);
|
||||
bool delete_(JS::Handle<FontFace>);
|
||||
void clear();
|
||||
|
||||
void set_onloading(WebIDL::CallbackType*);
|
||||
WebIDL::CallbackType* onloading();
|
||||
void set_onloadingdone(WebIDL::CallbackType*);
|
||||
WebIDL::CallbackType* onloadingdone();
|
||||
void set_onloadingerror(WebIDL::CallbackType*);
|
||||
WebIDL::CallbackType* onloadingerror();
|
||||
|
||||
JS::ThrowCompletionOr<JS::NonnullGCPtr<WebIDL::Promise>> load(String const& font, String const& text);
|
||||
|
||||
JS::NonnullGCPtr<WebIDL::Promise> ready() const;
|
||||
Bindings::FontFaceSetLoadStatus status() const { return m_status; }
|
||||
|
||||
void resolve_ready_promise();
|
||||
|
||||
private:
|
||||
FontFaceSet(JS::Realm&, JS::NonnullGCPtr<WebIDL::Promise> ready_promise, JS::NonnullGCPtr<JS::Set> set_entries);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
JS::NonnullGCPtr<JS::Set> m_set_entries;
|
||||
JS::NonnullGCPtr<WebIDL::Promise> m_ready_promise; // [[ReadyPromise]]
|
||||
|
||||
Vector<JS::NonnullGCPtr<FontFace>> m_loading_fonts {}; // [[LoadingFonts]]
|
||||
Vector<JS::NonnullGCPtr<FontFace>> m_loaded_fonts {}; // [[LoadedFonts]]
|
||||
Vector<JS::NonnullGCPtr<FontFace>> m_failed_fonts {}; // [[FailedFonts]]
|
||||
|
||||
Bindings::FontFaceSetLoadStatus m_status { Bindings::FontFaceSetLoadStatus::Loading };
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue