So yes, the DOM itself contains what I and the poster before mentioned. It's the presentation layer that decides how to do space collapse.
As a bonus, you can also see that the DOM of the page has four children of `body`: `<div>`, then a text node with the content "\n\n", `<script>`, and another text node containing "\n".
Tested all this with a simple HTML I saved on disk and opened in Firefox.
I created a page like this:
And you'll see in the console: So yes, the DOM itself contains what I and the poster before mentioned. It's the presentation layer that decides how to do space collapse.As a bonus, you can also see that the DOM of the page has four children of `body`: `<div>`, then a text node with the content "\n\n", `<script>`, and another text node containing "\n".
Tested all this with a simple HTML I saved on disk and opened in Firefox.