A Touch of Class

f. rainne

Firefox and Switching Styles


I had decided to take another shot at Bug 32372: should be able to disable CSS towards the end of this past spring. (My first one triggered a layout crasher that has since been fixed.) Once I'd written a fix for it on the 1.8alpha3 trunk, I queried Ben to see if he wanted the feature backported to the Aviary 1.0 branch, then filed bug 253332 and wrote a patch to do just that.

So when Brendan wrote about over-enthusiastic feature removals on the Aviary branch, he tapped me and asked if I could fix the buggyness in the switcher so he could argue for its re-introduction. I told him I'd work on it, but I needed 253332 checked in to do it.

Once the patch for 253332 had been checked in, I closed off all but one of the existing Firefox AltSS bugs in short order:

  1. 220975 - Style sheet selector does not display "No Theme" for pages without a base stylesheet (but shows Basic Theme) [FIXED by checkin for 253332]
  2. 224250 - Selecting "No Theme", then reselcting "Basic Theme" doesn't reapply styles [FIXED by checkin for 253332]
  3. 220649 - No Theme Selection Not Available on CSS sites that don't offer alternate stylesheets [FIXED by patch]
  4. 216424 - Can't use stylesheet switcher from keyboard [FIXED by checkin to 220649]
  5. 257157 - Alternate Style Icon shown even when no alternate styles (only one preferred one) [FIXED by patch]

Together with the fix for 253332, the effect of these changes is:

As Brendan noted in his roadmap post, the Aviary team re-enabled the AltSS UI on September 9th.

However, there's still one major bit of missing AltSS switching functionality, and that's selection persistence. Rob Tougher's Style Sheet Chooser extension does take care of this, but it does so in a way that I'm not comfortable adding to Firefox core. (I tried to write a temporary JS fix myself, but after spending a week exploring Mozilla's documented and undocumented interfaces for a way to trigger at the right point in page loading, I decided it wasn't worth it.) Either way, the real fix for persistence will come when bugs 200930 and 83663 are fixed, both major changes to Gecko. (Boris and I have plans for those two.)

UI Notes

There have been some questions about adapting the UI to handle this situation. We don't want users to consider the feature useless and ignore it even once we have persistence just because it doesn't persist now. One person suggested removing the AltSS UI altogether and leaving the No Style option as a main menu item in place of the Page Style submenu. However, I believe the best course is to remove the statusbar icon and to leave the View submenu intact. Once we have style history implemented, then we can put back the icon.

Advantages to this approach:


This should go without saying, but.. if you don't have any comments that will help us fix a given bug, don't comment in the bug report. (I.e. encouragement is not encouraged.) You can add yourself to the CC list or vote for it, though.

Dare to dream.