Commit Graph

113 Commits

Author SHA1 Message Date
Timmy Willison
56bb677725 Data: remove the expando when there's no more data
Fixes gh-1760
Close gh-2271
2015-05-12 10:09:40 -04:00
Timmy Willison
172cad80ac Data: camelCasing should not ignore case
Fixes gh-2070
2015-05-04 10:49:21 -04:00
Timmy Willison
0e790985a7 Data: always camelCase keys in .data()
- This effectively implements our "Embrace HTML5" option
- Related: http://goo.gl/GcQAtn

Fixes gh-2257
2015-05-04 10:27:30 -04:00
Timmy Willison
2862a07af6 Data: do not include digits when camelCasing
Fixes gh-1751
2015-05-03 08:25:19 -04:00
Michał Gołębiowski
95c0a10e15 Data: Drop the tests relying on applets
BrowserStack regularly has outdated Java in their IE instances causing our
data tests to hang & give no output. Skip the tests that create applets,
applets are treated in the same way as an embed elements which we're already
testing.

Fixes gh-1938
Closes gh-2166
2015-03-25 23:01:57 +01:00
Michał Gołębiowski
087d280ad1 Data: Use a PDF object instead of a Java applet for acceptData testing
This should fix "Java out of date" errors on BrowserStack.

Fixes gh-1938
Closes gh-2028
2015-01-29 04:33:28 +01:00
Richard Gibson
26276a307c Tests: Minor updates for QUnit 1.16 compatibility
More to come later.

(cherry picked from commit f6f8848fbe)
2014-12-05 12:34:17 -05:00
Oleg Gaidarenko
dc4b914a05 Build: Fix various typos
Thanks @jamesgpearce, @vlajos, @imyousuf
Closes gh-1828
Closes gh-1830
Closes gh-1844
2014-11-08 17:24:33 +03:00
Dave Methvin
b8133e282c Data: Work around IE11 bug with onpageshow attribute
Fixes #14894
2014-04-30 10:46:26 -04:00
Richard Gibson
c66a5e70f2 Fix #14074: element id="nodeName". Close gh-1389.
(cherry picked from commit 126d596b56)

Conflicts:

	src/data.js
	src/data/accepts.js
	test/unit/core.js
	test/unit/data.js
2013-11-07 11:57:41 -05:00
Corey Frang
30eee925db Fix #14101: $().data() should be undefined, not null 2013-11-06 10:25:12 -05:00
Richard Gibson
ced9d155f0 Fix #14459: Use jQuery.parseJSON instead of JSON.parse 2013-10-28 11:35:53 -04:00
Ronny Springer
083edd60a6 Ref 2263134b: Better identify potential JSON. Close gh-1401. 2013-10-16 08:46:45 -04:00
Timmy Willison
6318ae6ab9 AMD-ify jQuery sourcegit s! Woo! Fixes #14113, #14163. 2013-08-15 14:15:49 -04:00
Rick Waldron
147726af12 Fixes #14047 jQuery.data should not miss data-* w/ hyphenated property names
http://bugs.jquery.com/ticket/14047
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
2013-06-24 12:23:12 -04:00
Rick Waldron
2406b5e290 Fixes #13850. Better removal of hyphenated data property names.
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
2013-05-02 16:35:22 -04:00
Corey Frang
55e319aa52 Fixes #13815: Ensure each element has its own private data object - Tests by @rwldrn 2013-04-24 17:09:30 -04:00
Timmy Willison
0fa52c11cb Update jshintrc to conform to new style guide. Conform to onevar and unused in tests. Fixes #13755. 2013-04-09 11:59:31 -04:00
Michał Gołębiowski
52394ba986 Move size() test to deprecated.js and avoid in other tests. Close gh-1237. 2013-04-08 20:38:20 -04:00
Oleg Gaidarenko
f61314ff5c Fixes #8335. Do not allow add data to non-elements (2.x). Closes gh-1232 2013-04-08 15:10:39 -04:00
Rick Waldron
c44f07916d Removes unnecessary "object/applet" element test from data tests.
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
2013-04-07 21:11:09 -04:00
Rick Waldron
332a490573 Avoid side-effects when calling jQuery.hasData
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
2013-04-01 12:48:30 -04:00
Michał Gołębiowski
8ca9f931ec bind/unbind changed to on/off in unit tests; refs #13554 2013-03-25 22:06:49 -04:00
stonelee
f2cb536127 Fix typos, close gh-1187. 2013-03-25 21:58:47 -04:00
Rick Waldron
49abe3dc92 Make data test titles more consistent and accurate
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
2013-03-03 19:41:01 -05:00
Rick Waldron
692afbcc5f Fixes #13551. Guard against illegal data access by undefined elem-owner
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
2013-03-03 19:40:33 -05:00
Rick Waldron
9bf8b040d3 test/unit/data.js style nits
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
2013-03-02 13:07:07 -05:00
Michał Gołębiowski
761b96c301 Fixes #13550. .data should not miss attr() set data-* with hyphenated property names. Closes gh-1189 2013-03-02 13:04:48 -05:00
Rick Waldron
3212a29369 Fixes #13548. .data should not miss attr() set data-* with hyphenated property names 2013-03-01 19:02:57 -05:00
Rick Waldron
38bc968052 Old acceptData tests refactored and adapted to support new data system 2013-02-28 14:14:40 -05:00
Rick Waldron
93043d002a Refactor: Data.prototype.access. Thanks to @RubyLouvre and @gibson042. Closes #1167 2013-02-13 12:14:20 -05:00
Rick Waldron
1d5d959ee0 Optimized Data rewrite 2013-02-11 12:39:44 -05:00
Rick Waldron
7f94a5cc3a 2.0: Rewrite data.js (Incl. event, manipulation, tests) 2013-02-03 15:27:55 -05:00
danilsomsikov
cc324abf73 Fix #8335: Avoid memory leak by never setting data on non-element non-document nodes. Close gh-1127. 2013-01-16 14:31:29 -05:00
Dave Methvin
11e6a66002 Remove deleteExpando detect. 2013-01-03 20:55:52 -05:00
Dave Methvin
445dbd9d95 Revert data.js rewrite.
Reverts the following commits:

commit f717226b3a
Author: Rick Waldron <waldron.rick@gmail.com>
Date:   Mon Dec 31 18:06:38 2012 -0500

Only splice from internal arrays when item actually exists.

commit b9cdc4136b
Author: Rick Waldron <waldron.rick@gmail.com>
Date:   Mon Dec 31 16:20:35 2012 -0500

Updates to data.js re-write to pass events and manipulation

commit d1de3000c6
Author: Rick Waldron <waldron.rick@gmail.com>
Date:   Mon Dec 31 15:09:45 2012 -0500

2.0: Rewrite data.js
2013-01-03 20:43:01 -05:00
Rick Waldron
d1de3000c6 2.0: Rewrite data.js
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
2012-12-31 16:23:20 -05:00
Richard Gibson
0ee9415902 Restore jQuery.access parameter mistakenly removed in 80d45a69 2012-11-06 09:53:00 -05:00
Dave Methvin
e8cf41a051 Fix #10544. Remove deprecated .data() event namespaced triggering.
Data events were horribly slow, never documented, and caused strange interpretation of data items with dots in them.
2012-10-31 21:27:42 -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
Rick Waldron
4f0e1e7c65 Simplify tests for #12786, reduce to only those required to support the fix 2012-10-25 10:50:57 -04:00
Rick Waldron
63d72536ba Less deep and more strict. 2012-10-25 10:32:30 -04:00
Rick Waldron
a7158fac17 Remove .hyphen property from tests (left behind in refactoring) 2012-10-24 16:47:40 -04:00
Rick Waldron
812c6087ad Brute force property removal when removeData([a,b,c]). Fixes #12786
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
2012-10-24 14:12:28 -04:00
carldanley
08e134548f Create private methods for processing data/removeData requests. Fixes #12519, Closes gh-976 2012-10-16 11:15:41 -04:00
Mike Sherov
ed9e34482a enforce double quotes via JSHint. Closes gh-975 2012-10-16 10:17:14 -04:00
Dave Methvin
2263134b22 Fix #10863. Allow newlines in JSON data- attributes. 2012-08-23 22:19:06 -04:00
Dave Methvin
ce15bd7d0c Fix #7579. Don't convert to number if it changes the string. Close gh-852.
Net effect here is that hex numbers and most exponential-format numbers or long sequences of digits will remain strings rather than being coerced to numbers. `The people have spoken.
2012-07-25 10:28:50 -04:00
Chad Killingsworth
de9bed319e Make unit tests friendly to Closure Compiler. Closes gh-845.
Conflicts:
    	test/unit/effects.js
    	test/unit/offset.js
2012-07-05 15:52:42 -04:00
Rick Waldron
7ff3da186c Unit tests are linted and passing. 2012-06-21 15:30:24 -04:00