Ticket #3690 (closed bug: wontfix)
div widths can be reported incorrectly if external stylesheet is included after jquery.js, in Safari
| Reported by: | darren | Owned by: | flesler |
|---|---|---|---|
| Priority: | major | Milestone: | 1.3 |
| Component: | dimensions | Version: | 1.2.6 |
| Keywords: | safari stylesheet width document ready onload | Cc: | darren |
| Blocking: | Blocked by: |
Description
<link rel="stylesheet"> tags must come before the <script src="jquery.js"> tag in Safari, or else div elements may report their width incorrectly from $(document.ready()). <body onLoad> seems to work most (all?) of the time.
See attached files for test-case.
The bug is consistently reproducible in Safari 3.2.1 (5525.27.1), and occurs some of the time in Webkit nightly from 5.dec.2008 (hitting refresh several times in a row should repro).
A plugin implemented this workaround in http://dev.jquery.com/changeset/5474
Attachments
Change History
comment:1 Changed 3 years ago by flesler
- Cc darren added
- Resolution set to wontfix
- Status changed from new to closed
- Component changed from unfilled to dimensions
That is indeed the common workaround.
Just move up the css. There's no hack to guess the real dimensions.
comment:2 Changed 3 years ago by darren
Probably there should be a note on this in the doc for ready() .. I spent a day trying to work out what was wrong after all..
comment:3 Changed 3 years ago by flesler
Ok, but rather post this request to jQuery's google group
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

