Re: [WICG/webcomponents] HTML parser: align custom elements with the template element (#630)

For a `<table>` element this doesn't really make sense:

- custom elements as a child of `<thead>`, which means that the renderer should go through anything that is inside that custom-element, strip anything that's not allowed in `<thead>` and render the rest;
- custom element as a child of `<table>`, same as above.
- custom element as a child of `<tr>`, same as above.

By applying the above approach `<style>` tag will be omitted as well and the user will be better off styling the table in a global CSS.  
Maybe it would be possible to only allow `<slot>` tag in a `<table>` or any of its descendants to preserve already built in support for a11y, but allow additional styling for the slotted content.
That way slotted content will be projected to the `<table>` and then the engine will decide whether to render the slotted content or not, based on the [current spec](https://www.w3.org/TR/html52/tabular-data.html#the-table-element).  
Example: 
```HMTL
<table>
 <caption>
  <slot name="caption"></slot>
 </caption>
 <colgroup>
  <slot name="colgroup"></slot>
 </colgroup>
 <slot name="colgroup"></slot>
 <thead>
  <slot name="header"></slot>
 </thead>
 <!-- zero or more tbody-->
 <slot name="body"></slot>
 <tfoot>
  <slot name="footer"></slot>
 </tfoot>
</table>
```

Additionally it will give access to the slotted content to the custom-element author via JavaScript.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/WICG/webcomponents/issues/630#issuecomment-745201725

Received on Tuesday, 15 December 2020 10:35:13 UTC