New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offset: Operate "relative to document" correctly #3096

Closed
wants to merge 6 commits into
base: master
from

Conversation

Projects
None yet
6 participants
@anseki

anseki commented May 1, 2016

Summary

Fix: .offset() doesn't operate "relative to document" correctly

Checklist

Mark an [x] for completed items, if you're not sure leave them unchecked and we can assist.

Thanks! Bots and humans will be around shortly to check it out.

Related to: #3080
Remove unnecessary code that subtracts
document.documentElement.clientTop/clientLeft (i.e. border-width of
<html>) from coordinates.
In Firefox, those are not subtracted because clientTop/clientLeft are
0 always by accidentally bug.

@mention-bot

This comment has been minimized.

mention-bot commented May 1, 2016

By analyzing the blame information on this pull request, we identified @NekR, @timmywil and @markelog to be potential reviewers

@jquerybot

This comment has been minimized.

jquerybot commented May 1, 2016

Thank you for your pull request. It looks like this may be your first contribution to a jQuery Foundation project, if so we need you to sign our Contributor License Agreement (CLA).

📝 Please visit http://contribute.jquery.org/CLA/ to sign.

After you signed, the PR is checked again automatically after a minute. If there's still an issue, please reply here to let us know.


If you've already signed our CLA, it's possible your git author information doesn't match your CLA signature (both your name and email have to match), for more information, check the status of your CLA check.

@jquerybot jquerybot added the CLA: Error label May 1, 2016

@anseki

This comment has been minimized.

anseki commented May 1, 2016

I don't know why "CLA:Error"... 😢
I already input and submitted on http://contribute.jquery.org/CLA/

Offset: Operate "relative to document" correctly
Related to: #3080
Remove unnecessary code that subtracts
`document.documentElement.clientTop/clientLeft` (i.e. `border-width` of
`<html>`) from coordinates.
In Firefox, those are not subtracted because `clientTop/clientLeft` are
`0` always by accidentally bug.
@gibson042

This comment has been minimized.

Member

gibson042 commented May 1, 2016

@anseki See http://contribute.jquery.org/CLA/status/?owner=jquery&repo=jquery&sha=359da5dd3b080c4c6367ec904fa9325a1d4f0305 . We ask for your real email address and real name (or consistently-used pseudonym), and require that the git commits match the CLA. Is "AnSeki" the best name for you to use for assigning contributions?

@anseki

This comment has been minimized.

anseki commented May 1, 2016

Thank you @gibson042.
Yes, I visited that page, and I changed private GitHub email address to my Gmail address by git config --global user.email.
And I tried:

git checkout offset-html-border
git commit --amend --reset-author
git push -f origin offset-html-border

What should I do?

@gibson042

This comment has been minimized.

Member

gibson042 commented May 1, 2016

The current exception is about the name field. Do you have a more "traditional" name, or is "AnSeki" the best descriptor for us?

@anseki

This comment has been minimized.

anseki commented May 1, 2016

I've been using this name anytime, and I hope use this.

Offset: Fix indention in test code
Fix: incorrect indention

@jquerybot jquerybot added CLA: Valid and removed CLA: Error labels May 1, 2016

for ( flags = 0;
flags <= ( FLAG_DOC_MARGIN | FLAG_DOC_BORDER | FLAG_DOC_PADDING | FLAG_BODY_MARGIN | FLAG_BODY_BORDER | FLAG_BODY_PADDING );
flags++ ) {

This comment has been minimized.

@gibson042

gibson042 May 1, 2016

Member

This is a very good start, but is a bit hard to read and hard to reason about. I now think every interesting case here can operate in a page with nonzero, non-pixel (to catch inappropriate parseFloats) values for all of margin, border, and padding on both <html> and <body>, with the only variation being position values for those two elements. You can achieve that by means of a single iframe fixture (setting position styles before making any other calls), but I would like them in distinct testIframe invocations (see effects.js for an example of such process-constructed QUnit.test input). The cases, and my observations of them, are as follows:

<html> position <body> position .offset origin
static static/relative/absolute/fixed document (i.e., outer edge of <html> margin)
relative/absolute/fixed static/relative/absolute/fixed inside <html> border

That's a total of 16 cases, each case with its own testIframe. I'm aware that <body> position doesn't actually seem to matter, but it's probably worth covering anyway.

This comment has been minimized.

@anseki

anseki May 2, 2016

Ok, I try to rewrite tests.
You said that situations() should be called in each case of that 16 cases. Is my interpretation correct?

Also, that 16 cases include two cases in current code "CASE 1" and "CASE 2".
Is "CASE 3" in current code unnecessary?
Or, should two cases marker1.style.position = "absolute" and marker1.style.position = "static" be tested in each case of that 16 cases? That is, situations() is called in each case of 2x16 cases.

@anseki

This comment has been minimized.

anseki commented May 2, 2016

It seems "CLA:Error" was solved by second commit. Thank you.

Offset: Add test cases
- Add more test cases of `position` variation of `<html>` and `<body>`.
- Do `testIframe()` in each case.
@anseki

This comment has been minimized.

anseki commented May 2, 2016

I added test cases, then

  • 256 cases: margin, border and padding of <html> and <body>
  • 16 cases: position of <html> and <body>
  • 2 cases: position:static and position:absolute of marker1

Total: 8192 cases

Also, I tried to change messages.
But, it might be hard to read still.

Offset: Add comment in test code
Add comment as information for tester who see the test code also when the
test failed.
FLAG_DOC_PADDING = 4,
FLAG_BODY_MARGIN = 8,
FLAG_BODY_BORDER = 16,
FLAG_BODY_PADDING = 32,

This comment has been minimized.

@gibson042

gibson042 May 2, 2016

Member

You said that situations() should be called in each case of that 16 cases. Is my interpretation correct?

Not exactly., I'm saying that situations and "CASE 1"/"CASE 2"/"CASE 3" should be removed in favor of a simpler approach. The testIframe callback shouldn't need to do too much:

// Assume initial conditions include html/document margin/border/padding:
// html { font-size: 10px; margin: 1em; border: 2em solid red; padding: 4em; }
// body { margin: 8em; border: 16em solid blue; padding: 32em; }

// …and a static element and an absolutely-positioned element:
// #static { position: static; }
// #absolute { position: absolute; top: 2em; left: 2em; }

// Establish document-relative origins for children of <body>
docElem.style.position = docPosition;
body.style.position = bodyPosition;
var bodyContentOrigin = 10 + 20 + 40 + 80 + 160 + 320;
var origin = 0 +
    (docPosition === "static" ? 0 : 10 + 20) +
    (bodyPosition === "static" ? 0 : 40 + 80 + 160);

// Check offsets
var absoluteOffset = $( "#absolute" ).offset();
assert.deepEqual(
    $( "#static" ).offset(),
    { top: bodyContentOrigin, left: bodyContentOrigin },
    "offset of position:static element includes <html> and <body> box styles" );
assert.deepEqual( absoluteOffset, { top: origin + 20, left: origin + 20 },
    "offset of position:absolute element ignores box styles of position:static ancestors" );
$( "#absolute, #static" ).offset( absoluteOffset );
assert.deepEqual( $( "#absolute" ).offset(), absoluteOffset, "offset() round-trips" );
assert.deepEqual( $( "#static" ).offset(), absoluteOffset, "offset() is transitive" );
$( "#static" ).css( "position", "static" );

// Reposition html and body, tracking origin adjustments given margin/border/padding
var originAdjust = 0;
$( docElem ).css( { top: "1.5em", left: "1.5em" } );
if ( docPosition !== "static" ) {
    originAdjust += 15 - (docPosition === "relative" ? 0 : 10);
}
$( body ).css( { top: "3em", left: "3em" } );
if ( bodyPosition === "fixed" || bodyPosition === "absolute" && docPosition === "static" ) {

    // html box styles no longer matter
    origin = 80 + 160;
    bodyContentOrigin = origin + 320;
    originAdjust = 30;
} else if ( bodyPosition !== "static" ) {
    originAdjust += 30 - (bodyPosition === "relative" ? 0 : 40);
}

// Recheck offsets
absoluteOffset = $( "#absolute" ).offset();
assert.deepEqual(
    $( "#static" ).offset(),
    { top: bodyContentOrigin + originAdjust, left: bodyContentOrigin + originAdjust },
    "offset of position:static element respects ancestor positioning" );
assert.deepEqual(
    absoluteOffset,
    { top: origin + originAdjust + 20, left: origin + originAdjust + 20 },
    "offset of position:absolute respects ancestor positioning" );
$( "#absolute, #static" ).offset( absoluteOffset );
assert.deepEqual( $( "#absolute" ).offset(), absoluteOffset, "offset() still round-trips" );
assert.deepEqual( $( "#static" ).offset(), absoluteOffset, "offset() is still transitive" );

And there could easily be ways to simplify even further.

This comment has been minimized.

@anseki

anseki May 3, 2016

Sorry, I have to learn English...
So, please check following:

  • I interpreted your comment in that issue as that the code should be tested with changing margin and border. Did I mistake again?
  • All assert.deepEqual()s that are passed return value from .offset() failed.
    I found this:
    https://github.com/jquery/jquery/blob/master/external/qunit/qunit.js#L1628
    if ( a.constructor === b.constructor ) {
    Expected values that were made in the test code and return values from .offset() that were made in iframe have constructor in different namespaces (i.e. window), therefore a.constructor === b.constructor is false.
    Return values from .offset() have to be copied to be checked by assert.deepEqual().
    supportjQuery.extend({}, $( "#static" ).offset())
  • This test failed when html{position} is static and body{position} is non-static.
assert.deepEqual( absoluteOffset, { top: origin + 20, left: origin + 20 },
    "offset of position:absolute element ignores box styles of position:static ancestors" );

For example, in a case html{position:static} body{position:relative}:

Expected: 

{
  "left": 300,
  "top": 300
}

Result: 

{
  "left": 330,
  "top": 330
}

I think, this code is incorrect:

var origin = 0 +
    (docPosition === "static" ? 0 : 10 + 20) +
    (bodyPosition === "static" ? 0 : 40 + 80 + 160);

If body has position:non-static, the element is positioned relative to body without being affected by position of <html>. body was already positioned with margin, border and padding of <html>.
Therefore the code should be:

var origin =
    bodyPosition !== "static" ? 10 + 20 + 40 + 80 + 160 : // `10 + 20 + 40` must be included
    docPosition !== "static" ? 10 + 20 : // relative to inside `<html>`
    0; // relative to document (i.e. outside `<html>`)
  • This test failed when html{position} is not static or relative.
assert.deepEqual(
    supportjQuery.extend({}, $( "#static" ).offset()),
    { top: bodyContentOrigin + originAdjust, left: bodyContentOrigin + originAdjust },
    "offset of position:static element respects ancestor positioning" );

I think, this code is incorrect:

if ( docPosition !== "static" ) {
    originAdjust += 15 - (docPosition === "relative" ? 0 : 10);
}

If <html> has position:non-static, it is positioned with margin even if potision is other than relative.
Therefore the code should be:

if ( docPosition !== "static" ) {
    originAdjust += 15;
}
  • This test failed in some cases:
assert.deepEqual(
    absoluteOffset,
    { top: origin + originAdjust + 20, left: origin + originAdjust + 20 },
    "offset of position:absolute respects ancestor positioning" );

This is solved by fixing originAdjust and origin.

This comment has been minimized.

@anseki

anseki May 3, 2016

The test code I wrote might do the almost same as your code, by removing code that changes margin and border.
But I didn't think that it should change top and left of <html> and body.
Therefore I think that I can't write PR. Maybe, I can't understand your request well by my very poor English.
Then, I hope that someone write PR.

This comment has been minimized.

@anseki

anseki May 3, 2016

BTW, why the test doesn't need to change border?
I think that this is PR to fix bug with clientTop/clientLeft (i.e. border).
At least, it should test in cases of that <html> has border and no border.

This comment has been minimized.

@gibson042

gibson042 May 3, 2016

Member

Sorry, I have to learn English...
So, please check following:

No problem. And it's not all your misunderstanding; my suggestions are changing as I learn new details of browser behavior around this issue.

I interpreted your comment in that issue as that the code should be tested with changing margin and border. Did I mistake again?

It was a partial mistake. I wasn't saying that margin and border need to change, just that test cases should cover both zero and nonzero values. Further, we already have tests for the no-margin no-border no-padding cases, and I have since concluded that the "only margin" and "only border" cases are unnecessary, so this PR can focus on situations in which all the box styles are nonzero.

Return values from .offset() have to be copied to be checked by assert.deepEqual()supportjQuery.extend({}, $( "#static" ).offset())

👍

If body has position:non-static, the element is positioned relative to body without being affected by position of <html>. body was already positioned with margin, border and padding of <html>.
Therefore the code should be:

var origin =
    bodyPosition !== "static" ? 10 + 20 + 40 + 80 + 160 : // `10 + 20 + 40` must be included
    docPosition !== "static" ? 10 + 20 : // relative to inside `<html>`
    0; // relative to document (i.e. outside `<html>`)

I definitely mis-defined origin, and I agree that your fix is correct.

I think, this code is incorrect:

if ( docPosition !== "static" ) {
    originAdjust += 15 - (docPosition === "relative" ? 0 : 10);
}

If <html> has position:non-static, it is positioned with margin even if potision is other than relative.
Therefore the code should be:

if ( docPosition !== "static" ) {
    originAdjust += 15;
}

Again, a correct fix for my mistake.

The test code I wrote might do the almost same as your code, by removing code that changes margin and border.
But I didn't think that it should change top and left of <html> and body.
Therefore I think that I can't write PR. Maybe, I can't understand your request well by my very poor English.
Then, I hope that someone write PR.

I really think we're close. My complaint wan't about what you were testing, just how it was being tested. And as shown above, you clearly have the right insights.

This comment has been minimized.

@anseki

anseki May 4, 2016

Thank you very much for your very attentive care.
I understood that the test doesn't have to change border.

I have more questions.

  • Why does the code change the top/left of html/body?
    I think that these properties affect getBoundingClientRect() method of browser, and .offset() method of jQuery calculates with a return value of the getBoundingClientRect() without considering top/left.
    That is, if the result become incorrect by changing top/left, it is bug of getBoundingClientRect() method (i.e. browser), not jQuery.
    Also, top/left of html/body are usually not changed.
  • Why is the code that passes a return value of .offset() to another element unnecessary?
    https://github.com/anseki/jquery/blob/offset-html-border/test/unit/offset.js#L650
    This is not "round-trip". I thought that the test should compare an element that was positioned by .offset() and another element that was positioned by native CSS, for setOffset().
    setOffset() must position an element at the same position as another element that was positioned by various CSS properties (position, border, etc.).
    I think that a cases of an element that has position:static are important because setOffset() calculates distance from current coordinates. #3080 (comment)
    That is, it compares coordinates that was got without .offset and coordinates that was changed by .offset that should not be affected by border of <html>.

This comment has been minimized.

@gibson042

gibson042 May 5, 2016

Member

Why does the code change the top/left of html/body?
I think that these properties affect getBoundingClientRect() method of browser, and .offset() method of jQuery calculates with a return value of the getBoundingClientRect() without considering top/left.
That is, if the result become incorrect by changing top/left, it is bug of getBoundingClientRect() method (i.e. browser), not jQuery.

If there are such bugs, we need to know so we can work around them (or document our failure to do so).

Also, top/left of html/body are usually not changed.

Nor do html or body elements usually have borders. The point is verifying that our functions perform as claimed.

Why is the code that passes a return value of .offset() to another element unnecessary?

I think that a cases of an element that has position:static are important because setOffset() calculates distance from current coordinates. #3080 (comment)

I agree. We should do both $( "#absolute" ).offset( absoluteOffset ) and $( "#static" ).offset( absoluteOffset ) and expect the subsequent .offset() to match absoluteOffset. I updated my suggestions accordingly.

@anseki

This comment has been minimized.

anseki commented May 5, 2016

I reconsidered about setter.
The setter moves an element by using distance between a current position and a requested position. It doesn't need calculation for getting coordinates relative to the document of requested position. And then, it change coordinates relative to a closest ancestor element that is positioned.
And, it uses getter to get current position.

Therefore if getter works correctly, things that affect setter are:

  • Whether target element has position:static.
  • Whether target element is already positioned. (it has position:absolute-or-fixed; top:not-auto; left:not-auto)

I think that the test doesn't need to change position of <html> and <body> for testing the setter, after testing the getter.
The test needs only position:static element and position:non-static element that are positioned relative to another element that is not document.

I will rewrite the test later.

Offset: rewrite the test
- Remove the code that changes box-properties of `<html>` and `body`.
- Add `testIframe` to test the setter.
@anseki

This comment has been minimized.

anseki commented May 5, 2016

BTW, I found another issue.
As it happens, the issue was found by the test I said above (the test that passes a return value of .offset() to .offset() with another element). That is, the another element was not positioned at the coordinates of first element.
That test failed in only browsers other than Firefox, and just 2px (border-width) was lost from the result. Therefore I thought that this seems that bug of Firefox again. But it is not.
The test failed only first time in each iframe with body{position:static}.
Strange to say, the test succeeded when I specified top and left of #marker2 (i.e. "another element" above).
https://github.com/anseki/jquery/blob/8fba23519ca5dfcd219ef2c66fe5eda4d3059023/test/data/offset/rel-doc.html#L12

I found that setOffset() gets current position by using .position(), when the element is not positioned (i.e. top/left are auto). And getComputedStyle() in Firefox seems to return top/left that are *px (real pixels, not auto) even if those were not specified. This also may be another bug of Firefox.
And I found issue that is unrelated to that in .position() and offsetParent. Since .position() is not used in Firefox, the test succeeded in Firefox.
In #3080, I said that the issue affects other methods, and I said that .position() method also uses .offset(). Those will be solved by this PR.
The issue in .position() and offsetParent that was found today is not that issue.

I send this as "new issue" later.

@gibson042

This comment has been minimized.

Member

gibson042 commented May 5, 2016

I think that the test doesn't need to change position of <html> and <body> for testing the setter, after testing the getter.
The test needs only position:static element and position:non-static element that are positioned relative to another element that is not document.

We don't need to change <html> or <body> position, but we do need to verify correct behavior when they are nonzero, for the same reason that we need to verify correct behavior when those elements have margin/border/padding.

html {
margin: 1px;
border-width: 2px;
padding: 4px;

This comment has been minimized.

@gibson042

gibson042 May 5, 2016

Member

It is important to me that all of these units are not pixels.

@anseki

This comment has been minimized.

anseki commented May 6, 2016

I see.
Since you updated your test code, I think that replacing my test code with yours is better than adding code which changes top/left. It makes the work progress quickly.
As I said, I should not have written PR because I could not read your request precisely many times.
Anyway, I replace the test later.

Offset: replace test code
- Copy the code from
  #3096 (comment)
- Wrap `.offset()` by `supportjQuery.extend`.
- Fix `origin` calucuration.
- Fix `originAdjust` calucuration.
"offset of position:static element includes <html> and <body> box styles" );
assert.deepEqual( absoluteOffset, { top: origin + 20, left: origin + 20 },
"offset of position:absolute element ignores box styles of position:static ancestors" );
$( "#absolute, #static" ).offset( absoluteOffset );

This comment has been minimized.

@timmywil

timmywil Jun 6, 2016

Member

$ -> jQuery

@gibson042

This comment has been minimized.

Member

gibson042 commented Jun 6, 2016

As discussed at today's meeting, we'll hold off on changing the .offset implementation until #3107 is fixed. And the critical piece here will be carrying forward the thorough testing of positioning and box properties affecting documentElement and body.

@JSFOwner JSFOwner removed the CLA: Valid label Nov 5, 2016

@timmywil timmywil modified the milestones: 3.3.0, 3.2.0 Mar 15, 2017

@gibson042 gibson042 removed this from the 3.3.0 milestone Mar 27, 2017

gibson042 added a commit to gibson042/jquery that referenced this pull request Mar 27, 2017

@gibson042 gibson042 referenced this pull request Mar 27, 2017

Merged

Fix .offset() and .position() bugs #3487

4 of 4 tasks complete

gibson042 added a commit that referenced this pull request Apr 24, 2017

immpo added a commit to immpo/jquery that referenced this pull request Feb 3, 2018

up (#1)
* Dimensions: ignore transforms when retrieving width/height

Close gh-3561
Fixes gh-3193

* CSS: remove dead code in getWidthOrHeight

- getCSS already falls back to inline styles

Ref gh-3561

* Release: update release dependencies

* Release: update AUTHORS.txt

* Release: update version to 3.2.0-pre

* Release: md5sum -> md5 -r for MAC

* Build: Updating the master version to 3.2.1-pre.

* Release: edit dist README version on release

Fixes gh-3574

* Build: update PR template

- Comment out things we don't need to see in the PR description
- Change CLA link

* Tests: move readywait to an iframe test

Close gh-3576
Fixes gh-3573

* Dimensions: fall back to offsetWidth/Height for inline elems

Close gh-3577
Fixes gh-3571

* Revert "Event: Trigger checkbox and radio click events identically"

This reverts commit b442aba.

* Revert "Event: Add radio click triggering tests"

This reverts commit 5f35b5b.

* Tests: add test for passing trigger data to radio click handler

Close gh-3581
Fixes gh-3579

* Build: Updating the master version to 3.2.2-pre.

* CSS: retrieve inline style before computed

- Fixes an issue with getting computed style on detached elements

* Revert "Build: Updating the master version to 3.2.2-pre."

This reverts commit 066bd86.

* Build: Updating the master version to 3.2.2-pre.

* Tests: Fix incorrect assert name for ensure_iterability_es6

Closes gh-3584
Ref bb026fc.

* Docs: Update links to HTML spec for stripAndCollapse (#3594)

* Offset: Use correct offset parents; include all border/scroll values

Thanks @anseki

Fixes gh-3080
Fixes gh-3107
Closes gh-3096
Closes gh-3487

* Core: Update isFunction to handle unusual-@@toStringTag input

Ref gh-3597
Fixes gh-3600
Fixes gh-3596
Closes gh-3617

* Tests: Improve offset test setup and labels

Hopefully this fixes iOS testing: http://swarm.jquery.org/job/5226

Ref 1d2df77
Closes gh-3641

* Tests: Be even more async for iOS

Ref 1d2df77
Closes gh-3643

* Tests: Attach test iframes to the body for visibility-dependent code

Ref 1d2df77
Closes gh-3645

* Tests: Allow a mock QUnit.test for perfect testIframe fidelity

Ref 1d2df77
Closes gh-3647

* Tests: Prepend test iframes for even *more* consistency

Ref 1d2df77

* Tests: Reset iframe window scroll after updating html/document position

Ref 1d2df77
Closes gh-3649

* Tests: Add debugging to investigate iOS failures

Ref 1d2df77

* Tests: Keep iframes visible in TestSwarm

Ref 1d2df77

* Tests: Adjust by actual scroll position, rather than expected

Ref 1d2df77

* Tests: Clean up offset debugging

Ref 1d2df77
Ref c0edd8d

* Tests: Correct expected assertion count

Ref e94b5b0

* Tests: Revert some testIframe changes to fix dimensions tests

Ref c0edd8d

* Revert "Tests: Revert some testIframe changes to fix dimensions tests"

This reverts commit c4368a9.

* Tests: Revert some testIframe changes to fix dimensions tests

Ref c0edd8d

* CSS: Drop the float mapping from cssProps

Firefox 35 and newer support style.float directly.

Closes #3569

* Docs:Tests: Update IE/Edge-related support comments & tests

Closes gh-3661

* Build: Test on Node.js 8, stop testing on Node.js 7

* Tests: minor typos

Close gh-3671

* Dimensions: Include scroll gutter in "padding" box

Fixes gh-3589
Closes gh-3656

* Deferred: fix memory leak of promise callbacks

Fixes gh-3606
Closes gh-3657

* Build: update node dependencies; commit package-lock.json

- Also ignore yarn.lock
Close gh-3669

* Build: Update sinon, husky, and qunitjs

* Build: fix uglify options for uglify update

- Uses new typeofs option for compression
- See mishoo/UglifyJS2#2198

Close gh-3710

* Event: `stopPropagation()` on native event-handler

Fixes gh-3693
Close gh-3694

* Core: Deprecate jQuery.isWindow

Fixes gh-3629
Close gh-3702

* Test: ensure position/offset return mutable objects

Fixes gh-3612
Closes gh-3695

* Revert "Offset: Resolve strict mode ClientRect "no setter" exception"

This reverts commit 3befe59.

* Offset: fix error from bad merge in #3695

* Dimensions: Detect and account for content-box dimension mishandling

Fixes gh-3699
Closes gh-3700

* Support: Properly check for IE9 absolute scrollbox mishandling

Ref gh-3589
Fixes gh-3699
Fixes gh-3730
Closes gh-3729

* Tests: Try extra hard to control focus

Ref gh-3732

* Tests: Abort focus tests when the environment doesn't cooperate

Ref gh-3732

* Tests: Reduce the abort timeout for simple focus testing

Ref gh-3732

* Tests: Simulate events when CI hinders use of native ones

Ref gh-3732

* Tests: Account for TestSwarm focus issues

Closes gh-3732

* Ajax: add an ontimeout handler to all requests

Fixes gh-3586
Close gh-3590

* Dimensions: Improve offsetWidth/offsetHeight fallback

Fixes gh-3698
Fixes gh-3602
Closes gh-3738

* Tests: Replace non-ASCII whitespace in source code

* Dimensions: Don't trust non-pixel computed width/height

Fixes gh-3611
Closes gh-3741

* Build: Fix comment typo

Closes gh-3747

* Build: Update my name in .mailmap

I got married! 🎉

* Build: Update my name in ATHORS.txt

I forgot .mailmap isn't everything.

* Tests: Update path calculation

Fixes gh-3756
Closes gh-3757

* CSS: Avoid unit-conversion interference from CSS upper bounds

Fixes gh-2144
Closes gh-3745

* Tests: Update lineHeight adjustments to give Android more slop

* CSS: Detect more WebKit styles erroneously reported as percentages

Ref 692f9d4
Fixes gh-3777
Closes gh-3778

* Build: Update to Babel 7, use for-of plugin instead of preset-es2015

Closes gh-3786

* Build: Drop cross-spawn, use child_process.spawn shell option

* Build: increase timeout in Promises/A+ tests 10 times

The promises-aplus-tests sets up a default 200 ms Mocha timeout. This makes
our tests randomly fail on Jenkins. 2 seconds will be safer.

Closes gh-3791

* Build: Remove package-lock.json, add it to .gitignore

npm 5, even the version included in the latest Node.js 8.5.0 re-generates
`package-lock.json` on each install. And when it does on a system that doesn't
support all the optional dependencies that are supported on the OS where the
lockfile was generated, it removes those optional deps from the lockfile.

The effect is that everyone firing `npm install` on our repo on any OS other
than macOS will immediately get a dirty state of the repo as the `fsevents`
dependency subtree gets removed from `package-lock.json`. That's a really bad
experience.

This commit removes package-lock.json from the repository and adds it to
.gitignore. We'll start committing the file again once the issue is resolved
on npm's part.

Fixes gh-3792

* Tests: Make Node tests work for paths with spaces in them

Without this patch Jenkins tests fail as jQuery job names there contain spaces,
e.g. "jQuery Core".

Closes gh-3821

* Tests: Add Safari 11 support test results

* Build: Test on Node.js 9

Closes gh-3840

* Tests: Add iOS 11 support test results

* Manipulation: Reduce size by eliminating single-use variable

Closes gh-3851

* CSS: Correctly set support properties with non-default zoom

Fixes gh-3808
Closes gh-3872

* Docs: Create CODE_OF_CONDUCT.md

Close gh-3865

* Tests: Add support for running unit tests via grunt with karma

- Update QUnit to 1.23.1
- Remove unused dl#dl from test/index.html
- Remove unused map#imgmap from test/index.html
- Ensure all urls to data use baseURI
- Add the 'grunt karma:main' task
  - customContextFile & customDebugFile
- Add 'npm run jenkins' script

Close gh-3744
Fixes gh-1999

* Build: Only run browser tests in one Node version on Travis

Ref gh-3744
Closes gh-3894

* Core: make camelCase function available only for internal usage

Close gh-3604
Fixes gh-3384

* Core: adjust data tests to ensure proper camelCasing

- Add back camelCase to the public object (deprecate not remove)
Ref #3384

* Core: deprecate jQuery.now

Fixes gh-2959
Close gh-3884

* Core: deprecate jQuery.proxy (not slated for removal)

Fixes gh-2958
Close gh-3885

* Manipulation: use `.children` to select tbody elements

- selectors beginning with a child combinator are not valid natively.
  This fixes the tests when using selector-native.js

* Attributes: allow array param in add/remove/toggleClass

+30 bytes instead of +182

Thanks to @faisaliyk for the first pass on this feature.

Fixes gh-3532
Close gh-3917

* Ajax: add unit test for getScript(Object)

Fixes gh-3736
Close gh-3918

* Tests: only run ontimeout test if ontimeout exists

Fixes gh-3742
Close gh-3919

* Build: Fix UglifyJS output in Android 4.0; update uglify

- Thanks to @mgol for first pass

Fixes gh-3743
Close gh-3920

* Tests: fix function reference for unbinding

Ref gh-2958

* Build: Remove CRLF line endings to fix builds on Windows

Close gh-3929

* Core: deprecate jQuery.isFunction

Fixes gh-3609

* Event: Move event aliases to deprecated

Fixes gh-3214

* Ajax: Don't process non-string data property on no-entity-body requests

Fixes gh-3438
Closes gh-3781

* Core: deprecate jQuery.isNumeric

Fixes gh-2960
Closes gh-3888

* Tests: fix weird failure in Edge 16 CSS

Fixes gh-3866
Close gh-3932

* Tests: fix weird flaky attributes test in Edge 16

Fixes gh-3867
Close gh-3931

* Core: deprecate jQuery.type

Fixes gh-3605
Close gh-3895

* Tests: fix number of expected assertions in basic core

* Tests: temporarily require sudo access for karma:main on travis

- This should fix the broken travis build on Node 8
- See travis-ci/travis-ci#8836

* Tests: correctly set sudo in travis config, not karma config

* Manipulation: Add support for scripts with module type

Fixes gh-3871
Close gh-3869

* Tests: fix tests in AMD mode

* Tests: ensure that module assertions run on supported browsers

- Also fixes tests for karma, where the URL for the module is different

Ref gh-3871

* Filter: Use direct filter in winnow

for both simple and complex selectors

Fixes gh-3272
Closes gh-3910

* Build: Add "-debug" suffix to name of karma debug tasks

Ref gh-3922
Close gh-3936

* Tests: skip test with invalid selector for selector-native tests

* Release: add new authors to AUTHORS.txt

* Release: update version to 3.3.0-pre

* Build: Updating the master version to 3.3.1-pre.

* Build: Updating the master version to 3.3.2-pre.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment