Ignores media types in stylesheet PIs

Safari ignores specified media types in stylesheet processing instructions. It loads all stylesheets instead.

Test page Workaround is not included
Reported by: Kenny Graham.

(Orphaned), Safari | Reported on 27 September 2006.

Atom RSS

This site heavily relies on bug reports created by its readers. Anyone can report a bug and be published.

Main navigation:

Search reports by browser:


(Add your own)

1 Posted by Bob on 27 September 2006

If it just downloads the stylesheets then it's not a but, it's just behaving like every other browser. Browsers that support alternative stylesheets will also download these even if the user doesn't switch to them.

It's only a bug if the stylesheet is applied when it shouldn't be, and I've never seen Safari do that. It ignores my handheld and print rules when didplaying pages on a desktop/laptop.

The way all browsers handle stylesheets is quite messy,inefficient and could do with updating (both the specs and the implementations), but it's not a bug. How annoying would it be if you went to a site, disconnected and then tried to print the page only to find the 'screen' stylesheet was being ignored and the 'print' stylesheet hadn't been downloaded.

2 Posted by Milo on 27 September 2006

According to the test page, Safari also applies (not just downloads) the style sheet marked for "handheld" use.

3 Posted by Ik on 28 September 2006

This page is XHTML 1.1 served as such, and with stylesheets being attached using generic XML syntax rather than XHTML elements.

So it looks like Safari doesn't recognise media types for XML stylesheets.

I don't see this as an important ommision since it's impractical to send pages as XHTML let alone use XML stylesheets, and will be for many years to come because of IE. And since Safari and every other browser can candle what you have to send to IE just fine I think it's a waste of time and effort to make pages get sent as different things to different browsers.

I'm sure by the time we can safely send pages as XHTML on the web, whatever version of Safari is around at the time (assuming it's still around given the likely wait we're facing) will handle the media attribute on XML just fine.

I see this as an XML problem, by the way. What happens if elements are used instead (it's still valid and even the preferred method to attach stylesheets to XHTML)?

4 Posted by Ik on 28 September 2006

That should have asked what happens when LINK elements are used to link to the stylesheets, but the tags I typed in got stripped out.

The 'XHTML elements' in the first paragraph should have also said xhtml LINK elements

5 Posted by David Kilzer on 23 December 2006

Filed Bug 11939 for WebKit.


Test page link is broken.

Post a comment

Commenting guidelines:

  1. When quoting specs, articles or your own research, please include a URL of the document.
  2. Test your stuff. When reporting browser behaviour, make sure that your report is correct.