Skip to content
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

Core: Throw a better error when documentElement is missing #452

Closed
wants to merge 1 commit into from

Conversation

mgol
Copy link
Member

@mgol mgol commented Aug 19, 2019

This is a resubmit of gh-439 that was lost during the switch from JSHint + JSCS
to ESLint

Ref gh-442
Ref gh-439

(cherry picked from commit 7d92424)

@mgol
Copy link
Member Author

mgol commented Aug 19, 2019

@gibson042 I noticed that when gh-439 is applied in the jQuery repository on the 3.4-stable branch, it causes a failure of the contents() for <template /> test. This is because when find is run on an element inside of <template>, setDocument sets its document to its enclosing document fragment which has a null documentElement. Do you still think this change is fine or should we not land it in the end?

cc @dangkyokhoang

This is a resubmit of jquerygh-439 that was lost during the switch from JSHint + JSCS
to ESLint

Ref jquerygh-442
Ref jquerygh-439

(cherry picked from commit 7d92424)
@gibson042
Copy link
Member

We discussed in-meeting and had rough consensus that the right behavior was to stop at a disconnected fragment but to traverse up through a fragment's <template> host when one exists. But unfortunately, it seems difficult and maybe impossible to differentiate the two. My ideal change would instead be to tolerate null documentElement, but more changes will be required for that.

@mgol
Copy link
Member Author

mgol commented Aug 26, 2019

Since this PR doesn't solve the issues we have, I'm closing it, opening an issue instead: #458.

@mgol mgol closed this Aug 26, 2019
@mgol mgol deleted the docElem-check branch August 26, 2019 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants