WICG / layout-instability

A proposal for a Layout Instability specification
https://wicg.github.io/layout-instability/
Other
159 stars 27 forks source link

Resolve confusion from equal previous/current rects #109

Open npm1 opened 3 years ago

npm1 commented 3 years ago

Currently, if a node is large enough, it may shift while previous and current rects remain equal. This may happen due to the offset of the element changing. For example, consider an element which is much longer than the viewport height, and consider a completely vertical shift. The element occupies the full viewport vertically before and after the shift. However, there is a shift because the element moved and the content within the element shifted. The API currently will show previous and current rects that are equal, which is confusing. Hence, it would be good to expose something like the offset of the element in order to avoid developer confusion.