jasmine.Popup trimHeight reduces height if there is not enough space on the edge (from jasmine.specs)