check element exists first
Merge pull request #5919 from guardian/bounding-client-bug

Check ScrollDepth element exists first