jonleighton/poltergeist — Issue #26: Compute click position in middle of element
Author: jonleighton
Created: 2012-02-23 10:08:17+00:00
State: open

Currently we try to click the very top-left pixel of an element. This can cause subtle issues with elements that may have e.g. negative margins etc, which cause the very top-left to be obscured wile the majority of the element is visible. Instead we should more intelligently compute the position of the middle of the element, as this is (presumably) the least likely position to be obscured. This needs to take scroll position into account - e.g. if the middle of the element is off the page, but part of it is on the page, then we should compute the middle position of the part of the element that is on the page.