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

Throw correct exceptions from collapse/selectAllChildren on detached doctypes #86

Closed
wants to merge 1 commit into from
Closed
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
28 changes: 21 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -353,12 +353,16 @@ <h2><dfn>Selection</dfn> interface</h2>
<p>The method must follow these steps:</p>
<ol>
<li>If <var>node</var> is null, this method must behave identically as <code>removeAllRanges()</code> and abort these steps.</li>
<li>The method must throw an <a>IndexSizeError</a> exception if <var>offset</var> is longer than <var>node</var>'s
<dfn><a href="http://www.w3.org/TR/dom/#concept-node-length">length</a></dfn> ([[!DOM4]]) and abort these steps.</li>
<li>If <var>node</var>'s <a>root</a> is not the <a>document</a> associated with the <a>context object</a>, abort these steps.</li>
<li>Otherwise, let <var>newRange</var> be a new <a>range</a>.</li>
<li>Let <var>newRange</var> be a new <a>range</a>.</li>
<li><dfn id="range-set"><a href="http://www.w3.org/TR/dom/#concept-range-bp-set">Set</a></dfn> ([[!DOM4]])
the <a href="#range-start">start</a> and the <a href="#range-end">end</a> of <var>newRange</var> to (<var>node</var>, <var>offset</var>).</li>
<li>
<p>If <var>node</var>'s <a>root</a> is not the <a>document</a>
associated with the <a>context object</a>, abort these steps.

<p class=note>We do this after creating the range so that the
proper exceptions are thrown.
</li>
<li>Set the <a>context object</a>'s <a>range</a> to <var>newRange</var>.</li>
</ol>
</dd>
Expand Down Expand Up @@ -444,10 +448,20 @@ <h2><dfn>Selection</dfn> interface</h2>
<dd>
<p>The method must follow these steps:</p>
<ol>
<li>If <var>node</var>'s <a>root</a> is not the <a>document</a> associated with the <a>context object</a>, abort these steps.</li>
<li>Let <var>newRange</var> be a new <a>range</a> and <var>nodeLength</var> be the <a>length</a> of <var>node</var>.</li>
<li>Set <var>newRange</var>'s <a href="#range-start">start</a> to (<var>node</var>, <code>0</code>).</li>
<li>Set <var>newRange</var>'s <a href="#range-end">end</a> to (<var>node</var>, <var>nodeLength</var>).</li>
<li><a href="#range-set">Set</a> <var>newRange</var>'s
<a href="#range-start">start</a> to (<var>node</var>,
<code>0</code>).</li>
<li><a href="#range-set">Set</a> <var>newRange</var>'s
<a href="#range-end">end</a> to (<var>node</var>,
<var>nodeLength</var>).</li>
<li>
<p>If <var>node</var>'s <a>root</a> is not the <a>document</a>
associated with the <a>context object</a>, abort these steps.

<p class=note>We do this after creating the range so that the
proper exceptions are thrown.
</li>
<li>Set the <a>context object</a>'s <a>range</a> to <var>newRange</var>.</li>
<li>Set the <a>context object</a>'s <a>direction</a> to <var>forwards</var>.</li>
</ol>
Expand Down