mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2026-04-19 02:10:26 +00:00
As FontFaces are added or removed from a FontFaceSet, and as they load or fail, the FontFaceSet moves them between a few different lists, and updates its loading/loaded status. In the spec, this is how the FontFaceSet.[[ReadyPromise]] gets fulfilled: When the document has finished loading and FontFaceSet.[[LoadingFonts]] is empty, it resolves the promise. To support this, FontFace now keeps a set of FontFaceSets that it is contained in. This lets us remove the non-spec resolve_ready_promise() call in EventLoop which was sometimes triggering before any fonts had attempted to load. As noted, there's a spec issue with the ready promise: If nothing modifies the document's fonts, then it would never resolve. My ad-hoc fix is to also switch the FontFaceSet to the loaded state if it is empty, which appears to solve the issues but is not ideal. |
||
|---|---|---|
| .. | ||
| EventLoop.cpp | ||
| EventLoop.h | ||
| Task.cpp | ||
| Task.h | ||
| TaskQueue.cpp | ||
| TaskQueue.h | ||