Commit Graph

104 Commits

Author SHA1 Message Date
Oleg Gaidarenko
59fa7924c7 Revert "Data: always camelCase keys in .data()"
This reverts commit 0204c3089e.
2015-12-22 16:41:49 +03:00
Oleg Gaidarenko
4e0c67d6df Revert "Data: camelCasing should not ignore case"
This reverts commit cf16f860b0.
2015-12-22 16:24:23 +03:00
Richard Gibson
4503a61ff1 Tests: Provide equal() arguments in correct order (actual, expected)
Ref 224271982e
Ref f5bf9bc488

(cherry picked from commit d3d8d9751f)

Conflicts:
	test/unit/data.js
2015-09-08 16:30:17 -04:00
Oleg Gaidarenko
d8b7e7b0bd Tests: more style corrections
Provocated by jscs-dev/node-jscs@2de68c0

Ref c161eecce0
2015-09-08 04:26:33 +03:00
Oleg Gaidarenko
2f0cedc997 Tests: further improvements QUnit 2.0 migration
* Remove QUnit jshint globals
* Extend QUnit.assert methods
* Use assert.async instead of start/stop/done

Ref b930d14ce6
Ref c8d15a2f9f
2015-09-08 04:15:54 +03:00
Jason Bedard
0874096797 Tests: do not create data cache when fetching single property
(test cherry-picked from f5bf9bc488)
Refs gh-2554
2015-09-08 02:02:51 +02:00
Jason Bedard
bec2ba2312 Data: Don't expose jQuery.acceptData
jQuery.acceptData is an undocumented internal API that shouldn't be exposed.

(cherry-picked from 224271982e)

Fixes gh-2555
2015-09-08 01:32:46 +02:00
Oleg Gaidarenko
4543815eed Tests: Partially use new qunit interface
http://qunitjs.com/upgrade-guide-2.x/

For most of the boring work was used
https://github.com/apsdehal/qunit-migrate package

However, it can't update local qunit helpers, plus in some places
old QUnit.asyncTest signature is still used

Ref b930d14ce6
Fixes gh-2540
2015-09-07 20:14:59 +03:00
Oleg Gaidarenko
20ddbe4f59 Build: Update jscs and lint files
Ref 10fdad742a
Fixes gh-2056
2015-09-07 20:14:50 +03:00
Oleg Gaidarenko
b8b111e337 Tests: don't use deprecated argument in test declaration
Ref aabe94edb4
2015-07-30 20:48:26 +03:00
Timmy Willison
cf16f860b0 Data: camelCasing should not ignore case
Fixes gh-2070
2015-05-04 10:49:52 -04:00
Timmy Willison
0204c3089e 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:41:44 -04:00
Timmy Willison
a254f22d7b Data: do not include digits when camelCasing
Fixes gh-1751
2015-05-04 10:41:43 -04:00
Michał Gołębiowski
19c0377fcc Core: Update tested jsdom, drop obsolete workarounds
The latest version supporting Node.js is 3.1.2; some workarounds are not needed
for this version. For example, in jsdom 3.1.2 a document created via
document.implementation.createHTMLDocument( "" ) has a body.

(partially cherry-picked from 95c0a10e15)

Fixes gh-2153
Closes gh-2154
2015-03-25 23:14:23 +01:00
Michał Gołębiowski
4e3c48f239 Data: Use a PDF object instead of a Java applet for acceptData testing
This should fix "Java out of date" errors on BrowserStack.

(cherry-picked from 087d280ad1)

Fixes gh-1938
Closes gh-2028
2015-01-29 04:44:41 +01:00
Jason Bedard
9d1d90e7a2 Data: use removeAttribute in cleanData to bypass Chrome bug
Related:
https://code.google.com/p/chromium/issues/detail?id=378607

Fixes gh-1664
2014-12-10 11:47:54 -05:00
Richard Gibson
f6f8848fbe Tests: Minor updates for QUnit 1.16 compatibility
More to come later.
2014-12-05 12:32:49 -05:00
Oleg Gaidarenko
3f9fda8fab Build: Fix various typos
Thanks @jamesgpearce, @imyousuf
Ref dc4b914a05
2014-11-08 17:43:27 +01:00
Dave Methvin
062a7d63e4 Data: Work around IE11 bug with onpageshow attribute
Fixes #14894
(cherry picked from commit b8133e282c)

