Re: [whatwg/dom] Introduce DOM post-insertion steps (PR #1261)

@annevk commented on this pull request.



> + const h1 = document.querySelector('h1');
+
+ const fragment = new DocumentFragment();
+ 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)'
+ 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:
+
+  <ol>

No, this one is still wrong. I think you ended up changing a different list and you did revert that one now.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/pull/1261#discussion_r1551718105
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/dom/pull/1261/review/1979956858@github.com>

Received on Thursday, 4 April 2024 13:45:35 UTC