mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-28 05:07:35 +00:00
LibWeb/CSS: Parse FontFace parameters as descriptors
This also rearranges the code to follow the spec better: We create an empty FontFace first and then fill it in, instead of creating it fully-formed at the end.
This commit is contained in:
parent
0121e7028f
commit
5f6972fc31
Notes:
github-actions[bot]
2025-04-07 09:01:47 +00:00
Author: https://github.com/AtkinsSJ
Commit: 5f6972fc31
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4224
2 changed files with 65 additions and 57 deletions
|
@ -80,10 +80,11 @@ public:
|
|||
GC::Ref<WebIDL::Promise> font_status_promise() { return m_font_status_promise; }
|
||||
|
||||
private:
|
||||
FontFace(JS::Realm&, GC::Ref<WebIDL::Promise> font_status_promise, Vector<ParsedFontFace::Source> urls, ByteBuffer data, String family, FontFaceDescriptors const& descriptors);
|
||||
FontFace(JS::Realm&, GC::Ref<WebIDL::Promise> font_status_promise);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
void reject_status_promise(JS::Value reason);
|
||||
|
||||
// FIXME: Should we be storing StyleValues instead?
|
||||
String m_family;
|
||||
|
@ -104,7 +105,7 @@ private:
|
|||
|
||||
GC::Ref<WebIDL::Promise> m_font_status_promise; // [[FontStatusPromise]]
|
||||
Vector<ParsedFontFace::Source> m_urls; // [[Urls]]
|
||||
ByteBuffer m_binary_data; // [[Data]]
|
||||
ByteBuffer m_binary_data {}; // [[Data]]
|
||||
|
||||
RefPtr<Gfx::Typeface> m_parsed_font;
|
||||
RefPtr<Core::Promise<NonnullRefPtr<Gfx::Typeface>>> m_font_load_promise;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue