Fixes within_frame for Cross Domain Frames

As per #183 but with a working spec and a better fix
Merge pull request #211 from errm/master

Fix within_frame with cross domain frames