Determine the frame structure

Review: http://codereview.adblockplus.org/5172657418928128/