sailfishos/sailfish-browser — pull request #46 by rainemak (2014-03-19 08:34:41+00:00)
Title: WIP: Real tabs support for browser

Working in progress pull requests for reviewing.

- Maximum number of real tabs is 5. Should we have an advanced settings for it with a meaningful description... Something like "Unlimited number of real tabs" (with a cost of memory consumption) / "Normal". 5 tabs was a number that I came up once running memory consumption measurements in real world scenarios.
- Tab is virtualized once it reaches 6th position in the grid (MRU). A virtual tab remembers its position / zoom level while browser running. Tab is resurrected to the previous position once activated from the tab grid. Position and zoom level are not persisted to the database (not available over browser launches). Virtualized tab loses its JS engine state.
- Back / forward navigation is do through gecko when QuickMozView instance can used for navigation. In other cases, navigation is based on data that we have in database.
- Once tab is closed, memory is released. QuickMozView instances are not kept in pool. This way we get always clean instance when tab is activated (relates to back / forward navigation and visual appearance).
- Only one tab active (resumed state) and visible at the time. When activating a tab the tab is resumed and made visible and the previous active tab is suspended and made invisible. Opening a new window (tab) through window.open() does an exception here so that then parent window (tab) is kept alive.

There are following topics that we should do. Not necessarily immediate actions needed but in my opinion would be still best to do these fast so that we don't start building up more too much new stuff on top of these.

- TabModel should be merged with DeclarativeTabModel. This was fastest approach to do up to this point.
- WebViewTabCache.js (pragma) should be merged with DeclarativeTabModel
- Push all simple wrapper methods to C++ side, like WebView::reload()
- All declared properties should be defined in C++ to help integration of TabModel & DeclarativeTabModel. MozView this could mean that we would expose DeclarativeWebPage and instantiate through through WebView. Conceptually MozView is quite close to a page that can be navigated back and forth.

Will write down tasks of these.