Skip to content

Commit cbbbbe9

Browse files
authored
Editorial: abstract getting the common ancestor
Fixes #56.
1 parent 8f31446 commit cbbbbe9

1 file changed

Lines changed: 12 additions & 11 deletions

File tree

dom.bs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9217,19 +9217,24 @@ to set <a>this</a>'s <a for=range>start</a> and <a for=range>end</a> to
92179217
</dl>
92189218

92199219
<div algorithm>
9220-
<p>The <dfn attribute for=Range><code>commonAncestorContainer</code></dfn> getter steps are:
9220+
<p>To <dfn>get the common ancestor</dfn> of a <a>live range</a> <var>range</var>:
92219221

92229222
<ol>
9223-
<li><p>Let <var>container</var> be <a for=range>start node</a>.
9223+
<li><p>Let <var>container</var> be <var>range</var>'s <a for=range>start node</a>.
92249224

92259225
<li><p>While <var>container</var> is not an <a for=tree>inclusive ancestor</a> of
9226-
<a for=range>end node</a>: set <var>container</var> to <var>container</var>'s
9226+
<var>range</var>'s <a for=range>end node</a>: set <var>container</var> to <var>container</var>'s
92279227
<a for=tree>parent</a>.
92289228

92299229
<li><p>Return <var>container</var>.
92309230
</ol>
92319231
</div>
92329232

9233+
<div algorithm>
9234+
<p>The <dfn attribute for=Range><code>commonAncestorContainer</code></dfn> getter steps are to
9235+
return the result of <a>getting the common ancestor</a> of <a>this</a>.
9236+
</div>
9237+
92339238
<hr>
92349239

92359240
<div algorithm>
@@ -9587,10 +9592,8 @@ method steps are:
95879592
<li>Return <var>fragment</var>.
95889593
</ol>
95899594

9590-
<li><p>Let <var>commonAncestor</var> be <var>originalStartNode</var>.
9591-
9592-
<li><p>While <var>commonAncestor</var> is not an <a for=tree>inclusive ancestor</a> of
9593-
<var>originalEndNode</var>: set <var>commonAncestor</var> to its own <a for=tree>parent</a>.
9595+
<li><p>Let <var>commonAncestor</var> be the result of <a>getting the common ancestor</a> of
9596+
<var>range</var>.
95949597

95959598
<li><p>Let <var>firstPartiallyContainedChild</var> be null.
95969599

@@ -9792,10 +9795,8 @@ of a <a>live range</a> <var>range</var>:
97929795
<li><p>Return <var>fragment</var>.
97939796
</ol>
97949797

9795-
<li><p>Let <var>commonAncestor</var> be <var>originalStartNode</var>.
9796-
9797-
<li><p>While <var>commonAncestor</var> is not an <a for=tree>inclusive ancestor</a> of
9798-
<var>originalEndNode</var>: set <var>commonAncestor</var> to its own <a for=tree>parent</a>.
9798+
<li><p>Let <var>commonAncestor</var> be the result of <a>getting the common ancestor</a> of
9799+
<var>range</var>.
97999800

98009801
<li><p>Let <var>firstPartiallyContainedChild</var> be null.
98019802

0 commit comments

Comments
 (0)