- From: James Browning <notifications@github.com>
- Date: Sat, 20 Jun 2026 20:00:48 -0700
- To: whatwg/dom <dom@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/dom/issues/1472/4760732319@github.com>
Jamesernator left a comment (whatwg/dom#1472)
As described `.getWrappingColumns` is probably not that well defined when you take into account things like floats, whitespace collapsing around line endings, position absolute/fixed etc, slots, and probably a bunch of other CSS features that might result in boxes being unrelated to line wrapping.
Though given [`.getClientRects()`](https://developer.mozilla.org/en-US/docs/Web/API/Element/getClientRects) exists, it seems like there could just be a version of that API that gives back rects with their associated ranges and box kind. i.e. Something like:
```ts
interface Fragment {
boxKind: "line" | "block" | "etc";
// A line box might? consist of multiple ranges if there's an element removed from
// the line flow in the middle of the line (e.g. a float)
ranges: Array<StaticRange>;
// Same as from getClientRect
rect: DOMRect;
}
interface Element {
getClientFragments(): { boxKind: "line" | "", rect: DOMRect }[]
}
```
This should probably be an issue in the [CSSWG](https://github.com/w3c/csswg-drafts/issues) though as this spec is purely for DOM-tree operations.
--
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/1472#issuecomment-4760732319
You are receiving this because you are subscribed to this thread.
Message ID: <whatwg/dom/issues/1472/4760732319@github.com>
Received on Sunday, 21 June 2026 03:00:52 UTC