Skip to main content

Bug Tracker

Side navigation

#12088 closed bug (fixed)

Opened July 16, 2012 04:32PM UTC

Closed July 23, 2012 02:03AM UTC

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!

http://jsfiddle.net/E2U5C/6/

Attachments (0)
Change History (4)

Changed July 16, 2012 04:37PM UTC by mikesherov comment:1

component: unfiledcss
milestone: None1.8
owner: → mikesherov
priority: undecidedhigh
status: newassigned

Changed July 17, 2012 10:05PM UTC by mikesherov comment:2

Changed July 20, 2012 12:12AM UTC by CodyCodeman comment:3

            // 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;

Changed July 23, 2012 02:03AM UTC by Mike Sherov comment:4

resolution: → fixed
status: assignedclosed

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