From d4a94e8c29a00bf7e5d865d6df2003389039a3f4 Mon Sep 17 00:00:00 2001 From: Stephanie Zhang Date: Mon, 6 Oct 2025 16:50:53 -0500 Subject: [PATCH 1/3] initial changes --- cssom-view-1/Overview.bs | 47 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/cssom-view-1/Overview.bs b/cssom-view-1/Overview.bs index 9376d0d3cb2..2bbd7c80295 100644 --- a/cssom-view-1/Overview.bs +++ b/cssom-view-1/Overview.bs @@ -2006,6 +2006,10 @@ partial interface Range { }; + + The getClientRects() method, when invoked, must return an empty {{DOMRectList}} object if the range is not in the document and otherwise a {{DOMRectList}} object containing a list of {{DOMRect}} objects in content order that matches the following constraints: @@ -2044,6 +2048,49 @@ Note: The {{DOMRect}} object returned by {{Range/getBoundingClientRect()}} is no range-bounding-client-rect-with-display-contents.html +

FormControlRange geometry

+ +

This section defines {{FormControlRange/getClientRects()}} and +{{FormControlRange/getBoundingClientRect()}}. The {{FormControlRange}} interface is defined in +[[DOM]]. These methods mirror {{Range/getClientRects()}} and {{Range/getBoundingClientRect()}}, but +apply to the selected portion of a text control’s value.

+ +
+

The getClientRects() method, when invoked, must run these +steps:

+
    +
  1. If the associated control is not connected or its computed display is + none, return an empty {{DOMRectList}}.

  2. +
  3. Update style and layout for the associated control.

  4. +
  5. Let start and end be this range’s boundary offsets, clamped to the + current length of the control’s value.

  6. +
  7. Let text be the single text node that backs the control’s editable value. If there + is no such node, return an empty {{DOMRectList}}.

  8. +
  9. Let r be a {{Range}} whose start and end are (text, start) + and (text, end).

  10. +
  11. Return r.{{Range/getClientRects()}}.

  12. +
+
+ +
+

The getBoundingClientRect() method, when invoked, must run +these steps:

+
    +
  1. Let rects be the result of {{FormControlRange/getClientRects()}}.

  2. +
  3. +

    If rects is empty:

    +
      +
    1. If this range is {{AbstractRange/collapsed}} and the control is visible (its computed + display is not none), return a zero-width {{DOMRect}} positioned at the + caret, whose height equals the line height at that position.

    2. +
    3. Otherwise, return a {{DOMRect}} with zero width and height.

    4. +
    +
  4. +
  5. Otherwise, return the union of the rectangles in rects, as for + {{Range/getBoundingClientRect()}}.

  6. +
+
+

Extensions to the {{MouseEvent}} Interface

Issue: The object IDL fragment redefines some members. Can we resolve this somehow? From 09c8acb7fb60b8944967b63b8253f70113605775 Mon Sep 17 00:00:00 2001 From: Stephanie Y Zhang Date: Mon, 6 Oct 2025 15:10:10 -0700 Subject: [PATCH 2/3] updates --- cssom-view-1/Overview.bs | 60 ++++++++++++++++++++++++++++------------ 1 file changed, 43 insertions(+), 17 deletions(-) diff --git a/cssom-view-1/Overview.bs b/cssom-view-1/Overview.bs index 2bbd7c80295..5b2d74f7497 100644 --- a/cssom-view-1/Overview.bs +++ b/cssom-view-1/Overview.bs @@ -2051,23 +2051,40 @@ Note: The {{DOMRect}} object returned by {{Range/getBoundingClientRect()}} is no

FormControlRange geometry

This section defines {{FormControlRange/getClientRects()}} and -{{FormControlRange/getBoundingClientRect()}}. The {{FormControlRange}} interface is defined in -[[DOM]]. These methods mirror {{Range/getClientRects()}} and {{Range/getBoundingClientRect()}}, but -apply to the selected portion of a text control’s value.

+{{FormControlRange/getBoundingClientRect()}} for {{FormControlRange}} (interface defined in [[DOM]]). +They mirror {{Range/getClientRects()}} and {{Range/getBoundingClientRect()}}, but operate on the +selected portion of a text control’s value.

+ +

The IDL for these methods appears in [[DOM]]; it is not repeated here to avoid +duplication.

+ +

The associated control of a {{FormControlRange}} is the <textarea> or +text-supporting <input> whose editable value the range indexes into.

+ +

User agents typically represent the control’s value with a single internal text node. +If a future implementation were to use multiple nodes, this specification would need adjustment; +until then, algorithms assume a single backing text node.

