-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Shadow DOM and <script> #762
Comments
(We need to define "shadow-host-including inclusive ancestor" since obviously a |
Sounds good to me. I wonder how beforescriptexecute and afterscriptexecute should behave. Those shouldn't cross tree boundaries. So I guess 'scoped flag' should be set when dispatching those events. |
Sounds good to me.
Makes sense. Let me update the spec. |
This makes <script> elements work when used in shadow trees. The beforescriptexecute and afterscriptexecute events won’t work, since they are already disabled for modules and only makes sense together with currentScript, which cannot be made to work for shadow scripts. See #1013 for details. Fixes #762.
This updates the "inserted into a document" and "removed from a document" algorithms to work on all nodes, not just elements. It also redefines them in terms of the DOM Standard's insertion/removing steps for increased precision. This sets the stage for various shadow DOM-related changes, such as the work on <script> elements necessary for #762.
This makes <script> elements work when used in shadow trees. The beforescriptexecute and afterscriptexecute events won’t work, since they are already disabled for modules and only makes sense together with currentScript, which cannot be made to work for shadow scripts. See #1013 for details. Fixes #762.
This makes <script> elements work when used in shadow trees. The beforescriptexecute and afterscriptexecute events won’t work, since they are already disabled for modules and only makes sense together with currentScript, which cannot be made to work for shadow scripts. See #1013 for details. Fixes #762.
Hmm, I guess this got closed because the original post of the PR said "fixes #762", even though I changed the commit message to no longer say that. Reopening, since we still have to make the "load" event scoped. |
(Since the terminology discussion around Shadow DOM is not making fast progress, my idea is that for now I'll try to write some ideas down in individual issues to later be merged into the specification.)
<script>
elements will run when inserted if they have a host-including inclusive ancestor that is a document.currentScript
on document and shadow roots will only point to<script>
elements that are descendants and return null otherwise. (Existing scripts expectingcurrentScript
to always be them might have to be updated for this.) An alternative here is that only "closed" shadow roots have an exclusivecurrentScript
and that otherwise both that on the document and of the shadow root work. Given how much properties leak the shadow root already that might be okay too?Anything else?
Paging @hayatoito @smaug---- @rniwa.
The text was updated successfully, but these errors were encountered: