w3c / IntersectionObserver

Intersection Observer
https://www.w3.org/TR/intersection-observer/
Other
3.62k stars 526 forks source link

Percentage rootMargin resolution is unclear #391

Closed flackr closed 3 years ago

flackr commented 4 years ago

Section 2.2 says that percentages in rootMargin are resolved relative to the width of the undilated rectangle - however it seems that percentages on the top and bottom rootMargin values are indeed resolved relative to the height as in this demo where the intersection rectangle ends at 10% of the height of the scroller.

I couldn't find any other section about how percentages are resolved so I initially was expecting even the top/bottom percentages to resolve against the width.

szager-chromium commented 3 years ago

This sounds like a chromium bug, not a spec issue. I filed a chromium bug:

https://bugs.chromium.org/p/chromium/issues/detail?id=1138031