jonleighton/poltergeist — pull request #379 by benalavi (2013-08-21 01:11:23+00:00)
Title: IFrame clicks don't take into account padding on the IFrame

Fixes #377 by calculating top and left padding on the iframe and adding that to the calculated frameOffset.

Calculates the padding using window.getComputedStyle so frames w/ no padding and frames w/ padding defined as em, %, etc... will also work.

Uses parseInt as the padding properties are ultimately returned as a string w/ "px" appended.

Caveat: I'm not an expert on the DOM API, so there may be a cleaner way to either get those padding values or get the calculated offset + padding in the first place.