[Webkit-unassigned] [Bug 224178] Implement FontFace in Workers for OffscreenCanvas

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 6 04:15:49 PDT 2021


https://bugs.webkit.org/show_bug.cgi?id=224178

Chris Lord <clord at igalia.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |darin at apple.com

--- Comment #1 from Chris Lord <clord at igalia.com> ---
The bulk of this patch I think will be providing an alternative to CachedFont/CachedResourceLoader that can work with Worker and ThreadableLoader. It might be nice to abstract CachedFont and provide interfaces on ScriptExecutionLoader to minimise changes and multiple code-paths in the CSS* classes, so that we have something along the lines of:

> CSSFontFaceSrcValue:
>     fontRequest = ScriptExecutionContext.requestFont(...);
> 
> CSSFontSelector:
>     ScriptExecutionContext.beginLoadingFontSoon(fontRequest);
> 
> WorkerGlobalScope:
>     ::beginLoadingFontSoon(fontRequest) { /* TBD; Use threadable loader to start fetching font */ }
> 
> Document:
>     :: beginLoadingFontSoon(fontRequest) {
>         auto& font = downcast<CachedFont>(fontRequest);
>         // Code that is currently in CSSFontSelector to deal with CachedResourceLoader
>     }
> 
>     :: fontLoadingTimerFired { /* Moved from CSSFontSelector */ }

The FontRequest object would need a fontLoaded client interface to replace CachedFontClient and equivalents for errorOccurred, ensureCustomFontData and createFont and I think that would be about it...

There's currently some complication with font loading that is mainly to do with page-load optimisation that doesn't really apply in the Worker case, so it's nice that this abstraction would move that to be contained in Document and not CSSFontSelector.

I think this abstraction could be a separate patch from the Worker implementation of it, so that's how I'll start.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210406/02a26bd8/attachment-0001.htm>


More information about the webkit-unassigned mailing list