Re: [css-houdini-drafts] [worklets] <script> tag import feature design.

It just seems very strange to me to have scripts like

```html
<script>
self === window;
document.addEventListener(...);
</script>

<script type="module">
self === window;
document.addEventListener(...);
</script>

<script type="paintworklet">
self === window; // fails, window is undefined
document.addEventListener(...); // fails, document is undefined
</script>
```

all in the same source document.

Maybe there is no better option; after all the HTML parser makes it very hard to have any new element contain unstructured data like `<script>` does. But I think it will be surprising for authors and, as @nyaxt expresses, will get in the way of implementations which are so far assuming that `<script>` has a very specific processing model.

In other words, this seems to be a request to reuse the parser behavior of `<script>`, but ignore the rest of its processing model, which is confusing.

If this feature is mostly related to HTML modules, then I'd suggest feeding this back into the discussion there, as it may inform the design there (e.g. using a different HTML parser or different format that isn't HTML as the container).

-- 
GitHub Notification of comment by domenic
Please view or discuss this issue at https://github.com/w3c/css-houdini-drafts/issues/376#issuecomment-293067750 using your GitHub account

Received on Monday, 10 April 2017 20:23:38 UTC