Permalink
3 comments
on commit
sign in to comment.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Only set height/width if it's a non-negative number (don't set it to 0).
- Loading branch information
Showing
1 changed file
with
5 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8b70159
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You also set it to 0....
8b70159
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, that's not the case. In the current version of jQuery we do:
Which effectively sets no value. We're matching that functionality (as of this commit).
8b70159
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is not internet explorer. The problem itself is the attempt to assign a property value that is invalid or unparseable. The error is not limited to height or width (or other properties that accept length that is not negative (borderWidth, fontSize)).
This feature was discussed on comp.lang.javascript fairly recently in "Sencha Touch--Support 2 browsers in just 228K!" and also later in "isColor()?". For another example, when making transitional adjustments to style (animation), assigning
"100"
for fontWeight works because "100" is a valid value, but "101" is not a valid value, and so can be expected to thrown the error specified in DOM 2 Style.Validating only two properties is limited but trying to validate every possible input value for every property would be impractical.