Add getClientRects to fragment instances#32660
Conversation
|
Comparing: c69a5fc...e9375b4 Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: (No significant changes) |
| blur(): void, | ||
| observeUsing(observer: IntersectionObserver | ResizeObserver): void, | ||
| unobserveUsing(observer: IntersectionObserver | ResizeObserver): void, | ||
| getClientRects(): ChildRectLists, |
There was a problem hiding this comment.
This should really be Array<DOMRect> and we have to flatten it.
Otherwise you can't pass this instance to an API expecting an Element that it reads the rects from. Whatever methods that already exist on Elements need to have the same exact signature (almost).
Technically it should be a DOMRectList which is array-like but it doesn't have the prototype of an actual array. It also has an item() method that arrays don't have. Unfortunately you can't instantiate one of these yourself very easily but in practice we can expect that consumers use the array-like indexing.
So I think it's ok for this to be a flat Array<DOMRect>.
38f410a to
e9375b4
Compare
Adds
getClientRects()to fragment instances with a fixture test case.Element.getClientRectreturns a collection ofDOMRects (see example of multiline span returning twoDOMRectboxes).fragmentInstance.getClientRectshere flattens those collections into an array of rects.