Commit graph

3200 commits

Author SHA1 Message Date
jeresig b92d2f0bc9 Merge branch 'attrhooks.1.6v2' of https://github.com/timmywil/jquery into timmywil-attrhooks.1.6v2
Conflicts:
	src/attributes.js
2011-04-10 15:41:51 -04:00
timmywil 3a1b4661f5 #8150 - When removing the width and height attributes in IE6/7, setting to "" actually sets to 0 instead of auto
- Having fixed this automatically with the use of removeAttribute in browsers that support it, this will fix it for IE6/7 as well.

- This has no effect on width/height styles set elsewhere( test added to removeAttr )

- With this addition, I need to call attr in removeAttr for IE6/7, which means boolean calls like .attr("checked", "") will no longer remove the attribute, which I think is fine.  .attr("checked", false) will still remove.  If I had left it, it would have gone in an infinite loop since setting to empty string is the only way to remove it in these browsers.

- The hrefNormalized hooks were returning null if they weren't present.  Added the null check to the getter.

- Now that the style support fails in IE8 as well due to uppercasing everything, no need to have style included with the hrefNormalized hooks
2011-04-09 17:25:06 -04:00
timmywil 17afd80d48 IE8 testing for lowercasing the css properties on retrieving style; had assumed the style support check failed in IE8, which it now does 2011-04-09 15:56:35 -04:00
timmywil 6f79bee3e3 Normalize css property names to lowercase for comparisons on a .attr('style') call since IE uppercases everything 2011-04-03 19:13:41 -04:00
timmywil ad2b3bc9f9 Found a problem removing the style attribute in IE
- Style is now a special case in IE6/7 to set cssText.  My goal is to avoid calling attr again for the performance benefit, and at this point it would also cause an infinite loop for the boolean attributes hooks such as selected & checked.  Nevertheless, style seems to be the only one requiring a special call.
2011-04-03 19:13:41 -04:00
timmywil 2a8a2b6148 Move the if statement in jQuery.fn.removeAttr to jQuery.removeAttr
- Extra testing on removeAttr and IE form weirdness( all good )
2011-04-03 19:13:41 -04:00
timmywil ff75767558 Minor adjustments and cleanup, including normalizing the value to a string when setting( list of changes below )
- Normalize set value to string to synchronize return type cross-browser

- Add style attrHook to propHooks to support style getting in all browsers for both attr and prop

- Extend the selected propHook instead of overriding a possible set function

- Remove selected propHook TODO since there is no selected content attribute and it should return null
2011-04-03 19:13:41 -04:00
timmywil 8cbf551a48 #5413 - Much shorter solution for getting width/height in ie6
- #8255 Added support for the list attribute in browsers that support it (it is automatically readonly, but can be set if using getAttribute( name, 2)
2011-04-03 19:13:41 -04:00
timmywil 5fc2281fcc - Added a hook to swap display none for width and height in browsers that do not sufficiently support get/setAttribute 2011-04-03 19:13:41 -04:00
timmywil 1e9b3ef3d8 Move the check for the name attribute out of attr and down to the formHook definition 2011-04-03 19:13:41 -04:00
timmywil fa4373c11b Add style attribute support tests to $.attr 2011-04-03 19:13:41 -04:00
timmywil a4d44979c6 Shorten the logic for hooks, ternary was unnecessary 2011-04-03 19:13:41 -04:00
timmywil 217a7abc43 Add name to prop hooks as well 2011-04-03 19:13:41 -04:00
timmywil 11c97bb066 Add attribute name to paramaters for hooks 2011-04-03 19:13:40 -04:00
timmywil 03da4c7ca7 Style formatting 2011-04-03 19:13:40 -04:00
timmywil 448111cbd4 No longer need to check for objects or string of null with the special form treatment and updates to removeAttr 2011-04-03 19:13:40 -04:00
timmywil 5caf7d8376 Clean up 2011-04-03 19:13:40 -04:00
timmywil 56014a1a00 Shorten even further 2011-04-03 19:13:40 -04:00
timmywil 479b28fb6a Modularize special form code for IE6/7 and clean up attr again 2011-04-03 19:13:40 -04:00
timmywil e0900a686d Fix issue where non-existant attributes on forms in IE6/7 were throwing errors 2011-04-03 19:13:40 -04:00
timmywil 3892df207d Add test for bug #3116 2011-04-03 19:13:40 -04:00
timmywil 47c80c2050 Add test for bug#3685, remove added html and add dynamicly to avoid global test suite errors 2011-04-03 19:13:40 -04:00
timmywil 9e05a0a37f Fix #6562, tighten up the special code for form objects, add name attrHook for IE6/7, and don't check for undefined with getting hook'd attr 2011-04-03 19:13:40 -04:00
timmywil 102053abd8 Fix #7472 and added test for #3113
- Forms with an input that has either name="action" or name="some-other-attr-on-the-form" caused problems in IE6/7.  This is fixed.

