Re: [fxtf-drafts] [geometry-1] Is a specific handling for Infinity implied by "NaN-safe minimum/maximum"? (#556)

This was kind of an obvious thing for me to overlook initially, but `-Infinity + Infinity` and `Infinity + -Infinity` are both NaN, which makes corresponding edges always be NaN: you're getting the minimum/maximum of ±Infinity and NaN, which is always NaN, by spec.

`planeBottomTopLeftRight` is the only remaining "surprising" case (`new DOMRect(Infinity, -Infinity, Infinity, -Infinity)`), but here we're summing like signs, (x: Infinity) + (width: Infinity) and (y: -Infinity) + (height: -Infinity), so no NaN is involved and normal minimum/maximum logic applies. This is also, uh, an error in my chart, since really this just means "the top-right quadrant relative to (Infinity, -Infinity)" — the correct plane definition here would be `new DOMRect(-Infinity, Infinity, Infinity, -Infinity)`.

I don't believe it's possible to represent a plane with DOMRect - on a practical level because those involve opposing infinities (so bounds always perform min/max with NaN), and on a theoretical level because planes don't fundamentally express an origin, they're just the dimension space. DOMRect is always in terms of an origin point (a DOMRect could be described as "the positive or negative width/height extending away from an origin x/y").

-- 
GitHub Notification of comment by towerofnix
Please view or discuss this issue at https://github.com/w3c/fxtf-drafts/issues/556#issuecomment-1986901031 using your GitHub account


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

Received on Saturday, 9 March 2024 16:13:36 UTC