Skip to content

Commit 7dd1183

Browse files
committed
[cssom-view] Specify partial grapheme clusters for range.getClientRects()
Fixes https://www.w3.org/Bugs/Public/show_bug.cgi?id=29562 Ref. https://lists.w3.org/Archives/Public/www-style/2016Apr/0115.html
1 parent e711a2f commit 7dd1183

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

cssom-view/Overview.bs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1424,7 +1424,15 @@ static {{DOMRect}} objects in content order that matches the
14241424
following constraints:
14251425

14261426
* For each element selected by the range, whose parent is not selected by the range, include the border areas returned by invoking {{Element/getClientRects()}} on the element.
1427-
* For each {{Text}} node selected or partially selected by the range (including when the boundary-points are identical), include a {{DOMRect}} object (for the part that is selected, not the whole line box). The bounds of these {{DOMRect}} objects are computed using font metrics; thus, for horizontal writing, the vertical dimension of each box is determined by the font ascent and descent, and the horizontal dimension by the text advance width. The <a>transforms</a> that apply to the ancestors are applied.
1427+
* For each {{Text}} node selected or partially selected by the range (including when the
1428+
boundary-points are identical), include a {{DOMRect}} object (for the part that is selected, not
1429+
the whole line box). The bounds of these {{DOMRect}} objects are computed using font metrics;
1430+
thus, for horizontal writing, the vertical dimension of each box is determined by the font
1431+
ascent and descent, and the horizontal dimension by the text advance width. If the range covers
1432+
a partial <a spec=css-text>typographic character unit</a> (e.g. half a surrogate pair or part of
1433+
a grapheme cluster), the full <a spec=css-text>typographic character unit</a> must be included
1434+
for the purpose of computing the bounds of the relevant {{DOMRect}}. [[!CSS-TEXT-3]] The
1435+
<a>transforms</a> that apply to the ancestors are applied.
14281436

14291437
The <dfn method for=Range>getBoundingClientRect()</dfn> method, when invoked, must return the result of the following
14301438
algorithm:

0 commit comments

Comments
 (0)