-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 script #1100
Merged
Merged
Shadow script #1100
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2166,6 +2166,12 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d | |
data-x="concept-node-remove-ext">removing steps</span> are invoked with it as argument and it is | ||
now no longer <span>in a document</span>.</p> | ||
|
||
<p>A <dfn>node is connected</dfn> when the <span data-x="concept-node-insert-ext">insertion | ||
steps</span> are invoked with it as argument and it is now <span>in a shadow-including | ||
document</span>. Analogously, a <dfn>node is disconnected</dfn> when the <span | ||
data-x="concept-node-remove-ext">removing steps</span> are invoked with it as argument and it is | ||
now no longer <span>in a shadow-including document</span>.</p> | ||
|
||
|
||
<h4>Scripting</h4> | ||
|
||
|
@@ -58533,23 +58539,21 @@ o............A....e | |
<hr> | ||
|
||
<p>When a <code>script</code> element that is not marked as being <span>"parser-inserted"</span> | ||
experiences one of the events listed in the following list, the user agent must <span>immediately</span> | ||
<span data-x="prepare a script">prepare</span> the <code>script</code> element:</p> | ||
experiences one of the events listed in the following list, the user agent must | ||
<span>immediately</span> <span data-x="prepare a script">prepare</span> the <code>script</code> | ||
element:</p> | ||
|
||
<ul> | ||
|
||
<li>The <code>script</code> element gets <span data-x="node is inserted into a document">inserted | ||
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> | ||
|
||
<li>The <code>script</code> element is <span>in a <code>Document</code></span> and a node or | ||
<li>The <code>script</code> element is <span>in a shadow-including document</span> and a node or | ||
document fragment is <span data-x="nodes are inserted">inserted</span> into the | ||
<code>script</code> element, after any <code>script</code> elements <span data-x="nodes are | ||
inserted">inserted</span> at that time.</li> | ||
|
||
<li>The <code>script</code> element is <span>in a <code>Document</code></span> and has a <code | ||
data-x="attr-script-src">src</code> attribute set where previously the element had no such | ||
<li>The <code>script</code> element is <span>in a shadow-including document</span> and has a | ||
<code data-x="attr-script-src">src</code> attribute set where previously the element had no such | ||
attribute.</li> | ||
|
||
</ul> | ||
|
@@ -59121,9 +59125,10 @@ o............A....e | |
<dt>"<code data-x="">classic</code>"</dt> | ||
<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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Uppercase I |
||
<code>script</code> element's <span>node document</span>'s <code | ||
data-x="dom-document-currentScript">currentScript</code> attribute to the | ||
<code>script</code> element.</p></li> | ||
<code>script</code> element. Otherwise, set it to null.</p></li> | ||
|
||
<li><p><span data-x="run a classic script">Run the classic script</span> given by <span | ||
data-x="concept-script-script">the script's script</span>.</p></li> | ||
|
@@ -59167,6 +59172,7 @@ o............A....e | |
|
||
<p>Otherwise <span>queue a task</span> to <span>fire a simple event</span> named <code | ||
data-x="event-load">load</code> at the <code>script</code> element.</p> | ||
<!-- Shadow TODO: this event needs to be scoped --> | ||
|
||
</li> | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the rremoval of the ", at the time..." clause here problematic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.