Re: [w3ctag/design-reviews] Behavior of the "disabled" attribute for HTMLLinkElement (#519)

> So one thing I'm trying to understand is how dynamic changes of disabled are processed. It seems like the change to the "linked resource fetch setup steps" means that the stylesheet isn't even loaded -- and then I think the change to "The appropriate times to fetch and process this type of link" means that changing disabled would mean that it causes the style sheet`s CSSOM representation to be dropped? Is that correct? (And is it desirable?)

Yes, that's correct and intentional. `<link rel=stylesheet disabled>` has `link.sheet == null;`. It indeed doesn't even load the stylesheet if the attribute is present in the first place.

This matches WebKit / Blink's behavior when coming from the parser (they had a quirk where if you remove and add the attribute again after loaded, it'd behave differently in somewhat odd ways). See https://github.com/whatwg/html/issues/3840#issuecomment-481034206 for context.

When disabled is removed, then stuff is processed normally, except for the "explicitly enabled" bit, which also makes alternates to work.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/design-reviews/issues/519#issuecomment-645737781

Received on Thursday, 18 June 2020 02:50:16 UTC