wiki:QtWebKitLayoutInteraction

Layout and Interaction in QQuickWebView (with resizeToContent)

Layout and interaction in combination with tiling/resizeToContent is a complicated situation.

Basically we want the following:

a) Fixed layout, inform WebCore of visible area

b) Only substitute page when something is ready to be shown.

For a) we need to make sure that we set the viewport size, the useFixedLayout and the layout size before doing *any* layouts. This is currently not handled correctly.

For b) we need to ignore size changed and layouts before we have had our first non-empty visual layout. We are in a transition phase and the dom has been substituted, and for that we need to ignore sending events to the web process such as informing the current visible area.

History is a part for it self, and we need to make sure a.o. things that the stored position and scale are first applied when we have something visible and that we are able to actually scroll to that position.

Rotation should work fine during page transitions, as we suspend before rotating and the relayout for the final viewport will still be guarded by the first non-empty visual layout.

Before any layout, the following needs to be true:

  • viewport size is set correctly
  • viewport constrains have been computed (either from viewport meta or an implicit viewport)
  • fixed layout is turned on, together with paints entire content and scroll delegation

When in transition to new page:

  • do not send updates on visual content rect to the web process
  • ignore (queue?) content size changes
  • ignore (queue?) viewport property changes (minimum-scale etc)
  • do not send event to the web process (mouse, touch)

When do we substitute our view:

  • first non empty visual layout finished
  • page isn't suspended (no interaction with page, nor in background)

When we substitute our view, we need to:

  • apply content size, scale, history position or (0, 0)
  • inform web process of the current visible content rect
  • reset interaction engine

When the page crashes:

  • viewport size is set correctly on new page
  • set to transition to new page... we need the same properties.

Last modified 5 years ago Last modified on Nov 16, 2011 8:01:47 AM