Skip to content

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

Closed
mgol wants to merge 1 commit into
jquery:masterfrom
mgol:docElem-check
Closed

mgol wants to merge 1 commit into
jquery:masterfrom
mgol:docElem-check

Conversation

@mgol

@mgol mgol commented Aug 19, 2019

Copy link
Copy Markdown
Member

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
mgol requested review from gibson042 and timmywil August 19, 2019 16:47
@mgol

mgol commented Aug 19, 2019

Copy link
Copy Markdown
Member Author

@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
Copy Markdown
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

mgol commented Aug 26, 2019

Copy link
Copy Markdown
Member Author

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.

3 participants