Position: Avoid reading overflow css on documents

Fixes #9533
Closes gh-1072
(cherry picked from commit 1bbbcc723c489d7ef7d72bb62564b8f07805c41c)