Skip to content
This repository was archived by the owner on Jul 27, 2018. It is now read-only.
This repository was archived by the owner on Jul 27, 2018. It is now read-only.

We need a way to smoothly change the viewport without resizing the iframe from the parent process #355

Closed

Description

@paulrouget

Changing the viewport means changing the "visible" area of an iframe ("visible" in quotes because if the viewport doesn't match the size of the iframe, the extra content would still be visible). Afaik, the only way to do that is to combine scrolling the content and resizing the iframe.

Scrolling and resizing operations involve 3 things:

  • DOM events (onscroll & onresize)
  • restyle & reflow (triggered by resize)
  • composition operations

We want this to be fast and smooth. The important bit is to ensure that the content-related composition operations, and any other main-process animation (chrome UI), are part of a same transaction.

An example of what we could do: the parent process could animate a toolbar sliding from the top (part of the chrome interface), covering the iframe. If the toolbar is half transparent, we would see the content behind the toolbar, but also, any fixed positioned element in the content would smoothly be pushed down by the toolbar (so a portion of the content above the top:0 element would still be rendered and painted).

If I'm not mistaken, all of that could be doable only in the main process, as it's all compositor operations.

DOM events and restyle & reflows would happen later, once the animation is done.

Does that make sense?
Is that possible?

Activity

  1. paulrouget commented on May 5, 2015

    @paulrouget
    ContributorAuthor
  2. paulrouget commented on May 5, 2015

    @paulrouget
    ContributorAuthor

    A maybe more simple and short term approach would to be able to sync 2 scroll operations. Basically, parent process and child process should be able to call scrollBy({behavior:smooth}) and make both scroll operations part of the same transaction (see https://groups.google.com/forum/?fromgroups#!topic/mozilla.dev.platform/K_NhNWVKOPI).

  3. self-assigned this
    on May 6, 2015
  4. paulrouget commented on Jun 17, 2015

    @paulrouget
    ContributorAuthor

    Note to self: setContentDocumentFixedPositionMargins allows us to set the viewport size.

  5. Gozala commented on Aug 7, 2015

    @Gozala
    Contributor
  6. paulrouget commented on Aug 7, 2015

    @paulrouget
    ContributorAuthor

    This problem is not specific to Browser.html. Both Fennec and Gaia have related issues. Kartikaya has been working on a solution to this problem. See bug 1180295. Kats’ approach is fully described here: https://bug1180295.bmoattachments.org/attachment.cgi?id=8630517. We want to go for Model 3.

  7. Gozala commented on Jan 12, 2016

    @Gozala
    Contributor

    @paulrouget I assume that keeping this issue open here is not going to help & there for close it. Feel free to reopen if you disagree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions