Skip to content

Commit

Permalink
Throw InvalidNodeTypeError for doctype more eagerly
Browse files Browse the repository at this point in the history
This matches how major engines behave and is covered by multiple
tests in WPT already.

Closes #118.
  • Loading branch information
awesomekling authored and rniwa committed Nov 20, 2024
1 parent 97a072c commit 387e724
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,9 @@ <h2>
<li>If <var>node</var> is null, this method must behave identically
as <code>removeAllRanges()</code> and abort these steps.
</li>
<li>If <var>node</var> is a {{DocumentType}}, throw an
{{InvalidNodeTypeError}} exception and abort these steps.
</li>
<li>The method must throw an {{IndexSizeError}} exception if <var>
offset</var> is longer than <var>node</var>'s [=Node/length=] and
abort these steps.
Expand Down Expand Up @@ -625,6 +628,9 @@ <h2>
The method must follow these steps:
</p>
<ol>
<li>If <var>node</var> is a {{DocumentType}}, throw an
{{InvalidNodeTypeError}} exception and abort these steps.
</li>
<li>If <var>node</var>'s [=tree/root=] is not the <a>document</a>
associated with [=this=], abort these steps.
</li>
Expand Down

0 comments on commit 387e724

Please sign in to comment.