W3C home > Mailing lists > Public > site-comments@w3.org > December 2010

Advanced style sheet still applied in mobile view in Chrome and Safari

From: Francois Daoust <fd@w3.org>
Date: Thu, 16 Dec 2010 14:42:15 +0100
Message-ID: <4D0A1737.90705@w3.org>
To: site-comments@w3.org

Among other things, switching to mobile view on a "desktop" Web browser disables the "advanced" stylesheet through a tiny bit of JavaScript code that sets the "disabled" attribute on the appropriate <style> element.

There is a bug in WebKit that affects Safari and Google Chrome. The "disabled" attribute is not (always) taken into account when set:

In short, switching to mobile view with Safari and Google Chrome only switches some of the styles (styles that rely on the presence of a "w3c_screen" class name on the <body> element get correctly deactivated, those that rely on the presence of a "w3c_handheld" class name get correctly activated), but some styles from the advanced style sheet still get applied, in particular for event dates, leading to a weird layout (dates overflow the visual date background in that case).

 From a standard perspective, I note that the "disabled" attribute on the <style> element is being standardized within HTML5 and CSSOM but was not defined in HTML4 / XHTML 1.0, AFAICT:

I suppose a possible workaround would be to remove the <style> element altogether while switching to mobile view (it could be kept in memory and re-inserted in the DOM if the user decides to switch back to desktop view).

Received on Thursday, 16 December 2010 13:42:44 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:15:42 UTC