Skip to content

Commit ae3af0d

Browse files
committed
empty string range should give ClientRect too
1 parent 5904c58 commit ae3af0d

2 files changed

Lines changed: 21 additions & 18 deletions

File tree

cssom-view/Overview.html

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,8 @@ <h2 id=the-documentview-interface><span class=secno>6 </span>The <code
592592
href="#viewport">viewport</a> width, <var title="">y</var> is greather
593593
than the <a href="#viewport">viewport</a> height, or no insertion point
594594
indicator would have been inserted, the method <em class=ct>must</em>
595-
return <code>null</code>. [<cite><a href="#ref-dom2tr">DOM2TR</a></cite>]
595+
return <code>null</code>. [<cite><a href="#ref-dom2tr">DOM2TR</a></cite>]</p>
596+
<!-- https://bugs.webkit.org/show_bug.cgi?id=27046 -->
596597

597598
<p class=note>The specifics of hit testing are out of scope of this
598599
specification and therefore the exact details of <code><a
@@ -1083,7 +1084,7 @@ <h2 id=extensions-to-the-range-interface><span class=secno>9
10831084
title=dom-range-getclientrects><code>getClientRects()</code></dfn> method,
10841085
when invoked, <em class=ct>must</em> return an empty <code><a
10851086
href="#clientrectlist">ClientRectList</a></code> object if the range is
1086-
empty (if the boundary-points are identical) and otherwise a <code><a
1087+
not in the document and otherwise a <code><a
10871088
href="#clientrectlist">ClientRectList</a></code> object containing a list
10881089
of <code><a href="#clientrect">ClientRect</a></code> objects in content
10891090
order that matches the following constraints:
@@ -1095,12 +1096,13 @@ <h2 id=extensions-to-the-range-interface><span class=secno>9
10951096
element.
10961097

10971098
<li>For each <code>Text</code> node selected or partially selected by the
1098-
range, include a <code><a href="#clientrect">ClientRect</a></code> object
1099-
(for the part that is selected, not the whole line box). The bounds of
1100-
these <code><a href="#clientrect">ClientRect</a></code> objects are
1101-
computed using font metrics; thus, for horizontal writing, the vertical
1102-
dimension of each box is determined by the font ascent and descent, and
1103-
the horizontal dimension by the text advance width.
1099+
range (including when the boundary-points are identical), include a
1100+
<code><a href="#clientrect">ClientRect</a></code> object (for the part
1101+
that is selected, not the whole line box). The bounds of these <code><a
1102+
href="#clientrect">ClientRect</a></code> objects are computed using font
1103+
metrics; thus, for horizontal writing, the vertical dimension of each box
1104+
is determined by the font ascent and descent, and the horizontal
1105+
dimension by the text advance width.
11041106
</ul>
11051107

11061108
<p>The <dfn id=dom-range-getboundingclientrect

cssom-view/Overview.src.html

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,8 @@ <h2 id="the-documentview-interface">The <code title="">DocumentView</code> Inter
479479
<span>viewport</span> height, or no insertion point indicator would have
480480
been inserted, the method <em class="ct">must</em> return
481481
<code>null</code>. [<cite><span>DOM2TR</span></cite>]</p>
482+
483+
<!-- https://bugs.webkit.org/show_bug.cgi?id=27046 -->
482484

483485
<p class="note">The specifics of hit testing are out of scope of this
484486
specification and therefore the exact details of
@@ -919,24 +921,23 @@ <h2 id="extensions-to-the-range-interface">Extensions to the <code title="">Rang
919921
<p>The
920922
<dfn id="dom-range-getclientrects" title="dom-range-getclientrects"><code>getClientRects()</code></dfn>
921923
method, when invoked, <em class="ct">must</em> return an empty
922-
<code>ClientRectList</code> object if the range is empty (if the
923-
boundary-points are identical) and otherwise a
924-
<code>ClientRectList</code> object containing a list of
924+
<code>ClientRectList</code> object if the range is not in the document and
925+
otherwise a <code>ClientRectList</code> object containing a list of
925926
<code>ClientRect</code> objects in content order that matches the
926927
following constraints:</p>
927-
928+
928929
<ul>
929930
<li>For each element selected by the range, whose parent is not selected
930931
by the range, include the border boxes returned by invoking
931932
<code>getClientRects()</code> on the element.</li>
932933

933934
<li>For each <code>Text</code> node selected or partially selected by the
934-
range, include a <code>ClientRect</code> object (for the part that is
935-
selected, not the whole line box). The bounds of these
936-
<code>ClientRect</code> objects are computed using font metrics; thus,
937-
for horizontal writing, the vertical dimension of each box is determined
938-
by the font ascent and descent, and the horizontal dimension by the text
939-
advance width.</li>
935+
range (including when the boundary-points are identical), include a
936+
<code>ClientRect</code> object (for the part that is selected, not the
937+
whole line box). The bounds of these <code>ClientRect</code> objects are
938+
computed using font metrics; thus, for horizontal writing, the vertical
939+
dimension of each box is determined by the font ascent and descent, and
940+
the horizontal dimension by the text advance width.</li>
940941
</ul>
941942

942943
<p>The

0 commit comments

Comments
 (0)