#9659 closed bug (cantfix)
CSS "left" value is incorrect when set to "auto" in FF4
Reported by: | grandpaslab | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | 1.next |
Component: | css | Version: | 1.6.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
When using $(selector).css("left") in FireFox 4.0.1, a pixel value is returned when the "left" attribute is set to "auto".
Chrome 12.0.742.100 correctly returns "auto".
Change History (3)
comment:1 Changed 12 years ago by
comment:2 follow-up: 3 Changed 12 years ago by
Component: | unfiled → css |
---|---|
Priority: | undecided → low |
Resolution: | → cantfix |
Status: | new → closed |
Test case with jQuery git: http://jsfiddle.net/timmywil/5qtRX/4/
I don't think there's anything we can do. Firefox is actually doing the best thing here. css should return computed values, but if no computed value is present, it falls back to uncomputed styles. Firefox gives us an actual computed value while other browsers only give "auto" for a computed value.
comment:3 Changed 12 years ago by
Computed values are what's expected? I would assume that .css() would return what's set in the css. If I wanted a computed value, I would have used .offset().left. In my use case, I am trying to save current css values so I can re-set them later. If .css() won't give me the current values it looks like there's no jquery way to get them.
BTW my current hack/workaround is to unset the position attribute before retrieving the left value.
This happens when position: absolute is set.