Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
domfarolino committed May 31, 2024
1 parent 7a06b38 commit ffa0b2e
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -2662,30 +2662,29 @@ do these things asynchronously, however.
const script = fragment.appendChild(document.createElement('script'));
const style = fragment.appendChild(document.createElement('style'));

script.innerText= 'console.log(getComputedStyle(h1).color)'; // Prints 'rgb(255, 0, 0)'
script.innerText= 'console.log(getComputedStyle(h1).color)'; // Logs 'rgb(255, 0, 0)'
style.innerText = 'h1 {color: rgb(255, 0, 0);}';

document.body.append(fragment);
</code></pre>

<p>The script in the above example prints <code class=lang-javascript>'rgb(255, 0, 0)'</code>
because the following happen in order:
<p>The script in the above example logs <code class=lang-javascript>'rgb(255, 0, 0)'</code> because
the following happen in order:

<ol>
<li>
<p>The <a for=/>insert</a> algorithm runs, which will insert the <{script}> and <code><a element
spec=HTML>style</a></code> elements in order.
<li><p>The <a for=/>insert</a> algorithm runs, which will insert the <{script}> and <code>
<a element spec=HTML>style</a></code> elements in order.

<ol>
<li>The HTML Standard's <a>insertion steps</a> run for the <{script}> element; they do nothing.
[[!HTML]]
<li><p>The HTML Standard's <a>insertion steps</a> run for the <{script}> element; they do
nothing. [[!HTML]]

<li>The HTML Standard's <a>insertion steps</a> run for the <code><a element
spec=HTML>style</a></code> element; they immediately apply its style rules to the document.
[[!HTML]]
<li><p>The HTML Standard's <a>insertion steps</a> run for the <code>
<a element spec=HTML>style</a></code> element; they immediately apply its style rules to the
document. [[!HTML]]

<li>The HTML Standard's <a>post-connection steps</a> run for the <{script}> element; they run the
script, which immediately observes the style rules that were applied in the above step.
<li><p>The HTML Standard's <a>post-connection steps</a> run for the <{script}> element; they run
the script, which immediately observes the style rules that were applied in the above step.
[[!HTML]]
</ol>
</li>
Expand Down Expand Up @@ -2812,8 +2811,7 @@ before a <var>child</var>, with an optional <i>suppress observers flag</i>, run
<li><p>Run the <a>children changed steps</a> for <var>parent</var>.

<li>
<p>Let <var>staticNodeList</var> be a <a for=/>list</a> of <a for=/>nodes</a>, initially
empty.</p>
<p>Let <var>staticNodeList</var> be a <a for=/>list</a> of <a for=/>nodes</a>, initially « ».</p>

<p class="note">We collect all <a for=/>nodes</a> <em>before</em> calling the <a>post-connection
steps</a> on any one of them, instead of calling the <a>post-connection steps</a> <em>while</em>
Expand All @@ -2832,7 +2830,7 @@ before a <var>child</var>, with an optional <i>suppress observers flag</i>, run
</ol>
</li>

<li><p><a for=list>For each</a> <var>node</var> in <var>staticNodeList</var>, if <var>node</var> is
<li><p><a for=list>For each</a> <var>node</var> of <var>staticNodeList</var>, if <var>node</var> is
<a>connected</a>, then run the <a>post-connection steps</a> with <var>node</var>.
</ol>

Expand Down

0 comments on commit ffa0b2e

Please sign in to comment.