Bug 38113 - Disabling a 'style' element through DOM doesn't reload the style sheet
Summary: Disabling a 'style' element through DOM doesn't reload the style sheet
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL: http://www.arcrachatcredits.org
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-26 04:20 PDT by Mitch 74
Modified: 2022-07-12 20:38 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mitch 74 2010-04-26 04:20:38 PDT
Probably related to bug 14586.

Webkit doesn't populate document.styleSheets with stylesheets other than the
default/preferred one (no way to access alternate stylesheets for example), so
there is no way to use a Javascript stylesheet switcher. The following methods
don't work:

 - inserting a new stylesheet through Javascript then enabling it
 - disabling the preferred stylesheet
 - enabling an alternate stylesheet
 - disabling (as in, object.disabled=true) the (X)HTML element that loads the
preferred stylesheet (STYLE or LINK tags)

Untested: deleting the DOM node instead of merely disabling it

Test case:

http://www.arcrachatcredits.org

This website disables the stylesheet 'style-vert-css2.css' loaded through a
STYLE tag in the head if the document's body is smaller than 640x400 (and
re-enables it if resized above said resolution).

The test case works on Firefox 2.0 to 3.7a5pre, IE 7 (real and emulated) to 9,
Opera 10.10.

It doesn't work in Konqueror 4.2, Chromium 5.0.339, Chrome 4.1.249.1045, Safari
4.0.5 (531.22.7).
Comment 1 Brent Fulgham 2022-07-12 12:56:00 PDT
I can't tell a difference between Safari, Chrome, or Firefox on this site. Please REOPEN this bug with a simple test case if you believe there is still an issue here.
Comment 2 Alexey Proskuryakov 2022-07-12 20:38:23 PDT
I would expect that we still have issues in this area (and other browsers might too). But someone would need to create minimized test cases.