WICG / WICG/declarative-partial-updates
Elements with special parsing rules
Nobody has claimed this yet.
- Dominant language
- Bikeshed
- Stars
- 135
- Forks
- 13
- Avg merge
- 12m
- Merged PRs (30d)
- 3
Description
Many elements have special parsing rules that end up limiting what kind of nodes can appear inside. For example, https://html.spec.whatwg.org/multipage/parsing.html#parsing-elements-that-contain-only-text is used for <xmp> and as a result there will be either no child node, or a single text node child.
Should <template patchfor> ensure that result will be the same as if it was parsed at the target location?
Test case:
<!DOCTYPE html>
<xmp id=target></xmp>
<template patchfor=target><span>hello</span></template>
Or should be behave exactly like setting innerHTML? https://software.hixie.ch/utilities/js/live-dom-viewer/?saved=13929 tests that and at least <xmp> behaves the same as the main parser. Spec is at https://html.spec.whatwg.org/multipage/parsing.html#html-fragment-serialisation-algorithm and I'm not very familiar with where it differs from the main parser.
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 comparing the supplied xmp/template test case with the HTML fragment serialisation algorithm and the main parser rules cited in the issue. Determine whether template patching should match parsing at the target location or innerHTML behavior, then document the decision and its expected result for this case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html
- Domain
- web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100