WebReflection / WebReflection/linkedom
null textContent value for DocumentFragment
Open
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 2.1k
- Forks
- 104
- PR merge metrics
- No merged PRs in 30d
Description
The .textContent attribute of a DocumentFragment—such as the one returned by a <template>’s .content attribute—is null.
import { parseHTML } from "linkedom";
const { document } = parseHTML("");
const template = document.createElement("template");
template.innerHTML = "foo <span>bar</span>";
// in linkedom this is "foo bar", in browsers it’s an empty string
console.log(template.innerText);
const documentFragment = template.content;
// in linkedom this is null, in browsers it’s "foo bar"
console.log(documentFragment.textContent);
Contributor guide
No contributing guide indexed for this repository
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 locating the DocumentFragment textContent implementation and compare it with the browser behavior shown in the issue’s template.content example. Done means template.content.textContent returns the fragment’s text rather than null, while the demonstrated behavior remains consistent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100