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 same might be said for links with a media attribute when the media query is not currently satisfied.
My rough idea to address the issue is basically this:
For any stylesheet link that the polyfill would process:
Check if it is disabled. If so, add a MutationObserver with { attributeFilter: ['disabled'] } that will handle processing the stylesheet if it were to become no longer disabled.
Check if it has media, and if so, create a MediaQueryList. If the media query list does not match, add an event listener for its change event that will handle processing the stylesheet if it were to become applicable according the media query.
The text was updated successfully, but these errors were encountered:
jgerigmeyer
changed the title
Handling stylesheet links that have disabled and/or media
Better handling of stylesheet links that have disabled and/or mediaOct 15, 2024
The issue:
disabled
attribute.The polyfill currently will load such links, and if any changes are applied, replace them with new links withoutdisabled
Even if the polyfill is modified to preserve(fixed in Do not fetch disabled links, but copy over all attributes to new link. #262)disabled
, it might not be desirable to fetch the resource in the first place.media
attribute when the media query is not currently satisfied.My rough idea to address the issue is basically this:
disabled
. If so, add aMutationObserver
with{ attributeFilter: ['disabled'] }
that will handle processing the stylesheet if it were to become no longer disabled.media
, and if so, create aMediaQueryList
. If the media query list does not match, add an event listener for itschange
event that will handle processing the stylesheet if it were to become applicable according the media query.The text was updated successfully, but these errors were encountered: