From 33f87288e91f30ee9447f7160333216c94e464e1 Mon Sep 17 00:00:00 2001 From: Psychpsyo Date: Sat, 4 Jan 2025 13:39:41 +0100 Subject: [PATCH] LibWeb: Remove unneeded spec deviation from font loading --- Libraries/LibWeb/CSS/FontFace.cpp | 21 ++++++--------------- Libraries/LibWeb/CSS/FontFace.h | 2 -- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/Libraries/LibWeb/CSS/FontFace.cpp b/Libraries/LibWeb/CSS/FontFace.cpp index d99d375d26e..ac4e994b3b1 100644 --- a/Libraries/LibWeb/CSS/FontFace.cpp +++ b/Libraries/LibWeb/CSS/FontFace.cpp @@ -323,21 +323,6 @@ GC::Ref FontFace::load() if (font_face.m_urls.is_empty() || font_face.m_status != Bindings::FontFaceLoadStatus::Unloaded) return font_face.loaded(); - load_font_source(); - - return font_face.loaded(); -} - -void FontFace::load_font_source() -{ - VERIFY(!m_urls.is_empty() && m_status == Bindings::FontFaceLoadStatus::Unloaded); - // NOTE: These steps are from the load() method, but can also be called by the user agent when the font - // is needed to render something on the page. - - // User agents can initiate font loads on their own, whenever they determine that a given font face is necessary - // to render something on the page. When this happens, they must act as if they had called the corresponding - // FontFace’s load() method described here. - // 3. Otherwise, set font face’s status attribute to "loading", return font face’s [[FontStatusPromise]], // and continue executing the rest of this algorithm asynchronously. m_status = Bindings::FontFaceLoadStatus::Loading; @@ -405,6 +390,12 @@ void FontFace::load_font_source() dbgln("FIXME: Worker font loading not implemented"); } })); + + // User agents can initiate font loads on their own, whenever they determine that a given font face is necessary + // to render something on the page. When this happens, they must act as if they had called the corresponding + // FontFace’s load() method described here. + + return font_face.loaded(); } } diff --git a/Libraries/LibWeb/CSS/FontFace.h b/Libraries/LibWeb/CSS/FontFace.h index a8d680dba06..c54a0a986c9 100644 --- a/Libraries/LibWeb/CSS/FontFace.h +++ b/Libraries/LibWeb/CSS/FontFace.h @@ -77,8 +77,6 @@ public: GC::Ref load(); GC::Ref loaded() const; - void load_font_source(); - GC::Ref font_status_promise() { return m_font_status_promise; } private: