8000 <link rel="stylesheet" disabled> · Issue #3840 · whatwg/html · GitHub
[go: up one dir, main page]

Skip to content
<link rel="stylesheet" disabled> #3840
Closed
@emilio

Description

@emilio

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 in document.styleSheets.
  • WebKit / Blink: White background, no element in document.styleSheets.
  • Edge: White background, <link> appears in document.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 HTMLLinkElements 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.

cc @bzbarsky @annevk @FremyCompany @lilles @ericwilligers

Metadata

Metadata

Assignees

No one assigned

    Labels

    interopImplementations are not interoperable with each othertopic: style

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0