The elements from before the script have been created and added to the DOM, but the browser hasn't had a chance to render them (update the page display to show them) before the alert
brings the whole UI thread to a screeching halt. The browser is required to have created the elements and added them to the DOM; it is not required to have rendered them yet. Some will, some won't. Neither is "wrong."
We can readily prove that the first paragraph exists by looking for it and even reading its text:
<p>The Beginning...</p>
<script>
alert("Hello, World! First paragraph's text: " + document.querySelector("p").textContent);
</script>
<p>...The End Of Doc</p>
` element? Also, it's worth mentioning that the "blue dot behaviour" in the CodePen happens only in Chrome, not Safari.
– Gerardo Furtado Jun 09 '18 at 05:39