- Changed check in $.attr for ret === null to typeof ret === "object" to catch any inputs that are accidentally retrieved in IE6/7, since attributes cannot be set to objects and typeof null === "object"
2011-04-03 19:13:39 -04:00
timmywil 11cfdb2394 Non-existent attribute for jQuery.attr no longer needs to check for "undefined"
- Remove an unnecessary var

- Use variable in removeAttr for better minification
2011-04-03 19:13:39 -04:00
timmywil dfeeb872d6 Performance enhancement switching nodeType to a var 2011-04-03 19:13:39 -04:00
timmywil d28922bc03 Pass jslint, 2 missing semicolons 2011-04-03 19:13:39 -04:00
timmywil 2580420b7e Test description 2011-04-03 19:13:39 -04:00
timmywil 5ac6ca3fa5 Restored 6 tests that I had commented to come back to later to split up between prop and attr. All tests still pass in all browsers.
- I should make it clear that I have not removed any tests, but only moved some attr tests to prop where I thought it was appropriate.
2011-04-03 19:13:39 -04:00
timmywil dbe3b7a9d0 Style edits according to comments from John and rwaldron. 2011-04-03 19:13:39 -04:00
timmywil f578e0f997 Don't use extend when setting the action attrHook for IE6/7 2011-04-03 19:13:39 -04:00
timmywil 77c559c3cb No, don't return this. 2011-04-03 19:13:39 -04:00
timmywil b85d2cd8a5 Simplify jQuery.removeAttr and return this 2011-04-03 19:13:39 -04:00
timmywil 9f88fa9165 Full test suite now passes in all browsers! There are probably some tweaks we can make to shorten and simplify.
- removeAttr now only uses setAttribute if camelCase setAttribute is not supported

  + Might want to rename jQuery.support.getSetAttribute

- tabIndex is a special case now for hooks where undefined should be returned.

  + Should we be checking if hooks returns undefined?  undefined might be the desired return value in future hooks.
    As of now, tabIndex is the only one that needs it, but the test suite will still pass if we don't check if hooks are undefined.
2011-04-03 19:13:39 -04:00
timmywil 8cd30c62d8 Continuing IE7 testing, conditional attr fixes and hooks with feature testing. Will figure out a way to shorten after the test suite passes. 2011-04-03 19:13:39 -04:00
timmywil ebb8e8e300 Fix feature test, accidentally got rid of closure end 2011-04-03 19:13:39 -04:00
timmywil 00abeaee17 Didn't actually need the hooks anymore 2011-04-03 19:13:38 -04:00
timmywil 4baa213d88 First proposed solution for IE6/7 get/setAttribute quirks. Needs more testing, but solves some issues 2011-04-03 19:13:38 -04:00
timmywil 607210e010 Speed up hasAttr a little 2011-04-03 19:13:38 -04:00
timmywil 5eecb13fa3 Now passes in IE8, changed around $.hasAttr and switched the attrHook for selected to be a propHook 2011-04-03 19:13:38 -04:00
timmywil de79e8c7e0 Make the new attr/prop changes pass the test suite (in Webkit). There are still errors in IE.
+ Added hooks for selected, checked, readonly, disabled to removeAttr if set to falsey

+ Removed all attrs from attrFix, these aren't needed for setAttribute

+ If prop is used for class, do we want a propFix for class?

  - We could just assume the user should know to use className with prop.  I've done the latter for now.

+ Created tests for $.fn.prop and $.fn.removeProp

  - Actually all I did was change broken attr tests to prop where it made sense.
2011-04-03 19:13:38 -04:00
jeresig ab4e300919 Very crude first pass at splitting apart the attr/prop logic. Also adding in attrHooks/propHooks. All of it is completely untested. 2011-04-03 19:13:38 -04:00
John Resig fcc112f406 Updating the source version to 1.6pre. 2011-03-31 15:28:33 -04:00
John Resig a507f719ab Tagging the 1.5.2 release. 2011-03-31 15:28:23 -04:00
Dave Methvin ff06d411d2 Merge branch 'bug_8316' of https://github.com/timmywil/jquery into timmywil-bug_8316 2011-03-31 10:25:59 -04:00
Dave Methvin 459bd7f89d Followup commit for #7340 test case; make sure second test fires properly on IE by focusing to another element rather than blurring off the first. 2011-03-31 09:10:30 -04:00
timmywil f9cc5597a4 Fix test cases for bug #8316 fix.
- Removed special page, just needed another test in the fixed offset tests

- Checks it's position related to scrolling
2011-03-31 02:55:16 -04:00
Dave Methvin 6c28a394c2 Remove crossDomain:null comment, it's not needed since undefined==null below. 2011-03-30 21:59:38 -04:00
Dave Methvin adbe5e95f3 Merge branch 'crossDomain' of https://github.com/JessThrysoee/jquery into JessThrysoee-crossDomain 2011-03-30 21:52:04 -04:00
Dave Methvin ad4152709c Fixes #8203. Remove some misguided nulling of elements done in the name of IE memory cleanup. Based on a patch by davidmurdoch in pull 226. 2011-03-30 21:21:49 -04:00