Throw a better error when documentElement is missing
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 6.3k
- Forks
- 927
- PR merge metrics
- No merged PRs in 30d
Description
PR #439 made Sizzle crash earlier on a documentElement-missing document. However, we want selection to work on nodes inside of a <template> element for which ownerDocument will point to a document fragment with a null documentElement. As @gibson042 said in #452:
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing PR #439 and the discussion referenced from #452 to understand the existing documentElement-missing crash and the proposed fragment behavior. Investigate Sizzle selection for nodes inside a element and define completion against the stated goal of tolerating a null documentElement without incorrectly traversing disconnected fragments.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100