Skip to content
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

Call out inconsistency in document.body behavior #3449

Merged
merged 2 commits into from
Feb 12, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -9606,6 +9606,23 @@ partial interface <dfn id="document" data-lt="">Document</dfn> {

</ol>

<p class="note">The value returned by the <code data-x="dom-document-body">body</code> getter is
not always the one passed to the setter.</p>

<div class="example">
<p>In this example, the setter successfully inserts a <code>body</code> element (though this is
non-conforming since SVG does not allow a <code>body</code> as child of <span>SVG
<code>svg</code></span>). However the getter will return null because the document element is not
<code>html</code>.</p>

<pre>&lt;svg xmlns="http://www.w3.org/2000/svg">
&lt;script>
document.body = document.createElementNS("http://www.w3.org/1999/xhtml", "body");
console.assert(document.body === null);
&lt;/script>
&lt;/svg></pre>
</div>

</div>

<hr>
Expand Down