Re: [w3c/webcomponents] Add an updated proposal for DOM Parts. (#899)

@rniwa commented on this pull request.



> +and `AttributePart` for [`a` element](https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-a-element) as follows: 
+```js
+namePart = new ChildNodePart(name)
+emailPart = new ChildNodePart(link)
+emailAttributePart = new AttributePart(link, ’href’)
+
+Then assigning values as follows will update the DOM:
+namePart.value = "Ryosuke Niwa"
+emailPart.value = "rniwa@webkit.org"
+emailAttributePart.value = "mailto:rniwa@webkit.org"
+```
+
+The resultant DOM will look like this:
+```html
+<section><h1 id="name">Ryosuke Niwa</h1>Email: <a id="link" href="mailto:rniwa@webkit.org"></a></section>
+```

Oh oops, that's because I forgot to add calls to `commit()`. Will fix.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/pull/899#discussion_r512164486

Received on Monday, 26 October 2020 18:04:13 UTC