Description
Consider the following test-case:
<!doctype html>
<link rel="stylesheet" disabled href="data:text/css,html { background: green }">
<div id="log"></div>
<script>
window.onload = function() {
log.innerHTML = document.styleSheets.length;
}
</script>
Current browser behavior is:
- Firefox: Green background,
<link>
appears indocument.styleSheets
. - WebKit / Blink: White background, no element in
document.styleSheets
. - Edge: White background,
<link>
appears indocument.styleSheets
.
As far as I can tell, the specified behavior is Firefox's. But that being said, Firefox supports doing link.disabled = true
and toggling the disabled
flag on the stylesheet, even though it's not in the webidl.
Should the disabled
attribute affect whether the sheet is enabled or not? If not, could we get that clarified?
Should disabled
be in HTMLLinkElement
s IDL? 'disabled' in HTMLLinkElement.prototype
returns true everywhere.
Should a disabled
sheet appear in document.styleSheets
? Blink and WebKit don't remove it if you toggle the attribute, which looks definitely like a bug to me.
I think I'd expect either Firefox's behavior (disabled
attribute has no effect, disabled
via the IDL tweaks the disabled flag of the sheet (effectively forwards setting and getting to the sheet
), or Edge's behavior, where the disabled
attribute presumably reflects sheet.disabled
(though note I haven't checked this in practice, chances are that link.sheet.disabled = true
doesn't affect link.hasAttribute("disabled")
) and stuff like that.