LibWeb: Remove unneeded spec deviation from font loading

This commit is contained in:
Psychpsyo 2025-01-04 13:39:41 +01:00 committed by Sam Atkins
parent c60ad5b0b8
commit 33f87288e9
Notes: github-actions[bot] 2025-01-04 17:59:36 +00:00
2 changed files with 6 additions and 17 deletions

View file

@ -323,21 +323,6 @@ GC::Ref<WebIDL::Promise> 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
// FontFaces load() method described here.
// 3. Otherwise, set font faces status attribute to "loading", return font faces [[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
// FontFaces load() method described here.
return font_face.loaded();
}
}

View file

@ -77,8 +77,6 @@ public:
GC::Ref<WebIDL::Promise> load();
GC::Ref<WebIDL::Promise> loaded() const;
void load_font_source();
GC::Ref<WebIDL::Promise> font_status_promise() { return m_font_status_promise; }
private: