Skip to main content

Bug Tracker

Side navigation

#3690 closed bug (wontfix)

Opened December 05, 2008 06:58PM UTC

Closed December 06, 2008 12:16AM UTC

Last modified December 07, 2008 07:02PM UTC

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 (1.0 KB) - added by darren December 05, 2008 06:59PM UTC.
  • stylesheet.css (0.1 KB) - added by darren December 05, 2008 06:59PM UTC.
Change History (3)

Changed December 06, 2008 12:16AM UTC by flesler comment:1

cc: → darren
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.

Changed December 06, 2008 03:59PM UTC by darren comment:2

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..

Changed December 07, 2008 07:02PM UTC by flesler comment:3

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