Conversation
|
This depends on #1097. |
|
Also, depending on how we feel about doing this right in one go, we could wait until scoped events are part of the DOM Standard. The only downside is that this would land some infrastructure that could be used for other shadow tree cleanup as well. Not sure how to decouple all that easily. |
|
(Note that review can start straight away.) |
| into a document</span>, at the time the <span data-x="nodes are inserted">node is inserted</span> | ||
| according to the DOM, after any other <code>script</code> elements inserted at the same time that | ||
| are earlier in the <code>Document</code> in <span>tree order</span>.</li> | ||
| <li>The <code>script</code> element gets <span data-x="node is connected">connected</span>.</li> |
There was a problem hiding this comment.
Is the rremoval of the ", at the time..." clause here problematic?
There was a problem hiding this comment.
No, since the hook it's using is only run once for each node. However, there is a problem with script execution as illustrated by http://software.hixie.ch/utilities/js/live-dom-viewer/saved/4098.
I think technically we need to invoke the insertion steps twice. Once with "don't execute scripts" and once (once everything is actually in the tree) with "execute scripts". That flag might only need to be set to "don't" in the case of document fragments.
@smaug---- had a thought I believe how we could address this in a different way, but I forgot.
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.
source
Outdated
| <dd> | ||
| <ol> | ||
| <li><p>Set the <code>script</code> element's <span>node document</span>'s <code | ||
| <li><p>if the <code>script</code> element is <span>in a document</span>, then set the |
|
It sounds like there's a separate issue (which I don't fully understand) illustrated by http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=4098. Fix the typo, file a new issue for that, and then this LGTM. |
|
If we land this now we should probably not close #762 and leave that until we have marked the event scoped. |
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.