Re: [csswg-drafts] [css-scroll-anchoring-1] Unclear whether a 0-size element at edge of region is eligible as anchor node or not (#3483)

One more note here it seems like it'd be nice to have this edge-case behavior be consistent with the similar edge case in the Intersection Observer spec ( https://www.w3.org/TR/intersection-observer/ ).

Over there, edge-adjacent 0-size rects *are* considered to be "inside" the intersection region. Quoting:
> 7. Let *isIntersecting* be true if *targetRect* and *rootBounds* intersect or are edge-adjacent, even if the intersection has zero area (because *rootBounds* or *targetRect* have zero area); otherwise, let *isIntersecting* be false.
> 8. If *targetArea* is non-zero, let *intersectionRatio* be *intersectionArea* divided by *targetArea*.
Otherwise, let *intersectionRatio* be 1 if *isIntersecting* is true, or 0 if *isIntersecting* is false.
https://www.w3.org/TR/intersection-observer/#update-intersection-observations-algo

So over there, in the edge-adjacent 0-sized rect case, we get *isIntersecting*=true, which then gives us *intersectionRatio*=1 (i.e. fully intersecting, fully "inside") due to the special-case "Otherwise" scenario for zero-area rects.

So, I'd suggest we follow suit here, and consider edge-adjacent 0-area rects (as well as entirely-enclosed 0-area rects) to be "inside".

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

Received on Monday, 7 January 2019 21:08:17 UTC