#7409 closed bug (wontfix)
jQuery.fn.css('border-width') is seriously flawed
Reported by: | boecko | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | |
Component: | css | Version: | 1.4.4rc |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
see: http://jsfiddle.net/boecko/3EdaS/2/[[BR]]
1.4.2 -> border-width 4px 4px (right)
1.4.3 -> border-width (nothing!!)
1.4.4rc2 -> border-width auto auto
Change History (17)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
the above output is from WebKit. Firefox reports this:
1.4.2 -> border-width 4px (still right, css('border-width') is empty)
1.4.3 -> border-width (nothing!!)
1.4.4rc2 -> border-width auto auto
comment:4 Changed 12 years ago by
Cc: | john snover added |
---|---|
Component: | unfiled → css |
Keywords: | needsreview added |
Priority: | undecided → blocker |
Status: | new → open |
comment:5 Changed 12 years ago by
As a already said in #7283
this is definitely the desired result now
- I think it's not good to change the expected result between minor versions.
- a cleaner solution would be:
a) to introduce a unit converter function (unitInPixels), which can be called if desired
b) a cssCurrent - function or something , which reports back the current value in pixels or whatever.
- for mmToPixels i'm using following function to get the dpi
function getDpi() { var mm = 100000; var dpitest = $('<div id="dpitest" style="disply:none;width:'+ mm + 'mm;height:10px"/>'); var inch2mm = 25.4; dpitest.appendTo('body'); var px = dpitest.outerWidth(); var dpi = Math.round(px / (mm / inch2mm) * 1000) / 1000; dpitest.remove(); return dpi; };
:
comment:6 Changed 12 years ago by
Cc: | john snover removed |
---|---|
Milestone: | 1.5 → 1.4.5 |
The behavior for >=1.4.3 is markedly regressed
comment:7 Changed 12 years ago by
next one in here RC3 ... http://jsfiddle.net/boecko/3EdaS/
1.4.2 -> border-width 4px 4px (right) 1.4.3 -> border-width (nothing!!) 1.4.4rc2 -> border-width auto auto 1.4.4rc3 -> border-width (nothing!!)
comment:8 Changed 12 years ago by
Cc: | snover john added |
---|---|
Keywords: | regression added |
Milestone: | 1.4.5 → 1.4.4 |
Confirmed. This issue is very, very broken.
jQuery 0 GIT: http://jsfiddle.net/rwaldron/3EdaS/10/
jQuery 1.4.4rc3: http://jsfiddle.net/rwaldron/3EdaS/13/
jQuery 1.4.3: http://jsfiddle.net/rwaldron/3EdaS/12/
jQuery 1.4.2: http://jsfiddle.net/rwaldron/3EdaS/9/
jQuery 1.3.2: http://jsfiddle.net/rwaldron/3EdaS/11/
comment:9 Changed 12 years ago by
Keywords: | needstest added |
---|
comment:10 Changed 12 years ago by
Keywords: | needsreview regression needstest removed |
---|---|
Milestone: | 1.4.4 → 1.5 |
Priority: | blocker → low |
comment:11 Changed 12 years ago by
Cc: | snover john removed |
---|---|
Milestone: | 1.5 |
Resolution: | → wontfix |
Status: | open → closed |
use .css("border-width-top")
See also:
https://github.com/brandonaaron/jquery-cssHooks
http://blog.petersendidit.com/post/csshooks-in-jquery-1-4-3/
comment:12 Changed 12 years ago by
this is fucked up .... csshooks may be fine, but have you ever heard the 4 words "compatibility between minor versions"?
so why don't implement the basic versions via csshooks like it was and let it extend to whatever nifty feature you want?
Think about the plethora of plugins which breaks, because of that! my jquery-plugin (here in action http://www.logowein.de/designer.php?_theme=polaroid) reads the css-value of a html-template (e.g in mm) to modify this value via a JQ UI-Slider.
Now, because some genius thinks he can break a stable api, i have to maintain to versions of that.
BTW: Where in hell is the behavior change documented? http://blog.jquery.com/2010/10/16/jquery-143-released/ this way to little info for my taste .. Couldn't you just give a simple function/hint for the old behavior?
This isn't even consistent! Apparently you should get the computed value as number, BUT you have to unset it via string and not null (#7233). Don't tell me, that this well thought: just to clarify
$.css('width') -> gets a computed number instead of a string $.css('width',null) doesn't work, because it exepects a string -> $.css('width', "")
comment:13 Changed 12 years ago by
JESUS!..
http://jsfiddle.net/boecko/3EdaS/14/
instead of ..
$('#foo').css('borderWidth');
i have to use
$.style($('#foo')[0], 'borderWidth');
now, to get the expected behavior. really nice.
comment:14 Changed 12 years ago by
BTW: Your suggestion
use .css("border-width-top")
doesn't work.So how on earth can you close this bug!?
comment:16 Changed 12 years ago by
@ kswedberg agreed .. it works .. but it's not intuitive, because i'm interested in the style value.
comment:17 Changed 11 years ago by
Issue still at large and very frustrating. Furthermore, chrome and opera (latest builds) deal with it by reading the general border-width value as one would hope, internet explorer (8&9) and safari effectively and such call and walk on past, but in firefox calling css("border-width") breaks the code. At a minimum this represents a lack of cross browser support.
sorry .. wrong url
http://jsfiddle.net/boecko/3EdaS/2/