It seems as though the iframe height calculation is bugged and very noticeable when the embedded HTML doesn't contain a lot of content. This wasn't the case in Moodle 2.6 – only seems to be after upgrading to Moodle 3.1. We were able to replicate this on a client's site as well as an internal site.
How to replicate:
- Add a File resource to a course.
- Name it anything.
- Place a HTML file in the "Select files" section with filler content in it.
- Set Appearance -> Display -> Embed
- View the file.
https://imgur.com/a/9bGZa – this album contains some screenshots of what's occurring.