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

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

From: Ian Jacobs <ij@w3.org>
Date: Thu, 16 Dec 2010 12:15:08 -0600
To: Francois Daoust <fd@w3.org>
Message-Id: <430D879C-6F81-455E-9106-67ACB747C077@w3.org>
Cc: site-comments@w3.org

On 16 Dec 2010, at 7:42 AM, Francois Daoust wrote:

> Hi,
> 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:
> https://bugs.webkit.org/show_bug.cgi?id=25287
> 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:
> http://dev.w3.org/html5/spec/semantics.html#the-style-element
> http://dev.w3.org/csswg/cssom/#dom-stylesheet-disabled
> 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).

Hi François,

Thanks for the detailed report. We'll have a look at the issue.

  _ Ian
Ian Jacobs (ij@w3.org)    http://www.w3.org/People/Jacobs/
Tel:                                      +1 718 260 9447
Received on Thursday, 16 December 2010 18:15:11 UTC

This archive was generated by hypermail 2.4.0 : Monday, 18 April 2022 20:33:49 UTC