+ +

Unlike {{Range/getClientRects()}}, which historically returns an empty list for a +collapsed {{Range}}, this specification explicitly preserves that legacy behavior for +{{FormControlRange/getClientRects()}}: a collapsed {{FormControlRange}} also returns an empty +{{DOMRectList}}. Authors that need caret metrics should use +{{FormControlRange/getBoundingClientRect()}}.

The getClientRects() method, when invoked, must run these steps:

    -
  1. If the associated control is not connected or its computed display is - none, return an empty {{DOMRectList}}.

  2. -
  3. Update style and layout for the associated control.

  4. -
  5. Let start and end be this range’s boundary offsets, clamped to the - current length of the control’s value.

  6. -
  7. Let text be the single text node that backs the control’s editable value. If there - is no such node, return an empty {{DOMRectList}}.

  8. -
  9. Let r be a {{Range}} whose start and end are (text, start) - and (text, end).

  10. +
  11. If the associated control is not connected or its computed display + is none, return an empty {{DOMRectList}}.

  12. +
  13. Update style and layout for the associated control.

  14. +
  15. Let value length be the current length of the associated control's value.

  16. +
  17. Let start be min(this range’s start boundary point offset, value length) + and end be min(this range’s end boundary point offset, value length).

  18. +
  19. If start > end, set end to start. This collapses backwards ranges per current implementations.

  20. +
  21. If start = end, return an empty {{DOMRectList}}.

  22. +
  23. Let text be the single text node that backs the control’s editable value. If none, return an empty {{DOMRectList}}.

  24. +
  25. Let r be a conceptual {{Range}} whose start is (text, start) and end is (text, end).

  26. Return r.{{Range/getClientRects()}}.

@@ -2080,17 +2097,26 @@ these steps:

  • If rects is empty:

      -
    1. If this range is {{AbstractRange/collapsed}} and the control is visible (its computed - display is not none), return a zero-width {{DOMRect}} positioned at the - caret, whose height equals the line height at that position.

    2. -
    3. Otherwise, return a {{DOMRect}} with zero width and height.

    4. +
    5. If this range is {{AbstractRange/collapsed}} and the associated control is visible + (its computed display is not none), return a zero-width [=scaled=] + {{DOMRect}} positioned at the caret (insertion point). Its block-size (height in horizontal + writing modes) is the line box block-size at that position, with any transforms that + apply to the control and its ancestors applied.

    6. +
    7. Otherwise, return a {{DOMRect}} whose {{DOMRect/x}}, {{DOMRect/y}}, {{DOMRect/width}}, and + {{DOMRect/height}} members are zero.

  • -
  • Otherwise, return the union of the rectangles in rects, as for +

  • Otherwise, return a {{DOMRect}} describing the smallest rectangle that includes every + rectangle in rects whose width or height is not zero, as for {{Range/getBoundingClientRect()}}.

  • +

    If implementations later expose a caret rectangle via +{{FormControlRange/getClientRects()}} for collapsed ranges, this section will be updated. Authors +SHOULD NOT rely on observing an empty list vs. a zero-width caret rectangle to detect collapse; +use {{AbstractRange/collapsed}}.

    +

    Extensions to the {{MouseEvent}} Interface

    Issue: The object IDL fragment redefines some members. Can we resolve this somehow? From fd9d120bda03c2e9d00aa0845a33964e98de5223 Mon Sep 17 00:00:00 2001 From: Stephanie Zhang Date: Thu, 16 Oct 2025 14:05:18 -0700 Subject: [PATCH 3/3] remove unnecessary sections and add links --- cssom-view-1/Overview.bs | 118 +++++++++++++++++++-------------------- 1 file changed, 58 insertions(+), 60 deletions(-) diff --git a/cssom-view-1/Overview.bs b/cssom-view-1/Overview.bs index 5b2d74f7497..37529cdf26b 100644 --- a/cssom-view-1/Overview.bs +++ b/cssom-view-1/Overview.bs @@ -56,6 +56,10 @@ spec:css-borders-4; type:property; text:border-top-width spec:css-borders-4; type:property; text:border-left-width spec:cssom-view-1; type:dictionary; text:MouseEventInit spec:cssom-view-1; type:dfn; for:MediaQueryList; text:media +spec:dom; type:interface; text:FormControlRange +spec:dom; type:method; for:FormControlRange; text:getClientRects() +spec:dom; type:method; for:FormControlRange; text:getBoundingClientRect() +spec:dom; type:dfn; for:FormControlRange; text:value string