Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change gentest to only write position relative to parent
Summary: `child.offsetLeft/Top` calculates the offset from child to its nearest positioned ancestor, not its direct parent. These are often the same and have not mattered in the past since we have not supported position static. Since are are in the process of supporting that, we would like our tests to be usable so this adjusts the gentest methodology to only speak the same language as Yoga - that is left/top are always relative to direct parents. It works by using `getBoundingClientRect().left/top` instead. Then we pass that down to children and subtract it from the childs `getBoundingClientRect()` to get the position relative to the parent. Note we have to round the final result as `child.offsetLeft/Top` is rounded. Reviewed By: NickGerleman Differential Revision: D51053629 fbshipit-source-id: 8809588d12953565228ae50fdf38197213c46182
- Loading branch information