[cssom] Drop support for alternative stylesheets?

In the context of this bug

    https://www.w3.org/Bugs/Public/show_bug.cgi?id=22479

it was suggested that it may be time to drop support for alternative  
stylesheets in the Web platform.

In data set 18/06/2013 http://webdevdata.org I see 368 sites out of 53,000  
using alternate stylesheets (with <link>), so that's 0.7%.

For the API, I see 0 instances of selectedStyleSheetSet,  
selectedStylesheetSet or enableStyleSheetsForSet. There might be pages  
that use <link>.disabled to switch, but this seems a bit harder to look  
for. Also the data doesn't include external scripts.

3 sites use <meta http-equiv=Default-Style>, but they don't have  
differently-titled stylesheets. 0 sites use Default-Style HTTP header.  
There could be sites that only include the header if the user has chosen a  
different style sheet set (and the site stores the choice in a cookie),  
but this seems hard to check for.

WebKit and Blink don't load alternative stylesheets and don't put them in  
document.styleSheets. Toggling .disabled doesn't work. The CSSOM API for  
switching stylesheets isn't implemented. The only thing that does seem to  
work is changing Default-Style, but doing so leaves the CSSOM in a weird  
state: the old stylesheet is emptied of its cssRules and the new  
stylesheet still isn't exposed.

Firefox and IE10 have UI for switching stylesheets. Only Firefox support  
the CSSOM APIs for switching stylesheet sets. (Don't know about IE11.)

It would be interesting to have data on how often users switch  
stylesheets, both using the browser's UI and using JS-based switchers  
provided by the page (I think most such switchers just toggle .disabled on  
<link>).

The API around alternative stylesheets assume that non-preferred  
stylesheets are loaded (and present in document.styleSheets). Doing so is  
bad for performance for users that don't switch stylesheets on pages that  
have alternative stylesheets (or arguably it's bad for all users).

If a user wants to switch styles on a site, presumably the user wants the  
switch to persist across page navigations. This is not the case with  
alternative stylesheets without cooperation of the site -- it needs to  
manually store the choice and manage which style sheet to have enabled on  
page loads.

My proposal right now is, for the sake of discussion, to drop everything  
that has to do with alternative stylesheets (which most closely matches  
what WebKit and Blink do today). Are Mozilla and Microsoft OK with that?

-- 
Simon Pieters
Opera Software

Received on Thursday, 29 August 2013 14:11:45 UTC