Fixed calculations for elements visibility on viewports
Removed unused document reference
Merge branch 'scrollable-viewports' into develop