Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#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
Blocked by: Blocking:

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 (2)

index.html (1021 bytes) - added by darren 12 years ago.
stylesheet.css (81 bytes) - added by darren 12 years ago.

Download all attachments as: .zip

Change History (5)

Changed 12 years ago by darren

Attachment: index.html added

Changed 12 years ago by darren

Attachment: stylesheet.css added

comment:1 Changed 12 years ago by flesler

Cc: darren added
Component: unfilleddimensions
Resolution: wontfix
Status: newclosed

That is indeed the common workaround.

Just move up the css. There's no hack to guess the real dimensions.

comment:2 Changed 12 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 12 years ago by flesler

Ok, but rather post this request to jQuery's google group

Note: See TracTickets for help on using tickets.