[w3c/webcomponents] [idea] Not having <slot> element get in the way of structure. (#589)

It seems like having `<slot>` (or `<content>`) elements gets in the way of the structure that markup aims to convey.

Would it perhaps be better to preserve the structure of the tree by using attributes instead of elements, for defining slots?

For example,

instead of

```html
#shadow-root
  <div>
    <slot name="some-slot">
    </slot>
  </div>
```

what about something like

```html
#shadow-root
  <div define-slot="some-slot">
  </div>
```

?

Or, perhaps even an a JavaScript-only approach, so that we don't taint attributes:

```html
#shadow-root
  <div class="some-slot">
  </div>
```
```js
root.defineSlot(root.querySelector('div'), 'some-slot')
```

Since *the only way to define shadow roots* is via JavaScript, it could possibly make sense that defining slots can be a JavaScript-only procedure.

Not having to use HTML to define slots would prevent extra elements (that don't behave like elements) from getting in the way of the structural design conveyed in the markup.

Just a thought.

-- 
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/issues/589

Received on Monday, 17 October 2016 22:37:12 UTC