Conflicts:
	src/data.js
	test/unit/data.js
2014-04-30 11:00:14 -04:00
Richard Gibson
ba2a8fb01e Ref c66a5e70: Synchronize unit tests with master 2013-11-07 11:59:56 -05:00
Richard Gibson
126d596b56 Fix #14074: element id="nodeName". Close gh-1389. 2013-11-07 11:37:52 -05:00
Corey Frang
075763b71a Fix #14101: $().data() should be undefined, not null
- Backported 30eee925db for 1.x
2013-11-06 11:07:52 -05:00
Richard Gibson
d8576139c1 Fix #14459: Use jQuery.parseJSON instead of JSON.parse
(cherry picked from commit ced9d155f0)
2013-10-28 11:39:43 -04:00
Ronny Springer
aa70819598 Ref 2263134b: Better identify potential JSON. Close gh-1401.
(cherry picked from commit 083edd60a6)

Conflicts:

	src/data.js
2013-10-16 08:50:13 -04:00
Timmy Willison
217cbb7109 AMD-ify jQuery sourcegit s! Woo! Fixes #14113, #14163.
Conflicts:
	Gruntfile.js
	README.md
	src/ajax.js
	src/ajax/xhr.js
	src/attributes.js
	src/core.js
	src/css.js
	src/data.js
	src/effects.js
	src/event.js
	src/manipulation.js
	src/offset.js
	src/selector-native.js
	src/traversing.js
	test/unit/core.js
	test/unit/data.js
2013-08-15 15:49:49 -04:00
Timmy Willison
d2435ead36 Update jshintrc to conform to new style guide. Conform to onevar and unused in tests. Fixes #13755.
Conflicts:
	src/.jshintrc
	src/data.js
	test/unit/attributes.js
	test/unit/core.js
	test/unit/data.js
	test/unit/event.js
	test/unit/manipulation.js
	test/unit/queue.js
	test/unit/traversing.js
	test/unit/wrap.js
2013-04-09 12:21:54 -04:00
Michał Gołębiowski
8594decfcc Ref #13554: Move redundant methods to event-alias.js. Close gh-1225.
(cherry picked from commits 8ca9f931ec 84a94acae1 100d3c3516)
2013-04-07 00:48:58 -04:00
danilsomsikov
8f72967ee2 Fix #8335: Avoid memory leak by never setting data on non-element non-document nodes. Ref gh-1127.
(cherry picked from commit cc324abf73)
2013-01-16 14:39:53 -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
Andy Monat
dc337f628c Fix #11435. Remove obsolete test code. 2012-04-04 21:38:47 -04:00
Sindre Sorhus
96bb57d4ef Fix #11309. Recognize hexadecimal in data attributes. 2012-02-09 20:27:27 -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
Mike Sherov
f35ba5e699 Fix #10691. Remove all instances of equals() and same(), as these are deprecated in QUnit. 2011-11-06 15:27:42 -05:00
Corey Frang
9b3768b968 Landing pull request 512. 1.7 - removeData now takes space separated lists and arrays of keys - Fixes #7323.
More Details:
 - https://github.com/jquery/jquery/pull/512
 - http://bugs.jquery.com/ticket/7323
2011-09-19 21:16:20 -04:00
Corey Frang
2831cfd072 Landing pull request 503. 1.7 data: set a flag in the private data cache to avoid having to scan attributes multiple times - Fixes #8909.
More Details:
 - https://github.com/jquery/jquery/pull/503
 - http://bugs.jquery.com/ticket/8909
2011-09-19 16:13:57 -04:00
Corey Frang
d5f144a7bb Landing pull request 500. 1.7 - "public data" stored as a key on "internal data" - Fixes #8921.
More Details:
 - https://github.com/jquery/jquery/pull/500
 - http://bugs.jquery.com/ticket/8921
2011-09-19 16:13:14 -04:00
rwldrn
8e8fa6dc1a Bug in rmultidash. Fixes #10194 2011-09-07 10:13:22 -04:00
rwldrn
93beee8ac0 Test for window inference. Fixes #10080 2011-08-18 10:17:12 -04:00