There is a bug in the manner that alternate stylesheets are handled by Safari 4, Safari 3, and webkit: Description: Alternate stylesheets without a title attribute are rendered on reload (but not on initial load): Steps to reproduce: - Visit http://robballou.com/switcher/sandbox/alternate2.php - The page should load with a blue border on top. - Refresh the page - The page now has a red border (which is from the "alternate stylesheet") While the spec [1] mentions to add both alternate and title to an alternate stylesheet, it seems odd behavior that it does not load the altenerate on first page load, but not on subsequent loads. For what it's worth, both Firefox (3) and Opera (9.63) do not load the alternate stylesheet on reload (or at all). FF does not seem to even request the stylesheet from the server. [1]: http://www.w3.org/TR/REC-html40/present/styles.html#h-14.3.2
In Safari 5.1, the wrong stylesheet appears to be always loaded, not just on reload. See also: bug 77549.
(In reply to comment #1) > In Safari 5.1, the wrong stylesheet appears to be always loaded, not just on reload. > > See also: bug 77549. Investigated the complete test suite for alternate stylesheets (5 tests) at http://robballou.com/switcher/sandbox/alternate2.php . Here are the results: Test # -> | 1 | 2 | 3 | 4 | 5 +---+---+---+---+--- FF | P | P | P | P | P Chrome (webkit) | P | F | F | P | F IE | P | P | P | P | P Note the 3 failures for Chrome. This similar to the issue in bug 77549: the spec implies that alternate stylesheets must have a title. IE and FF have interpreted the spec this way, and the draft CSSOM spec (http://dev.w3.org/csswg/cssom/#requirements-on-user-agents-implementing-the-xml-stylesheet-processing-instruction) spells this out in detail.
Created attachment 130659 [details] Patch
Comment on attachment 130659 [details] Patch Please make the tests text-only.
(In reply to comment #4) > (From update of attachment 130659 [details]) > Please make the tests text-only. Will do. I expected you to mention this based on the review of 77549. Thanks!
Created attachment 131044 [details] Patch
(In reply to comment #6) > Created an attachment (id=131044) [details] > Patch - re-wrote tests as text tests - removed code comment (being consistent with the code change on bug 77549)
Comment on attachment 131044 [details] Patch r=me
Comment on attachment 131044 [details] Patch Clearing flags on attachment: 131044 Committed r110626: <http://trac.webkit.org/changeset/110626>
All reviewed patches have been landed. Closing bug.
will this bug resolves https://bugs.webkit.org/show_bug.cgi?id=56932 ..?