-
Notifications
You must be signed in to change notification settings - Fork 370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Explain the relationship of DOM Parts to XHTML #1028
Comments
Do you have a link to where that’s happening? And do you know whether that’s really the behavior being proposed (or if it’s e.g. just a temporary detail of a partial proof-of-concept?) |
See the meeting minutes about Chromium using comment nodes at least for prototyping. |
iirc, the comments made it easy to create anchor points (before/after) for https://github.com/WICG/webcomponents/blob/gh-pages/proposals/DOM-Parts-Imperative.md#proposal, but this was before I realized the first argument for ChildNodePart was the parent. I previously thought it wouldn't apply since NodePart's first argument should be the single node. That being said, it may be worth it to consider a different node type so that we can serialize back and forth more consistently. |
It's worth noting that processing instructions are a node type that already exists for XML and is unused for HTML. If the syntax starting with |
That was the original concept - see tbondwilkinson/dom-parts#5. But there are issues:
|
One of the reasons to not use Here are the places we would like to allow parts:
There is a related requirement that I would like to preserve, which is that you can make a valid parts-containing template HTML string from author-provided template strings without having to parse the author-provided strings. This is possible if we can join the author-provided template strings with a single joiner string. This makes building a declarative HTML template system in JS very easy: const html = (strings, ...values) => {html: strings.join('{{}}'), strings, values};
const example = html`<div ${behaviorA()} foo=${valueB}>${children}</div>`;
example.html; // <div {{}} foo={{}}>{{}}</div> |
How is the DOM Parts syntax expected to relate to XHTML generally, the notion that the HTML and XHTML serializations of HTML are so close that it's not only feasible to migrate between them but also to pursue a single byte stream having the same meaning as both ("polyglot"), and the notion that the mapping between markup and DOM for XML exists on its own independently of HTML?
( https://github.com/WICG/webcomponents/blob/gh-pages/proposals/DOM-Parts-Declarative-Template.md does not currently explain that currently in the Chromium prototype the proposed DOM Parts syntax is syntactic sugar for creating comment nodes. There is a correspondence between comment nodes and markup syntax for XML independently of HTML.)
That is, how does DOM Parts relate to the DOM Consistency Design Principle?
The text was updated successfully, but these errors were encountered: