You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The history of "Document Policy" is weird... Feature-Policy (i have a PR to retitle Eric's nice blogpost..) was introduced in 2018. It had features to control access to permissions and then a handful of UX-y checks/controls for common UX problems.
The whole thing was split into Permission Policy and Document Policy. Though weirdly document.featurePolicy.allowedFeatures() still exists and has a listing of the union.
The permission policy stuff got fairly formalized and adopted. But theres this handful of old UX-y checks in Document-Policy that are VERY similar to Lighthouse audits. They may be useful to us as we consider some core refactors..
font-display-late-swap: something about use of font-display: optional.... I think if the font is loading late (and thus optional would help), it notify and maybe overrides? Not sure if it reports use of other values.
sync-script: Don't do inline scripts or script[src] without defer/async.
oversized-images: Don't use images that are naturally too big and therefore excessively scaled down into their container. Has a user-configurable "downscale ratio" parameter.
lossless-images-strict-max-bpp, lossless-images-max-bpp, lossy-images-max-bpp. Like our optimized-images audit, with a customizable byte-per-pixel ratio.
unsized-media: like our unsized-images audit.
document-write: Can block usage.
sync-xhr (in permissions policy, actually): reports when sync xhrs are used
js-profiling: Enables use of JS self profiling api. very unrelated.
force-load-at-top. Allows pages to opt out of scrolling on pageload (like to a fragment). Not relevant for us.
I'm not sure that all of these can currently run in report-only mode, but.. it should be possible to add trace events, etc. (related)
The text was updated successfully, but these errors were encountered:
animations: AFAIK the implementation for this gave us the trace events that we consume already. Done.
font-display: The Lighthouse logic gives you a pass if you set swap or optional. (or if you very deliberately say you want to make the user wait with block or fallback.) But the doc policy is going for something slightly different (right?!). That said, the impl looks clear enough for us to add a trace event there. 🖖
Mostly brain dumping my research for future us...
The history of "Document Policy" is weird... Feature-Policy (i have a PR to retitle Eric's nice blogpost..) was introduced in 2018. It had features to control access to permissions and then a handful of UX-y checks/controls for common UX problems.
The whole thing was split into Permission Policy and Document Policy. Though weirdly
document.featurePolicy.allowedFeatures()
still exists and has a listing of the union.The permission policy stuff got fairly formalized and adopted. But theres this handful of old UX-y checks in Document-Policy that are VERY similar to Lighthouse audits. They may be useful to us as we consider some core refactors..
resources
document policy features
animations
: reports layout-causing (non composited) animationsfont-display-late-swap
: something about use offont-display: optional
.... I think if the font is loading late (and thusoptional
would help), it notify and maybe overrides? Not sure if it reports use of other values.sync-script
: Don't do inline scripts orscript[src]
without defer/async.oversized-images
: Don't use images that are naturally too big and therefore excessively scaled down into their container. Has a user-configurable "downscale ratio" parameter.lossless-images-strict-max-bpp
,lossless-images-max-bpp
,lossy-images-max-bpp
. Like our optimized-images audit, with a customizable byte-per-pixel ratio.unsized-media
: like our unsized-images audit.document-write
: Can block usage.sync-xhr
(in permissions policy, actually): reports when sync xhrs are used: Enables use of JS self profiling api. very unrelated.js-profiling
. Allows pages to opt out of scrolling on pageload (like to a fragment). Not relevant for us.force-load-at-top
I'm not sure that all of these can currently run in report-only mode, but.. it should be possible to add trace events, etc. (related)
The text was updated successfully, but these errors were encountered: