Skip to content

Core: Support non-browser environments #2504

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

Merged
merged 2 commits into from
Sep 7, 2015
Merged

Core: Support non-browser environments #2504

merged 2 commits into from
Sep 7, 2015

Conversation

mgol
Copy link
Member

@mgol mgol commented Jul 28, 2015

Fixes gh-2133
Fixes gh-2501
Closes gh-2504
Refs gh-1950
Refs gh-1949
Refs gh-2397
Refs gh-1537
Refs gh-2504
Refs 842958e

Second commit adds support for non-browser environments. Message of the first commit:

Core:CSS: Attach test nodes to documentElement, not body

Attaching test divs to document.documentElement instead of document.body
used to cause issues in jQuery 1.x; jQuery Compat doesn't execute any tests
on document ready, though so it could be aligned with master.

This makes jQuery Compat support tests work correctly even if jQuery is
included & used in head before body even exists - making it similar to
the master behavior.

Fixes gh-2502

EDIT: BTW, this PR decreases the gzipped size by 5 bytes. ;)

@mgol
Copy link
Member Author

mgol commented Jul 28, 2015

Once this lands (I'd appreciate a quick review of this PR, @jquery/core), I'll work on a basic test suite for Android 2.3.

@timmywil @gibson042 Am I right that you prefer to not remove Android 2.3 workarounds like this one from master tests even when Android 2.3 won't even be reaching that code to reduce divergence from master? I guess we won't backport new Android 2.3-specific workarounds from compat to master so the divergence will happen anyway (and the "workarounds" are mainly skipping the test which is easy to isolate) but whatever you prefer.

mgol added a commit to mgol/jquery that referenced this pull request Jul 28, 2015
mgol added a commit to mgol/jquery that referenced this pull request Jul 28, 2015
mgol added a commit to mgol/jquery that referenced this pull request Jul 28, 2015
@gibson042
Copy link
Member

@timmywil @gibson042 Am I right that you prefer to not remove Android 2.3 workarounds like this one from master tests even when Android 2.3 won't even be reaching that code to reduce divergence from master? I guess we won't backport new Android 2.3-specific workarounds from compat to master so the divergence will happen anyway (and the "workarounds" are mainly skipping the test which is easy to isolate) but whatever you prefer.

My preference is for everything under /test to be identical between branches, so we don't run into unnecessary merge conflicts. We may not get there, but I definitely don't want to invest effort in explicit divergence.

@gibson042
Copy link
Member

👏

This looks great, @mzgol.

mgol added a commit to mgol/jquery that referenced this pull request Jul 28, 2015
@timmywil
Copy link
Member

We may not get there, but I definitely don't want to invest effort in explicit divergence.

Agreed.

@dmethvin
Copy link
Member

Yes, merge conflicts are a pain so isolating those would be very helpful. That will become really clear if we ever do a style sweep on the unit tests!

@mgol
Copy link
Member Author

mgol commented Jul 29, 2015

We may not get there, but I definitely don't want to invest effort in explicit divergence.

@gibson042 @timmywil @dmethvin works for me. You should all like this PR, then, since it makes src/** more similar between master & compat. ;)

@mgol mgol mentioned this pull request Jul 29, 2015
mgol added 2 commits August 16, 2015 22:28
Attaching test divs to document.documentElement instead of document.body
used to cause issues in jQuery 1.x; jQuery Compat doesn't execute any tests
on document ready, though so it could be aligned with master.

This makes jQuery Compat support tests work correctly even if jQuery is
included & used in head before body even exists - making it similar to
the master behavior.

Fixes jquerygh-2502
@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

6 participants