Граф коммитов

11 Коммитов

Автор SHA1 Сообщение Дата
Ting-Yu Lin 3a0b73989e Bug 1304598 Part 4 - Sort #include statements in TouchManager.cpp and PresShell.h. r=dholbert
Need to add #includes "nsPresContext.h" and "nsThreadUtils.h" in
PresShell.h, and "nsViewportInfo.h" in MobileViewportManager.h to compile.

MozReview-Commit-ID: F8bmOwllOiH

--HG--
extra : rebase_source : cacbb30d854c68ea720f849d03b649bbd3c5da03
2016-11-30 11:14:28 +08:00
Jan Henning 47101d08ae Bug 1282902 - Part 3 - Let the MobileViewportManager recalculate the saved resolution if the display width changed before restoring. r=kats
The mobile session store saves the current document resolution in order to restore the previous zoom level when restoring a page. If the display width has changed since the session data was captured (e.g. because the device was rotated), the resolution might have to be scaled appropriately.
Currently, the session store does this scaling by itself by comparing the stored and current window widths, however this implementation is slightly simplified and doesn't cover all use cases, which means some pages can be restored at a wrong zoom level after rotation. To correctly cover all cases, the session store would have to compare viewport widths, too.

Because the MobileViewportManager doesn't wait for the session store to set the restore resolution, the latter has to call setRestoreResolution() as early as possible in order to guarantee that the restore resolution is set before the first paint of the document. Therefore the session store currently calls this after receiving a LocationChange notification. However at that time, the correct viewport for the current document is not yet available, which means the resolution cannot be recalculated by the session store at that point.

Therefore, this patch changes the approach taken and lets the MVM handle all resolution calculations instead. The session store now simply passes the stored previous display dimensions along with the previous document resolution to the MVM, which can then compare them to the current display and viewport widths and scale the resolution appropriately before using it during first paint.


MozReview-Commit-ID: IGxWw87yftK

--HG--
extra : transplant_source : e%8D%BD%26%D2%C3%8E5%E3%2B%C0t%BA%DB%C1%BBs%3F%13%1F
2016-07-01 21:23:25 +02:00
Jan Henning 070a561665 Bug 1282902 - Part 2 - Extract resolution scaling into separate function. r=kats
We'll want to use this during first-paint, too, in order to correctly scale the resolution as received by the session store if we're restoring a previous tab. Therefore we extract this code into a separate helper function.

MozReview-Commit-ID: KCdvmyrP4mJ

--HG--
extra : transplant_source : c%BD%99%9D%F8%9EW%D2%8B%BD%E0a%82%ED%3B%EE%EF%ACl%D6
2016-07-02 22:15:19 +02:00
Kartikaya Gupta b9e4a263e3 Bug 1270019 - Add a SetRestoreResolution API for fennec's SessionRestore to use. r=rbarker
MozReview-Commit-ID: 7WqmgAkFItQ
2016-05-17 14:50:08 -04:00
Nathan Froyd 5672bb749c Bug 1259733 - use forward declarations for nsIDocument in a few places; r=dholbert
This is sufficient for nsCSSFrameConstructor.h's needs, and the
corresponding C++ file already includes nsIDocument.h.
2016-04-27 14:48:36 -04:00
Kartikaya Gupta 1b8ce76eee Bug 1233468 - If we get the load event before the before-first-paint, make sure the CSS viewport is set up properly for content load listeners. r=tnikkel
--HG--
extra : commitid : 2aMyjyc2i9C
2016-01-12 09:47:29 -05:00
Kartikaya Gupta 3bdf2299bb Bug 1225571 - Move the code to update the SPCSPS from repaint request handling to when the resolution is updated in the presShell. r=botond
--HG--
extra : commitid : JglAPUfEC3G
2015-11-18 13:53:14 -05:00
Kartikaya Gupta bb9c2f839d Bug 1188172 - Don't update the resolution/SPCSPS for meta-viewport changes before the first-paint. r=botond 2015-08-02 22:50:54 -04:00
Kartikaya Gupta ed365c4387 Bug 1178847 - Add a MobileViewportManager to manage setting the CSS viewport on B2G. r=botond,tn
The MobileViewportManager ("MVM") is responsible for setting the CSS viewport on
any of the following events:
- a page is painted for the first time (on the before-first-paint event)
- a meta-viewport tag is added (on the DOMMetaAdded event)
- the full-zoom is changed (on the FullZoomChanged event)
- if the window is resized (ResizeReflow gets called as part of normal layout
  processing, and this will pick up a new CSS viewport from MVM)

If the CSS viewport changes or if it is the initial paint, the MVM additionally
calls SetResolutionAndScaleTo on the presShell to update the displayed zoom.
The APZ code in AsyncPanZoomController::NotifyLayersUpdated already has
corresponding code to accept this updated zoom when the CSS viewport changes.
2015-07-21 10:51:55 -04:00
Carsten "Tomcat" Book 214402e410 Backed out changeset 313ea7f814d3 (bug 1178847) 2015-07-21 08:34:57 +02:00
Kartikaya Gupta 86a7ae48ef Bug 1178847 - Add a MobileViewportManager to manage setting the CSS viewport on B2G. r=botond,tn
The MobileViewportManager ("MVM") is responsible for setting the CSS viewport on
any of the following events:
- a page is painted for the first time (on the before-first-paint event)
- a meta-viewport tag is added (on the DOMMetaAdded event)
- the full-zoom is changed (on the FullZoomChanged event)
- if the window is resized (ResizeReflow gets called as part of normal layout
  processing, and this will pick up a new CSS viewport from MVM)

If the CSS viewport changes or if it is the initial paint, the MVM additionally
calls SetResolutionAndScaleTo on the presShell to update the displayed zoom.
The APZ code in AsyncPanZoomController::NotifyLayersUpdated already has
corresponding code to accept this updated zoom when the CSS viewport changes.
2015-07-20 18:19:40 -04:00