Re: [csswg-drafts] getVisibleClientRect API analogous to getBoundingClientRect (#13294)

@ExtAnimal The request for an API that returns the visible visible rect sounds very related to #6132, where you also commented. What would be the difference between the two?

> How about these new methods?
> 
> ```
> newRect = firstRect.intersection(secondRect, thirdRect, ...);
> ```
> 
> ```
> newRect = firstRect.union(secondRect, thirdRect, ...);
> ```
> 
> ```
> isWithin = firstRect.contains(secondRect);
> ```

Those seem to go beyond your initial use case, though I agree those can be useful in some cases. And I think there were already some discussions related to such functions, but I can't find them right now.

Besides the points @emilio raised, I am wondering what you'd expect the `union()` function to return. I assume, you mean the bounding rect around all the given rects. Correct?

Sebastian

-- 
GitHub Notification of comment by SebastianZ
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13294#issuecomment-3868204942 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Sunday, 8 February 2026 20:26:05 UTC