Commit Graph

209 Commits

Author SHA1 Message Date
Richard Gibson
80d45a69ea Fix #12840: remove undocumented parameter "pass" from .attr. Close gh-1017. 2012-11-05 17:21:24 -05:00
Dave Methvin
240b141a22 Fix #10299. Add a propHook for oldIE link href. 2012-11-01 20:50:45 -04:00
Timo Tijhof
36c9ecb0f5 Implement expectation test instead of using _removeData. Close gh-997.
* Removed inline usage of QUnit.reset() because it is messing with the
  expectation model as reset does .empty() which does a recursive cleanData
  on everything in #qunit-fixture, so any expectJqData above .reset() would
  fail negatively.

  Instead of calling reset inline, either updated the following assertions to
  take previous assertions' state into account, or broke the test() up into
  2 tests at the point where it would call QUnit.reset.

* After introducing the new memory leak discovery a whole bunch of tests were
  failing as they didn't clean up everything. However I didn't (yet) add
  QUnit.expectJqData calls all over the place because in most if not all of
  these cases it is valid data storage. For example in test "data()", there
  will be an internal data key for "parsedAttrs". This particular test isn't
  intending to test for memory leaks, so therefor I made the new discovery
  system only push failures when the test contains at least 1 call to
  QUnit.expectJqData.

  When not, we'll assume that whatever data is being stored is acceptable
  because the relevant elements still exist in the DOM anyway (QUnit.reset
  will remove the elements and clean up the data automatically).

  I did add a "Always check jQuery.data" mode in the test suite that will
  trigger it everywhere. Maybe one day we'll include a call to everywhere,
  but for now I'm keeping the status quo: Only consider data left in storage
  to be a problem if the test says so ("opt-in").

