not working HTMLTemplateElement Content append after innerHTML result empty string
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 42/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 冷清
- 技术栈
- typescript
- 领域
- web-dev
调研方向
从此 issue 中的 TypeScript 复现开始:将一个 DocumentFragment 附加到 template.content,然后比较 template.innerHTML 与 template.content.children。跟踪 HTMLTemplateElement 的序列化路径,并添加覆盖,表明附加的内容会出现在 innerHTML 中,同时保留报告的 children 结果。
由索引模型根据 Issue 内容生成。
描述
PR: https://github.com/WebReflection/linkedom/pull/315
const data: DocumentFragment = ...
const template = window.document.createElement('template') as HTMLTemplateElement;
template.content.append(data);
console.log('innerHTML:', template.innerHTML, 'children:',Array.from(template.content.children)); // innerHTML emptyString
not working..
innerHTML output is empty string
console.log('innerHTML:', template.innerHTML, 'children:',Array.from(template.content.children));
--log result--
innerHTML: children: [
<ref *1> HTMLStyleElement {
ownerDocument: HTMLDocument {
ownerDocument: null,
localName: '#document',
nodeType: 9,
parentNode: null,
[Symbol(next)]: [DocumentType],
[Symbol(prev)]: null,
[Symbol(private)]: null,
[Symbol(end)]: [Object],
[Symbol(CustomElements)]: [Object],
[Symbol(MutationObserver)]: [Object],
[Symbol(mime)]: [Object],
[Symbol(doctype)]: [DocumentType],
[Symbol(DOMParser)]: [class DOMParser],
[Symbol(globals)]: null,
[Symbol(image)]: null,
[Symbol(upgrade)]: null,
[Symbol(EventTarget)]: [DOMEventTarget]
},
localName: 'style',
nodeType: 1,
parentNode: DocumentFragment {
ownerDocument: [HTMLDocument],
localName: '#document-fragment',
nodeType: 11,
parentNode: null,
[Symbol(next)]: [Circular *1],
[Symbol(prev)]: null,
[Symbol(private)]: [HTMLTemplateElement],
[Symbol(end)]: [Object]
},
[Symbol(next)]: Attr {
ownerDocument: [HTMLDocument],
localName: 'id',
nodeType: 2,
parentNode: null,
ownerElement: [Circular *1],
name: 'id',
[Symbol(next)]: [Attr],
[Symbol(prev)]: [Circular *1],
[Symbol(value)]: 'KQykvzSaQPUDomNDyYpuZNdcxkWCkvHtGvVujfjH-style',
[Symbol(changed)]: false
},
[Symbol(prev)]: DocumentFragment {
ownerDocument: [HTMLDocument],
localName: '#document-fragment',
nodeType: 11,
parentNode: null,
[Symbol(next)]: [Circular *1],
[Symbol(prev)]: null,
[Symbol(private)]: [HTMLTemplateElement],
[Symbol(end)]: [Object]
},
[Symbol(private)]: null,
[Symbol(end)]: {
nodeType: -1,
ownerDocument: [HTMLDocument],
parentNode: null,
[Symbol(next)]: [HTMLElement],
[Symbol(prev)]: [Attr],
[Symbol(start)]: [Circular *1]
},
...
]
I was thus treated with innerHTML.
- template.innerHTM; .. template.content
But I think it needs to be fixed
- 主要语言
- HTML
- 星标
- 2.1k
- 派生
- 104
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
我们还没有检查这个项目的环境配置文件。先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
WebReflection/linkedom 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 68/100
WebReflection/linkedom#329 · 5 条评论 ·
-
难度 3/5 1-2 天 新手友好度 52/100
WebReflection/linkedom#327 · 1 条评论 ·
-
难度 3/5 1-2 天 新手友好度 48/100
WebReflection/linkedom#326 · 5 条评论 ·
-
难度 5/5 一周以上 新手友好度 15/100
WebReflection/linkedom#321 · 1 条评论 ·
-
难度 5/5 一周以上 新手友好度 25/100
WebReflection/linkedom#318 · 6 条评论 ·
查看 WebReflection/linkedom 的全部 Issue
相似的 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
status: waiting triage
难度 2/5 1-3 小时 新手友好度 84/100
freeCodeCamp/freeCodeCamp#70412 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 78/100
openedx/frontend-app-admin-console#239 ·
维护者通常 1 天内回复
-
bug good first issue web
难度 2/5 1-3 小时 新手友好度 85/100