Bug 1521600 - Clarify how the ViewportMode API actually works. r=geckoview-reviewers,snorp
authorJan Henning <jh+bugzilla@buttercookie.de>
Wed, 23 Jan 2019 21:06:06 +0000
changeset 515191 4ef0f4957e8502de7b24fa2b6b88dd1c553dfc33
parent 515190 de6426e0f4910ebe27666feb8153c3220d81edee
child 515192 dcd16e6ab6a87806ea54d827e1d720b8a6fbca3a
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgeckoview-reviewers, snorp
bugs1521600
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1521600 - Clarify how the ViewportMode API actually works. r=geckoview-reviewers,snorp VIEWPORT_MODE_DESKTOP *forces* the desktop mode viewport everywhere, whereas VIEWPORT_MODE_MOBILE merely enables <meta> viewport support for pages that have that tag defined, but still uses the desktop mode viewport for all other pages. Differential Revision: https://phabricator.services.mozilla.com/D17159
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSessionSettings.java
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSessionSettings.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSessionSettings.java
@@ -208,17 +208,26 @@ public final class GeckoSessionSettings 
     public static final int DISPLAY_MODE_FULLSCREEN = 3;
 
     // This needs to match GeckoViewSettingsChild.js and GeckoViewSettings.jsm
     public static final int USER_AGENT_MODE_MOBILE = 0;
     public static final int USER_AGENT_MODE_DESKTOP = 1;
     public static final int USER_AGENT_MODE_VR = 2;
 
     // This needs to match GeckoViewSettingsChild.js
+    /**
+     * Mobile-friendly pages will be rendered using a viewport based on their &lt;meta&gt; viewport
+     * tag. All other pages will be rendered using a special desktop mode viewport, which has a
+     * width of 980 CSS px.
+     */
     public static final int VIEWPORT_MODE_MOBILE = 0;
+    /**
+     * All pages will be rendered using the special desktop mode viewport, which has a width of
+     * 980 CSS px, regardless of whether the page has a &lt;meta&gt; viewport tag specified or not.
+     */
     public static final int VIEWPORT_MODE_DESKTOP = 1;
 
     public static class Key<T> {
         /* package */ final String name;
         /* package */ final boolean initOnly;
         /* package */ final Collection<T> values;
 
         /* package */ Key(final String name) {