-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Description
This has come onto my radar since I need to figure out if we should add [CEReactions] to the disabled, which is currently not specced.
Previously, in https://www.w3.org/Bugs/Public/show_bug.cgi?id=24284, Hixie says:
I've removed the "disabled" attribute on HTMLLinkElement and HTMLStyleElement, since it's CSSOM specific. It should instead be defined on LinkStyle.
As far as I can tell, it does the same as LinkStyle.sheet.disabled, except if LinkStyle.sheet is null, in which case it returns false and ignores setting. (This is based on what the HTML spec used to say.)
According to https://jsbin.com/vecofi/edit?html,output, the situation is a bit more complex than Hixie makes it sound. In particular, in Chrome, Safari, and Edge, the disabled property controls the presence of the disabled content attribute, and the disabled content attribute can be used to disable stylesheets as well.
In Firefox, this is not the case; there the disabled property controls the disabled-ness of the stylesheet, but there is no content attribute behavior at all.
The use counter for the disabled content attribute in Chrome is at https://www.chromestatus.com/metrics/feature/popularity#HTMLLinkElementDisabled and stands at 0.0410%, which is fairly high.
If we want to go with the majority behavior---which we probably should?---then I think this needs to move back into HTML. Perusing the Chrome code, it seems like the behavior is fairly involved, and involves a tri-state DisabledState enum of Unset/EnabledViaScript/Disabled. It also has interactions with alternate stylesheets. See https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp&sq=package:chromium&q=HTMLLinkElement&l=644