This patch is a preliminary refactoring to make it simpler to pass additional information to the C++ side and should not affect behavior. In a followup patch the widget glue will have special handling for frames that need to be rendered but not presented. Differential Revision: https://phabricator.services.mozilla.com/D245564