Opened 7 years ago
Closed 7 years ago
#12088 closed bug (fixed)
Webkit now returning percentages for more getComputedStyle properties
| Reported by: | mikesherov | Owned by: | mikesherov |
|---|---|---|---|
| Priority: | high | Milestone: | 1.8 |
| Component: | css | Version: | git |
| Keywords: | Cc: | ||
| Blocked by: | Blocking: |
Description
Strangely, if an element has css 'min-width' value and a css margin value that is a %, in Safari (Version 5.1.7 (7534.57.2)), the returned value for $(element) is the 'min-width' value!
Change History (4)
comment:1 Changed 7 years ago by
| Component: | unfiled → css |
|---|---|
| Milestone: | None → 1.8 |
| Owner: | set to mikesherov |
| Priority: | undecided → high |
| Status: | new → assigned |
comment:2 Changed 7 years ago by
comment:3 Changed 7 years ago by
// A tribute to the "awesome hack by Dean Edwards"
// WebKit uses "computed value (percentage if specified)" instead of "used value" for margins
// which is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
if ( !jQuery.support.pixelMargin && rmargin.test( name ) && rnumnonpx.test( ret ) ) {
width = style.width;
style.width = ret;
ret = computed.width;
style.width = width;
}
}
return ret;
comment:4 Changed 7 years ago by
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
Fix #12088, Safari 5 and more percentages in getComputedStyle
In particular, min-width and max-width are taunting the awesome hack. Closes gh-865.
Changeset: aa3fabce461313f7c31e9a250df57165f15be873
Note: See
TracTickets for help on using
tickets.

https://github.com/jquery/jquery/pull/865