Modify ↓
Ticket #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: | ||
| Blocking: | Blocked by: |
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
comment:1 Changed 11 months ago by mikesherov
- Owner set to mikesherov
- Priority changed from undecided to high
- Status changed from new to assigned
- Component changed from unfiled to css
- Milestone changed from None to 1.8
comment:3 Changed 11 months ago by CodyCodeman
// 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 11 months ago by Mike Sherov
- Status changed from assigned to closed
- Resolution set to fixed
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
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.