* Had to move #fx-tests inside the fixture because ".remove()" test would
  otherwise remove stuff permanently and cause random other tests to fail
  as "#hide div" would yield an empty collection.
  (Why wasn't this in the fixture in the first place?)

  As a result moving fx-tests into the fixture a whole bunch of tests failed
  that relied on arbitrary stuff about the document-wide or fixture-wide
  state (e.g. number of divs etc.). So I had to adjust various tests to
  limit their sample data to not be so variable and unlimited...

* Moved out tests for expando cleanup into a separate test.

* Fixed implied global variable 'pass' in effects.js that was causing
  "TypeError: boolean is not a function" in *UNRELATED* dimensions.js that
  uses a global variable "pass = function () {};" ...

* Removed spurious calls to _removeData. The new test exposed various failures
  e.g. where div[0] isn't being assigned any data anyway.
  (queue.js and attributes.js toggleClass).

* Removed spurious clean up at the bottom of test() functions that are
  already covered by the teardown (calling QUnit.reset or removeClass to
  supposedly undo any changes).

* Documented the parentheses-less magic line in toggleClass. It appeared that
  it would always keep the current class name if there was any (since the
  assignment started with "this.className || ...".

  Adding parentheses + spacing is 8 bytes (though only 1 in gzip apparently).
  Only added the comment for now, though I prefer clarity with logical
  operators, I'd rather not face the yayMinPD[1] in this test-related commit.

* Updated QUnit urlConfig to the new format (raw string is deprecated).

* Clean up odd htmlentities in test titles, QUnit escapes this.
  (^\s+test\(.*)(&gt\;) → $1>
  (^\s+test\(.*)(&lt\;) → $1<

[1] jQuery MinJsGz Release Police Department (do the same, download less)
2012-10-28 22:44:57 -04:00
Timmy Willison
2eff7fe72d Sizzle: remove unneeded vars and POS regex (-22 bytes) 2012-10-24 10:35:08 -04:00
Matthias Jäggli
227c49a459 Fix #12411, .removeClass(undefined) is a chaining no-op. Close gh-913.
.removeClass() //removes all classes, as documented
.removeClass(window.nonExistentVariable) // removes nothing
2012-10-21 21:06:41 -04:00
Sai Wong
2b0e720406 Fix #12048. Set attributes for XML fragments. Close gh-965. 2012-10-20 15:27:43 -04:00
Akintayo Akinwunmi
78617f067a Moved attrFN to deprecated. Close gh-977. 2012-10-16 10:01:18 -04:00
Richard Gibson
425d17de83 Fix #12583: Don't ignore disabled property of select-one, close gh-932. 2012-10-03 21:14:08 -04:00
Richard Gibson
15b5dbfe23 Fix #12229, size/consistency improvements. Close gh-887. 2012-09-18 18:04:31 -04:00
Dave Methvin
37e8b44884 Add back a sacrificial $.attrFn object.
Originally removed in 86b775d036 as part of the enhancement that allows $(html, props) to use any $.fn method.

Although $.attrFn is undocumented it appears to be a poorly kept secret. jQuery Mobile 1.1 is using it and it's the topic of several blog/StackOverflow posts. Leave an empty object here as a dumpster for now, but it's coming out for good in 1.9.
2012-08-07 13:45:47 -04:00
Richard Gibson
c14a6b385f Clean up regexen; use common regex for numbers. Close gh-862. 2012-07-22 22:23:32 -04:00
Dave Methvin
c29660c593 Revert "Fix #11397. Shush Firefox warning by re-breaking #6932 for BB 4.7."
This reverts commit e866893fd2.

Failures in IE6 when this is removed, unfortunately.
2012-07-12 15:28:58 -04:00
Dave Methvin
e866893fd2 Fix #11397. Shush Firefox warning by re-breaking #6932 for BB 4.7.
At this point BlackBerry 4.7 (and related ancient browsers) should be scarce (released circa 2008) so #6932 will be closed wontfix for this edge case.
2012-07-12 15:10:58 -04:00
Dave Methvin
f4e5c1729a Fix #11547. toLowerCase not work good on XML attributes.
This was fixed to some extent in gh-724 but there were insufficient test cases. Removing the lowercase completely allows IE 6/7 to work properly since there you need an exact case match for attributes, even in HTML docs. More discussion and test cases in the comments on gh-724.
2012-07-11 23:09:07 -04:00
Chris Faulkner
7b5ffcdac8 Fixes a variety of typographical problems. Closes gh-853 2012-07-11 09:46:21 -04:00
Mike Sherov
8f01b92b8f Follow the style guide, lose 72 bytes! Closes gh-840. 2012-07-09 21:39:22 -04:00
Dave Methvin
cdd5132dcc Fix #12026. Let props in $(html, props) be any jQuery.fn method.
Closes gh-839.
2012-07-05 17:21:58 -04:00
timmywil
b414fe1b01 Use value rather than nodeValue in attributes (it's the string version). Update sizzle: default attribute handling. 2012-07-02 21:35:00 -04:00
Rick Waldron
3206be8772 Make removeClass smart enough to remove duplicates. Fixes #11923 2012-06-23 19:38:27 -04:00
Richard Gibson
a101e81bde Interim take on cross-module variables, closes gh-817. 2012-06-15 21:01:44 -04:00
Rick Waldron
7c23b77af2 Strips IIFEs from modules; Always require built jQuery for tests. 2012-06-04 12:48:18 -04:00
timmywil
3e2a77c5e8 Remove the tabindex attrHook. Fixes #8473 2012-05-30 13:46:50 -04:00
Arne de Bree
0e2642d216 Fix 11547. XML and IE DOM can't be force-lowercase in removeAttr().
See discussion on pull request: https://github.com/jquery/jquery/pull/724
2012-04-10 18:25:04 -04:00
timmywil
d3320462df Do not set boolean attributes to empty string on removal. Fixes #10870. +0 bytes compressed 2012-03-05 12:54:44 -05:00
Mathias Bynens
2803a5e6f2 Fix #11316. Find valHooks first by element type, then by nodeName.
Reverses the previous search order.
2012-03-02 13:28:27 -05:00
Mike Sherov
da02e190b5 Fixes #10828, .attr("coords") returns undefined in IE7 2012-03-02 11:08:52 -05:00
Richard Gibson
6c2a501de4 Fix #5571. Setters should treat undefined as a no-op and be chainable. 2011-12-06 15:25:38 -05:00
timmywil
20cbf1b123 Microoptimization in jQuery.attr and remove the redundancy of return undefined 2011-11-14 12:31:28 -05:00
Rick Waldron
a8460d24e0 Landing pull request 600. Remove jQuery.trim() to restore perf. Supplements #10773.
More Details:
 - https://github.com/jquery/jquery/pull/600
 - http://bugs.jquery.com/ticket/10773
2011-11-14 12:24:58 -05:00
Oleg
a467aa0a77 Fix #10773. Improve parameter handling in removeAttr. 2011-11-14 11:30:53 -05:00
Rick Waldron
9ea21faf8f Cleanup spacing in attributes.js. Fixes #10601 2011-10-27 15:28:14 -04:00
timmywil
c51b29477e Support setting both the enctype attribute and property (encoding in IE6/7). Fixes #6743. 2011-10-22 16:03:57 -04:00
timmywil
f2c1d2e016 Use the property name in elem.removeAttribute in IE6/7 to ensure correct removals. Fixes #10514. 2011-10-17 16:45:37 -04:00
timmywil
ce8d9c0ca5 Add a hook for removing contenteditable in IE6/7 and remove the unnecessary jQuery.attrFix. Fixes #10429. 2011-10-06 17:17:51 -04:00
Rick Waldron
ca4133cc3f Landing pull request 492. 1.7 Remove multiple attributes (Symmetry with removeClass) Combines patches submitted by leeoniya, zertosh and my own tests. Fixes #5479.
More Details:
 - https://github.com/jquery/jquery/pull/492
 - http://bugs.jquery.com/ticket/5479
2011-09-19 21:07:07 -04:00
Rick Waldron
af1dc64bee Landing pull request 510. Add notes about #9699 fix.
More Details:
 - https://github.com/jquery/jquery/pull/510
 - http://bugs.jquery.com/ticket/9699
2011-09-19 15:54:07 -04:00
timmywil
daeb665045 Check for property support in the boolHook before falling back to attribute node. Fixes #10278. 2011-09-19 15:42:32 -04:00
timmywil
92405d4f5f Override Sizzle attribute retrieval with jQuery.attr. Fixes #5637, #7128, #9261, #9570, #10178.
Bug fixed on the side: $(window).is('a') was throwing an exception. Fixes #10178.
2011-09-19 15:42:30 -04:00
Rick Waldron
bc65f930b5 Fixes typo 2011-09-19 09:41:55 -04:00
Rick Waldron
6174612daa Add notes about #9699 fix 2011-09-18 20:15:35 -04:00
Rick Waldron
7856230f67 Removes whitespace junk 2011-09-18 20:15:18 -04:00
timmywil
d723942b27 Revert back to always setting the attribute to empty string before removal. Fixes #9699. 2011-08-25 15:33:54 -04:00
timmywil
700c16b085 Remove unnecessary regex 2011-08-04 18:16:15 -04:00
timmywil
8c2cb49917 Now using getAttributeNode in all attribute cases in IE6/7, which normalizes attribute behaviors across browsers, is less hacky, and shortens the attribute code. Fixes #9980. 2011-08-04 18:16:15 -04:00
timmywil
fd4ee2a397 Make the tabIndex hook first a propHook and add it to attrHooks for back-compat reasons. Fixes #9979. 2011-08-04 18:16:15 -04:00
Dave Methvin
6a3395afcd Merge pull request #419 from rwldrn/9630
Unit tests assert that .contents().hasClass() works as expected. Fixes #9630
2011-08-04 14:33:52 -07:00
timmywil
1886d74434 Check the attribute node value for false for HTML5 booleans when not supported. Fixes #9504. 2011-07-09 14:52:16 -04:00
rwldrn
bb1702518e Filter hasClass by nodeType 1; Fixes #9630 2011-06-22 08:50:44 -04:00
timmywil
96501d38a9 Allow similarly named classes (regression from 9499) and switch class retrieval to property when passing class to value functions. Fixes #9617. 2011-06-19 18:58:47 -04:00
timmywil
641ad80211 Attribute hooks do not need to be attached in XML docs. Fixes #9568. 2011-06-13 10:02:13 -04:00