Opened 15 years ago
Closed 15 years ago
#3022 closed bug (wontfix)
Setting CSS to NaN throws IE error
Reported by: | rodnaph | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.3 |
Component: | core | Version: | 1.2.6 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
If you try to set a css property to NaN it throws an 'Invalid argument' exception in IE. Should jQuery test for this for robustness?
Example:
$( 'body' ).css({ height: 'a'*1 });
Suggested patch attached.
Attachments (1)
Change History (5)
Changed 15 years ago by
Attachment: | patch_nan_css.patch added |
---|
comment:1 Changed 15 years ago by
comment:2 Changed 15 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
Why would you set NaN as a css value ? The other ticket isn't related to this.
NaN is just an invalid value, so I don't see any need to check this.
Please reopen if you have anything else to add.
comment:3 Changed 15 years ago by
Resolution: | invalid |
---|---|
Status: | closed → reopened |
I know that normally you'd never set NaN as a value, but the reason I thought it could have been a problem is because it creates different behaviour across browsers. Firefox happily ignores the value when it's set, but IE throws an error dialog. I understand if it's not something that you think needs attention though.
comment:4 Changed 15 years ago by
Resolution: | → wontfix |
---|---|
Status: | reopened → closed |
I think jQuery needs to provide normalize methods to do needed tasks. The fact that they behave differently doesn't mean that needs to be normalized.
Just make sure NaN's don't slip in by accident :)
Maybe this is a duplicate of #2954, probably a much better fix?