Commit Graph

90 Commits

Author SHA1 Message Date
Timmy Willison
bcd40aa7a3
Dimensions: Modify reliableTrDimensions support test to account for FF
Firefox incorrectly (or perhaps correctly) includes table borders in computed
dimensions, but they are the only one. Workaround this by testing for it and
falling back to offset properties

Fixes gh-4529
Closes gh-4807
2021-01-11 11:56:38 -05:00
Michał Gołębiowski-Owczarek
1d61fd9407 Manipulation: Make jQuery.htmlPrefilter an identity function
Closes gh-4642

(cherry picked from 90fed4b453)
2020-03-16 21:59:49 +01:00
Michał Gołębiowski-Owczarek
c79e1d5fef
Tests: Skip a "width/height on a table row with phantom borders" test in Firefox
Firefox 70 & newer fail this test but the issue there is more profound - Firefox
doesn't subtract borders from table row computed widths.

Closes gh-4537
Ref jquery/jquery#4529
Ref https://bugzilla.mozilla.org/show_bug.cgi?id=1590837
Ref w3c/csswg-drafts#4444
2019-10-28 20:38:33 +01:00
Michał Gołębiowski-Owczarek
a2a73db99c
Tests: Make Android Browser 4.0-4.3 dimensions tests green
Android Browser disregards td's box-sizing, treating it like it was content-box.
Unlike in IE, offsetHeight shares the same issue so there's no easy way to
workaround the issue without incurring high size penalty. Let's at least check
we get the size as the browser sees it.

Also, fix the nearby support comment syntax.

Closes gh-4335
2019-03-27 15:47:33 +01:00
Michał Gołębiowski-Owczarek
a0abd15b9e
CSS: Avoid forcing a reflow in width/height getters unless necessary
Fixes gh-4322
Closes gh-4325
Ref gh-3991
Ref gh-4010
Ref gh-4185
Ref gh-4187
2019-03-18 18:44:43 +01:00
abnud1
c349818742 Build: Update test code for compatibility with QUnit 2.x (#4297)
Also, run `grunt npmcopy` to sync the "external" directory with dependencies
from package.json. For example, the Sinon library version didn't match.

Ref gh-4234
Closes gh-4297
2019-02-18 19:03:26 +01:00
Timmy Willison
13f3cd1611
Tests: fix dimensions tests in testswarm
Close gh-4248
2018-12-03 12:03:04 -05:00
Timmy Willison
315199c156
Dimensions: fall back to offsetWidth/Height for border-box in IE
- Use getClientRects() to explicitly detect hidden/disconnected
  elements

Close gh-4223
Fixes gh-4102
2018-11-27 14:28:59 -05:00
Jason Bedard
6153eb0fd4
Tests: use width style instead of SVG width attribute (#4157)
The SVG width attribute seems to not support border-box in iOS7.

Closes gh-4155
2018-08-20 21:13:33 -07:00
Jason Bedard
e743cbd285
Dimensions: fix computing outerWidth on SVGs
Fixes gh-3964
Closes gh-4096
2018-06-20 22:09:29 -07:00
Richard Gibson
3cf1d14ccc Dimensions: Don't trust non-pixel computed width/height
Fixes gh-3611
Closes gh-3741
2017-08-07 12:26:03 -04:00
Richard Gibson
a49578499e Dimensions: Improve offsetWidth/offsetHeight fallback
Fixes gh-3698
Fixes gh-3602
Closes gh-3738
2017-07-31 12:36:54 -04:00
Richard Gibson
20cdf4e7de Support: Properly check for IE9 absolute scrollbox mishandling
Ref gh-3589
Fixes gh-3699
Fixes gh-3730
Closes gh-3729
2017-07-18 15:40:41 -04:00
Richard Gibson
3fcddd6e72 Dimensions: Detect and account for content-box dimension mishandling
Fixes gh-3699
Closes gh-3700
2017-07-10 12:35:03 -04:00
Richard Gibson
80f1c8239e Dimensions: Include scroll gutter in "padding" box
Fixes gh-3589
Closes gh-3656
2017-06-19 15:42:55 -04:00
Michał Gołębiowski
731c501155 Docs:Tests: Update IE/Edge-related support comments & tests
Closes gh-3661
2017-05-15 20:37:14 +02:00
Timmy Willison
473d2ea7d5
Dimensions: fall back to offsetWidth/Height for inline elems
Close gh-3577
Fixes gh-3571
2017-03-20 12:16:12 -04:00
Timmy Willison
c920ff6e32
Dimensions: ignore transforms when retrieving width/height
Close gh-3561
Fixes gh-3193
2017-03-13 13:32:16 -04:00
Oleg Gaidarenko
58c6ca9822 Build: ESLint details
Use eslint pragmas, fix new errors, etc

Closes gh-3148
2016-06-11 10:41:33 +03:00
Dave Methvin
e5ffcb0838 Tests: Refactor testIframe() to make it DRYer and more consistent
Ref gh-3040
Closes gh-3049
2016-04-11 13:32:51 -04:00
Dave Methvin
08d73d7f9c Tests: Make iframe tests wait after checking isReady
Ref gh-3040
2016-04-11 13:29:11 -04:00
Michał Gołębiowski
9b086888b8 Docs:Tests: Remove obsolete code from tests, update support comments
Support comments that were lacking the final IE/Edge version that exhibits
the bug were checked & updated. Links to the Chromium bug tracker were updated.
Code in tests related to unsupported browsers (like Android 2.3 in non-basic
tests) has been removed.

Fixes gh-2868
Closes gh-2949
2016-03-08 23:26:46 +01:00
Vitaliy Terziev
f00dd0f0b2 Dimensions: Add tests for negative borders & paddings
Closes gh-2869
2016-02-24 14:27:19 +01:00
Oleg Gaidarenko
fc50791469 Tests: use jQuery variable instead of $
For some reason that works with `amd` but not with builded version

Fixes gh-2909
2016-02-13 21:22:15 +03:00
Oleg Gaidarenko
a2f63ffd96 Tests: test element position outside view
Ref 49833f7795
Ref gh-2828
Ref gh-2836
Fixes gh-2909
2016-02-11 22:59:09 +03:00
Dave Methvin
97d79ecf6b Dimensions: Empty sets should return undefined
Ref gh-2319
Closes gh-2701
2015-11-10 09:59:48 -05:00
Timmy Willison
75b3cdd509 Dimensions: properly manipulate non-px values
Fixes gh-1712
Close gh-2695
2015-11-09 17:38:00 -05:00
Dave Methvin
7d44d7f9e7 Dimensions: outerWidth/Height include scrollbar
Fixes gh-1729
Closes gh-2694
2015-11-07 15:13:31 -05:00
Richard Gibson
f931786018 Tests: Post-Summit cleanup
Ref 67d7a2eefe
Ref c752a5030b
2015-10-25 15:25:56 -04:00
Dave Methvin
67d7a2eefe CSS: Make show/hide/toggle methods a module
Unit test changes some uses of .show() and .hide() to .css( "display", ... ),
there was already an implicit assumption in several of the existing tests.

Fixes gh-2193
Close gh-2648
2015-10-18 12:30:00 -04:00
Oleg Gaidarenko
c8d15a2f9f 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
2015-09-08 04:06:20 +03:00
Oleg Gaidarenko
10fdad742a Build: Update jscs and lint files
Fixes gh-2056
2015-09-07 20:03:50 +03:00
Oleg Gaidarenko
b930d14ce6 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

Fixes gh-2540
2015-08-16 09:02:01 +03:00
Oleg Gaidarenko
aabe94edb4 Tests: don't use deprecated argument in test declaration
Closes gh-2507
2015-07-30 20:46:31 +03:00
Michał Gołębiowski
b60b26e184 CSS: Make .css("width") & .css("height") return fractional values
Fixes gh-1724
Closes gh-2439
2015-07-07 18:09:45 +02:00
Michał Gołębiowski
62ae2d0fb7 Offset: Round offset value for the sake of floating errors
IE10+ may return not exactly the offset.top value set in an offset callback
if parent has fractional top offset itself. Checking for being close to the
desired result fixes the test error.

Fixes gh-2147
2015-03-23 18:14:37 +01:00
Richard Gibson
906caebb3f Tests: Tilt at a few style guide windmills
Ref 3c13f4c629
2014-12-06 13:30:31 -05:00
Richard Gibson
3c13f4c629 Tests: Accommodate page changes from the QUnit HTML reporter
Ref 6748ba3496
2014-12-06 13:23:40 -05: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
f7e60dc83d Dimensions: allow modification of coordinates argument
Fixes gh-1848
Closes gh-1853
2014-11-16 18:05:29 +03:00
Michał Gołębiowski
740e190223 Misc: Drop support for older browsers; update support comments
That includes Opera 12.x, Firefox<29, Safari<6.0 and some hacks
for old Blackberry.

Closes gh-1820
Refs gh-1815
2014-11-03 18:37:26 +01:00
Michał Gołębiowski
79f59c2144 Support: Document box-sizing was unprefixed in Firefox 29 2014-02-05 15:57:11 +01:00
Michał Gołębiowski
bbbdd94725 Fix #10814. Make support tests lazy and broken out to components. 2013-09-06 03:38:22 +02: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
dca7681284 Improve CSS and Support: comments. Close gh-1220.
1) corrected box-sizing rules order - the unprefixed value should always be the last one
2) removed last semi-colons in CSS rules
3) updated support comments

code review changes + more consistent comment spacing
2013-04-06 17:09:52 -04:00
dmitrygusev
eee2eaf1d7 Fix typos. Close gh-1186. 2013-02-28 15:45:10 -05:00
Richard Gibson
59f5adb622 No ticket: Revise unit tests in anticipation of Sizzle-free builds 2013-02-22 20:13:36 -05: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
fd5facf1d1 Convert all jQuery.removeData(foo, bar, true) calls to jQuery._remove(foo, bar)
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
2012-10-16 14:14:37 -04:00
Mike Sherov
670e3ff040 Fix #12243, $("col").width() should return the column's width. Close gh-916. 2012-08-29 12:34:12 -04:00