#4358 closed bug (invalid)
curCSS function in IE: "invalid argument"
Reported by: | sdyson | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.4 |
Component: | unfiled | Version: | 1.3.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
0;" |
This block of code seems to have originated from a fix by Dean Edwards at: http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
Attachments (1)
Change History (10)
comment:1 Changed 14 years ago by
comment:2 Changed 14 years ago by
I just added a use case to the ticket. It can also be seen at http://www.novactive.com/2009-03-curcss/index.htm.
Please note that I use the selecteSizer plugin to trigger the bug.
I also added a patch in the page.
comment:3 Changed 14 years ago by
Thanks for the test case.
I'm not sure if your fix is correct according to the intention of the function. As I understand it the function will return a given css property but any non-px dimensions will get converted to px. Your function still uses pixelLeft for the return value so if I ask for "padding" which has an original value of "0px 2px" your function will return me "2px".
I think what might be needed is to split multi-value properties into the individual values, convert each in turn and then concatenate them together.
comment:4 Changed 14 years ago by
Actually, since padding
is not related to left
we don't know what pixelLeft
will return.
comment:5 Changed 14 years ago by
Yes, I just managed to prevent the error for IEs.
I thought that the error came from the use of .left
that should be already defined for style.left
, I did not get further (lack of time and knowledge).
comment:6 Changed 14 years ago by
The error happens because left
expects a single dimension (e.g. 2px, 2%, 2em etc) but if the requested property is a multi-value one such as padding
then the left
property will fail to parse it.
Your solution is likely to have some very strange side-effects because you are returning a completely different property to the one that was originally asked.
comment:7 Changed 14 years ago by
Oh, I did not understand that the code was only intending to get the left value... I do not understand why this value is so much more important than others...
comment:8 Changed 14 years ago by
The left
property is being used because it has a corresponding pixelLeft
property allowing conversion to pixels. The original left
value is set back afterwards.
I may have some time tomorrow to have a go at fixing this.
comment:9 Changed 13 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
The documentation for .css()
is clear that shorthand properties are not supported for setting. The test case uses minified code so it's not very helpful for debugging. It appears that these bugs are in the plugins that cause the issue, not in jQuery, so please report them to the plugin authors.
I have the same issue with a margin.
It seems that replacing all the
.left
in the function with[name]
fixes the bug.I'll try to build a test case.