This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 27677 - Standardise "disabled" attribute on <link> elements
Summary: Standardise "disabled" attribute on <link> elements
Status: RESOLVED WORKSFORME
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-19 19:46 UTC by Krinkle
Modified: 2018-06-28 23:23 UTC (History)
5 users (show)

See Also:


Attachments

Description Krinkle 2014-12-19 19:46:04 UTC
The attribute would be like a typical boolean attribute and would affect the initially used value of the "disabled" flag of a stylesheet.[1][2]

[1] http://dev.w3.org/csswg/cssom/#concept-css-style-sheet-disabled-flag
[2] http://dev.w3.org/csswg/cssom/#dom-stylesheet-disabled

Documentation about the attribute at MDN:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-disabled
> Note: While there is no disabled attribute in the HTML standard, there
> is a disabled attribute on the HTMLLinkElement DOM object.
> 
> The use of disabled as an HTML attribute is non-standard and only used
b> y some browsers. Do not use it.
Comment 1 Simon Pieters 2015-01-05 09:48:01 UTC
What's the use case?
Comment 2 Krinkle 2015-02-06 05:55:02 UTC
The use case is the demo page of VisualEditor and OOjs UI (front-end libraries). They ship with two different themes, and also support LTR and RTL directions.

As such the HTML page has 4 stylesheets specified. One loaded by default, and the others toggled via dynamic JavaScript-powered interfaces. They were originally authored and tested locally in Firefox without checking whether they were standardised or supported cross-browser.

It naturally made sense for it to exist, but alas, they're non-standard and e.g. not implemented in Blink/Chromium. However Firefox did (which makes sense).

Similar to the disabled attribute on HTML input elements.

As work-around in our project we now do an overly complex abstraction where we add the stylesheets with javascript (thus often causing a flash of unstyled content due to the lack of a simple callback for stylesheets having been loaded).
Comment 3 Simon Pieters 2015-02-06 08:02:17 UTC
What is the difference from alternative stylesheets?

<link rel=stylesheet href=A title=A> <!-- enabled -->
<link rel="alternate stylesheet" href=B title=B> <!-- disabled -->

You can then toggle between them in JS with .disabled or with .enabledStyleSheetForSet().

http://dev.w3.org/csswg/cssom/#dom-document-enablestylesheetsforset
Comment 4 Ian 'Hixie' Hickson 2015-03-04 19:26:34 UTC
If the use case is alternative style sheet sets, then yeah, the existing feature for alternative style sheet sets seems like the way to go. Alternatively, just don't put the <link> elements in the DOM until you need them.