Skip to content

Core: Update tested jsdom, drop obsolete workarounds #2154

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 1 commit into from
Mar 30, 2015

Conversation

mgol
Copy link
Member

@mgol mgol commented Mar 20, 2015

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.

Fixes gh-2153

mgol added a commit to mgol/jquery that referenced this pull request Mar 20, 2015
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.

Fixes jquerygh-2153
Closes jquerygh-2154
@@ -46,61 +46,57 @@ define([
documentElement.removeChild( container );
}

// Support: node.js jsdom
// Don't assume that getComputedStyle is a property of the global object
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment didn't make sense even for jsdom 1.5. Were there any other reasons to hide these support tests? Are we worried about other envs that will expose window without getComputedStyle? If so, I'll revert but the comment will need to be changed completely.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if it comes into play here, but window may be a non-Window global object: https://github.com/mzgol/jquery/blob/jsdom-update/src/intro.js#L38

In any case, the comment probably does need rewriting.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It used to say getComputedStyle assuming that was in the global scope. So it was more about assuming window and global were equivalent.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, window is not a global here but what was passed to the factory. Unless the global has a property document when we assume we're in a browser and assign window = current global.

This works without this if in jsdom because its window parameter has getComputedStyle. Do we want to support anything else here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to get input from more people here as I'm a little afraid of this change. cc @jquery/core

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As long as getComputedStyle is available, I'm fine with this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As long as getComputedStyle is available, I'm fine with this.

Great. I'd like to have as many people test it as possible since I'm still worried a little so I'd like to get it into the first beta.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mgol added a commit to mgol/jquery that referenced this pull request Mar 25, 2015
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.

Fixes jquerygh-2153
Closes jquerygh-2154
mgol added a commit that referenced this pull request Mar 25, 2015
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 95c0a10)

Fixes gh-2153
Closes gh-2154
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.

Fixes jquerygh-2153
Closes jquerygh-2154
@mgol mgol merged commit 06f6cd1 into jquery:master Mar 30, 2015
@mgol mgol deleted the jsdom-update branch March 30, 2015 17:01
mgol added a commit that referenced this pull request Nov 10, 2015
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.

Fixes gh-2153
Closes gh-2154
@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.

Update jsdom & drop obsolete workarounds
5 participants