Commit Graph

31 Commits

Author SHA1 Message Date
Timothy Nikkel
dafd794f51 Bug 1346109. Set a displayport base rect in MobileViewportManager::UpdateDisplayPortMargins when we are setting displayport margins. r=botond
It's easy to calculate because it's always a root content document.
2017-03-21 00:16:41 -05:00
Ting-Yu Lin
f3ed4deadf Bug 1304598 Part 3 - Rename nsPresShell.h/cpp to PresShell.h/cpp, and move exported header to mozilla/ subdir. r=dholbert
The class PresShell doesn't have ns-prefix, so it's better to drop ns-prefix
in the file names to avoid confusion.

MozReview-Commit-ID: IljxsF5CVjh
2016-11-30 11:14:28 +08:00
Jan Henning
07d07e8d9e 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
2016-07-01 21:23:25 +02:00
Jan Henning
2d4f234ee0 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
2016-07-02 22:15:19 +02:00
Matt Woodrow
cb1cb75fda Bug 881832 - Specify whether the height has changed when calling PresShell::ResizeReflow, since the PresContext size might have already been updated. r=dbaron 2016-05-12 12:06:11 +12:00
Phil Ringnalda
903965a65a Back out 6 changesets (bug 881832) for failures in test_Debugger.Source.prototype.element.html
CLOSED TREE

Backed out changeset fac50ce10b07 (bug 881832)
Backed out changeset 32e01c144cd4 (bug 881832)
Backed out changeset 779f5336b81e (bug 881832)
Backed out changeset 95efd250e29f (bug 881832)
Backed out changeset 7fe79f07189f (bug 881832)
Backed out changeset 8ee1824f2a57 (bug 881832)
2016-05-23 18:34:49 -07:00
Matt Woodrow
ee41bb63c0 Bug 881832 - Specify whether the height has changed when calling PresShell::ResizeReflow, since the PresContext size might have already been updated. r=dbaron 2016-05-12 12:06:11 +12:00
Kartikaya Gupta
ef9f686977 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
Phil Ringnalda
fb3bc51a33 Back out 5 changesets (bug 881832) for failures in browser_html_tooltip-02.js
Backed out changeset 117e8e24d714 (bug 881832)
Backed out changeset 8a0d5df41cfb (bug 881832)
Backed out changeset 6b3c5e185b04 (bug 881832)
Backed out changeset 11106afdcbe7 (bug 881832)
Backed out changeset d711b7c19a43 (bug 881832)
2016-05-11 21:08:08 -07:00
Matt Woodrow
8630ad5c64 Bug 881832 - Specify whether the height has changed when calling PresShell::ResizeReflow, since the PresContext size might have already been updated. r=dbaron 2016-05-12 12:06:11 +12:00
Nathan Froyd
fdade54d79 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
Kyle Huey
e95edb30a9 Bug 1241764: Replace nsPIDOMWindow with nsPIDOMWindowInner/Outer. r=mrbkap,smaug 2016-01-30 09:05:36 -08:00
Kartikaya Gupta
2dcfca9ec5 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 2016-01-12 09:47:29 -05:00
Tooru Fujisawa
1b5f79d9ec Bug 382721 - Part 0: Add missing includes and namespaces. r=jrmuizel 2015-09-10 19:24:34 +09:00
Botond Ballo
b2b30c429c Bug 1194851 - Add helper functions HasDisplayPort() and HasCriticalDisplayPort(). r=kats
This makes it clearer whether we're just checking if a displayport exists,
or we're actually consuming its value.
2015-12-16 17:22:23 -05:00
Kartikaya Gupta
286dc4cf52 Bug 1225508 - Add a displayport on non-scrollable frames which have a resolution. r=botond 2015-11-27 11:20:04 -05:00
Kartikaya Gupta
76f8a60d43 Bug 1226872 - Remove unnecessary wrapper methods in nsLayoutUtils. r=roc 2015-11-23 09:14:18 -05:00
Kartikaya Gupta
e8c858707d Bug 1225571 - Move the code to update the SPCSPS from repaint request handling to when the resolution is updated in the presShell. r=botond 2015-11-18 13:53:14 -05:00
Nathan Froyd
10d1391330 Bug 1217939 - part 1 - remove nsContentUtils::GetViewportInfo; r=smaug
All it was doing was forwarding to the provided document, which is an
unnecessary layer of indirection.
2015-10-23 13:21:57 -04:00
Kartikaya Gupta
af7f82be71 Bug 1208023 - Ensure the minimum scale is a sane value greater than zero and add a separate flag to track if the default zoom is valid. r=botond 2015-10-02 23:08:18 -04:00
Botond Ballo
63e70977ef Bug 1205511 - Use nsPresContext::DevToCSSPixelScale() where appropriate. r=kats 2015-09-28 20:14:26 -04:00
Kartikaya Gupta
b885a89262 Bug 1198839 - Don't update the displayport from the MVM unless there is already on the content. r=botond 2015-08-27 08:26:00 -04:00
Mike Taylor
e438bab1e9 Bug 976616 - Part 2: Update mobile viewport on DOMMetaChanged event. r=kats 2015-08-24 15:35:00 -04:00
Kartikaya Gupta
713648f82e Bug 1180267 - Don't set root displayport margins from the mobile viewport manager unless the C++ APZ is enabled. r=botond 2015-08-24 13:45:45 -04:00
Kartikaya Gupta
c1932682af Bug 1197592 - Don't set an SPCSPS in the mobile viewport manager if APZ zooming is not enabled. r=botond 2015-08-24 13:45:44 -04:00
Kartikaya Gupta
3092325fd0 Bug 1168487 - Update the last use site of ScrollbarAreaToExcludeFromCompositionBoundsFor to use LD pixels. r=tn 2015-08-07 14:23:13 -04:00
Kartikaya Gupta
dfc31b1711 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
0913401924 Bug 1186004 - Add a pref to enable/disable APZ zooming behaviour. r=botond 2015-07-22 23:42:08 -04:00
Kartikaya Gupta
064fc767ff 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
8ee59042e8 Backed out changeset 313ea7f814d3 (bug 1178847) 2015-07-21 08:34:57 +02:00
Kartikaya Gupta
1e07d34a09 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