html-include-element
html-include-element copied to clipboard
Hide content until loaded
Following on https://github.com/justinfagnani/html-include-element/pull/7#discussion_r379845320, we'd like some atts to control loading behaviour.
Strawman
Default loading behaviour should defer the
loadevent until all loaded resources are finished. It should also hide the content withdisplay: none;until the resources are loaded.
Applying the
foucattribute disables the hide-until-load-event behaviour, showing content and allowing a FOUC to occur
Applying the
eagerattribute disables the defer-load-event behaviour, firing theloadevent as soon as the partial atsrcis fetched and parsed asinnerHTML
Questions
- Should we defer
loadfor onlylink[rel="stylesheet"], or forimgandiframeas well? - Bikeshedding attr names: proposed names are very bespoke, can we uses something more appropriate by borrowing from existing APIs? (
async,defer, etc.)- OTOH, we'd perhaps like these behaviours to be opt-out rather than opt-in, so
no-async no-defer?
- OTOH, we'd perhaps like these behaviours to be opt-out rather than opt-in, so