Side navigation
#7409 closed bug (wontfix)
Opened November 05, 2010 09:07AM UTC
Closed November 11, 2010 05:37PM UTC
Last modified August 12, 2012 01:05AM UTC
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: Attachments (0)
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 The test case is reproduceable and this seems like a valid issue. As a already said in #7283 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. 3. for mmToPixels i'm using following function to get the dpi : The behavior for >=1.4.3 is markedly regressed next one in here RC3 ... http://jsfiddle.net/boecko/3EdaS/ 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: use .css("border-width-top") See also: https://github.com/brandonaaron/jquery-cssHooks http://blog.petersendidit.com/post/csshooks-in-jquery-1-4-3/ 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 JESUS!.. http://jsfiddle.net/boecko/3EdaS/14/ instead of .. i have to use now, to get the expected behavior. really nice. BTW: Your suggestion doesn't work.So how on earth can you close this bug!? @boecko, use .css('border-top-width") or .css("borderTopWidth") @ kswedberg agreed .. it works .. but it's not intuitive, because i'm interested in the style value. 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.Change History (17)
Changed November 05, 2010 09:19AM UTC by
comment:1
Changed November 05, 2010 09:29AM UTC by
comment:2
Changed November 05, 2010 02:59PM UTC by
comment:3
Changed November 05, 2010 05:33PM UTC by
comment:4
cc:
→ john, snover
component:
unfiled → css
keywords:
→ needsreview
priority:
undecided → blocker
status:
new → open
Changed November 06, 2010 12:15PM UTC by
comment:5
this is definitely the desired result now
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;
};
Changed November 10, 2010 10:49PM UTC by
comment:6
cc:
john, snover
milestone:
1.5 → 1.4.5
Changed November 11, 2010 02:27PM UTC by
comment:7
_comment0:
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!
\
}}}
\
\
→ 1289485714522120
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!!)
Changed November 11, 2010 05:17PM UTC by
comment:8
_comment0:
Confirmed. This issue 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/
\
\
→ 1289495924716166
cc:
→ snover, john
keywords:
needsreview → needsreview, regression
milestone:
1.4.5 → 1.4.4
Changed November 11, 2010 05:21PM UTC by
comment:9
keywords:
needsreview, regression → needsreview, regression, needstest
Changed November 11, 2010 05:25PM UTC by
comment:10
keywords:
needsreview, regression, needstest
milestone:
1.4.4 → 1.5
priority:
blocker → low
Changed November 11, 2010 05:37PM UTC by
comment:11
_comment0:
use .css("border-width-top")
\
\
See also:
\
\
https://github.com/brandonaaron/jquery-cssHooks
\
\
http://blog.petersendidit.com/ → 1289497150452490
cc:
snover, john
milestone:
1.5
resolution:
→ wontfix
status:
open → closed
Changed November 11, 2010 07:18PM UTC by
comment:12
_comment0:
this is fucked up ....
\
csshooks may bee fine, but have you ever heard the word 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', "")
\
\
}}}
\
\
→ 1289503122290206
_comment1:
this is fucked up ....
\
csshooks may be fine, but have you ever heard the word 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', "")
\
\
}}}
\
\
→ 1289503196037241
$.css('width') -> gets a computed number instead of a string
$.css('width',null) doesn't work, because it exepects a string
-> $.css('width', "")
Changed November 11, 2010 08:17PM UTC by
comment:13
$('#foo').css('borderWidth');
$.style($('#foo')[0], 'borderWidth');
Changed November 11, 2010 08:25PM UTC by
comment:14
_comment0:
BTW:
\
Your suggestion
\
> use .css("border-width-top")
\
\
doesn't work.So how on earth can you close this bug!? → 1289507188555317
use .css("border-width-top")
Changed November 11, 2010 08:43PM UTC by
comment:15
Changed November 11, 2010 09:18PM UTC by
comment:16
Changed August 12, 2012 01:05AM UTC by
comment:17
sorry .. wrong url
http://jsfiddle.net/boecko/3EdaS/2/