Commit Graph
3 Commits
Author SHA1 Message Date
ldm0 bdbc3f4f6e fix(fonts): validate font set queries with Stylo 2026-11-02 06:02:24 +08:00
ldm0 63947f8b08 fix(fonts): validate binary FontFace sources
Decode and validate binary font data before marking a FontFace loaded, and
check SFNT table extents for every face in a collection. Reuse the stronger
validation for URL fonts so truncated unused tables cannot escape detection.

Reject shared and resizable sources during argument conversion, then copy
ordinary BufferSource bytes after descriptor conversion. Retain validated
bytes independently of later caller mutations and transfers.

Cover real TTF, WOFF and WOFF2 inputs, offset views, malformed and truncated
fonts, shared/resizable/detached buffers, descriptor side effects, collections,
URL font validation and cross-realm promises and errors.
2026-11-02 06:02:24 +08:00
ldm0 38de86937e fix(fonts): load URL-backed FontFace resources asynchronously
Fetch and validate font bytes through the owning Document resource loader,
including URL fallback, CORS, CSP redirects, Service Workers and preload/SRI
consumption. Preserve loaded promises and track pending FontFaceSet members,
ready promises and queued loading events.

Keep font tasks separate from author timer cancellation and dispatch child
CSP violations at their source Document. Replace fake font fixtures and
synchronous load assertions with real bytes and task-driven checks.
2026-11-02 06:02:24 +08:00