From c9464b0e91c07653fbb8750f62509b322fd144b4 Mon Sep 17 00:00:00 2001 From: Daniel Varga Date: Fri, 9 Aug 2019 01:28:23 +0300 Subject: [PATCH] Backed out 3 changesets (bug 1511177) for web-platform-tests-reftests at /css/css-tables/percent-width-cell-dynamic.html on a CLOSED TREE Backed out changeset bbe9d07407c9 (bug 1511177) Backed out changeset 13004b37170e (bug 1511177) Backed out changeset 23282c683f67 (bug 1511177) --HG-- extra : rebase_source : d92b55d541e4e366aca8db62d9398bdb23209e7b --- mobile/android/geckoview/api.txt | 5 -- .../geckoview/test/NavigationDelegateTest.kt | 24 +++----- .../geckoview/GeckoRuntimeSettings.java | 57 +------------------ .../geckoview/GeckoSessionSettings.java | 7 +-- .../mozilla/geckoview/doc-files/CHANGELOG.md | 15 +++-- 5 files changed, 20 insertions(+), 88 deletions(-) diff --git a/mobile/android/geckoview/api.txt b/mobile/android/geckoview/api.txt index 24fe3a70c591..92b2446cc559 100644 --- a/mobile/android/geckoview/api.txt +++ b/mobile/android/geckoview/api.txt @@ -314,7 +314,6 @@ package org.mozilla.geckoview { method public boolean getConsoleOutputEnabled(); method @NonNull public ContentBlocking.Settings getContentBlocking(); method @Nullable public Class getCrashHandler(); - method public int getDesktopViewportWidth(); method @Nullable public Float getDisplayDensityOverride(); method @Nullable public Integer getDisplayDpiOverride(); method public boolean getDoubleTapZoomingEnabled(); @@ -336,7 +335,6 @@ package org.mozilla.geckoview { method @NonNull public GeckoRuntimeSettings setAutomaticFontSizeAdjustment(boolean); method @NonNull public GeckoRuntimeSettings setAutoplayDefault(int); method @NonNull public GeckoRuntimeSettings setConsoleOutputEnabled(boolean); - method @NonNull public GeckoRuntimeSettings setDesktopViewportWidth(int); method @NonNull public GeckoRuntimeSettings setDoubleTapZoomingEnabled(boolean); method @NonNull public GeckoRuntimeSettings setFontInflationEnabled(boolean); method @NonNull public GeckoRuntimeSettings setFontSizeFactor(float); @@ -353,8 +351,6 @@ package org.mozilla.geckoview { field public static final int COLOR_SCHEME_LIGHT = 0; field public static final int COLOR_SCHEME_SYSTEM = -1; field public static final Parcelable.Creator CREATOR; - field public static final int DESKTOP_VIEWPORT_WIDTH_PHONE = 980; - field public static final int DESKTOP_VIEWPORT_WIDTH_TABLET = 1280; } @AnyThread public static final class GeckoRuntimeSettings.Builder extends RuntimeSettings.Builder { @@ -366,7 +362,6 @@ package org.mozilla.geckoview { method @NonNull public GeckoRuntimeSettings.Builder consoleOutput(boolean); method @NonNull public GeckoRuntimeSettings.Builder contentBlocking(@NonNull ContentBlocking.Settings); method @NonNull public GeckoRuntimeSettings.Builder crashHandler(@Nullable Class); - method @NonNull public GeckoRuntimeSettings.Builder desktopViewportWidth(int); method @NonNull public GeckoRuntimeSettings.Builder displayDensityOverride(float); method @NonNull public GeckoRuntimeSettings.Builder displayDpiOverride(int); method @NonNull public GeckoRuntimeSettings.Builder doubleTapZoomingEnabled(boolean); diff --git a/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/NavigationDelegateTest.kt b/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/NavigationDelegateTest.kt index 99bd5f9d2fd2..c9e752e993b2 100644 --- a/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/NavigationDelegateTest.kt +++ b/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/NavigationDelegateTest.kt @@ -7,7 +7,13 @@ package org.mozilla.geckoview.test import android.os.Handler import android.os.Looper import android.support.test.InstrumentationRegistry +import org.mozilla.geckoview.AllowOrDeny +import org.mozilla.geckoview.ContentBlocking +import org.mozilla.geckoview.GeckoResult +import org.mozilla.geckoview.GeckoSession import org.mozilla.geckoview.GeckoSession.NavigationDelegate.LoadRequest +import org.mozilla.geckoview.GeckoSessionSettings +import org.mozilla.geckoview.WebRequestError import org.mozilla.geckoview.test.rule.GeckoSessionTestRule.AssertCalled import org.mozilla.geckoview.test.rule.GeckoSessionTestRule.NullDelegate @@ -23,7 +29,6 @@ import org.junit.After import org.junit.Before import org.junit.Test import org.junit.runner.RunWith -import org.mozilla.geckoview.* import org.mozilla.geckoview.test.rule.GeckoSessionTestRule import org.mozilla.geckoview.test.util.HttpBin import org.mozilla.geckoview.test.util.UiThreadUtils @@ -549,8 +554,7 @@ class NavigationDelegateTest : BaseSessionTest() { sessionRule.session.loadTestPath(VIEWPORT_PATH) sessionRule.waitForPageStop() - val desktopInnerWidthTablet = GeckoRuntimeSettings.DESKTOP_VIEWPORT_WIDTH_TABLET - val desktopInnerWidthPhone = GeckoRuntimeSettings.DESKTOP_VIEWPORT_WIDTH_PHONE + val desktopInnerWidth = 980.0 val physicalWidth = 600.0 val pixelRatio = sessionRule.session.evaluateJS("window.devicePixelRatio") as Double val mobileInnerWidth = physicalWidth / pixelRatio @@ -561,23 +565,13 @@ class NavigationDelegateTest : BaseSessionTest() { innerWidth, closeTo(mobileInnerWidth, 0.1)) sessionRule.session.settings.viewportMode = GeckoSessionSettings.VIEWPORT_MODE_DESKTOP - sessionRule.runtime.settings.desktopViewportWidth = desktopInnerWidthTablet sessionRule.session.reload() sessionRule.session.waitForPageStop() innerWidth = sessionRule.session.evaluateJS(innerWidthJs) as Double - assertThat("innerWidth should be equal to $desktopInnerWidthTablet", innerWidth, - closeTo(desktopInnerWidthTablet.toDouble(), 0.1)) - - sessionRule.runtime.settings.desktopViewportWidth = desktopInnerWidthPhone - - sessionRule.session.reload() - sessionRule.session.waitForPageStop() - - innerWidth = sessionRule.session.evaluateJS(innerWidthJs) as Double - assertThat("innerWidth should be equal to $desktopInnerWidthPhone", innerWidth, - closeTo(desktopInnerWidthPhone.toDouble(), 0.1)) + assertThat("innerWidth should be equal to $desktopInnerWidth", innerWidth, + closeTo(desktopInnerWidth, 0.1)) sessionRule.session.settings.viewportMode = GeckoSessionSettings.VIEWPORT_MODE_MOBILE diff --git a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntimeSettings.java b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntimeSettings.java index ab322208a936..e3fb978ffac4 100644 --- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntimeSettings.java +++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntimeSettings.java @@ -369,29 +369,12 @@ public final class GeckoRuntimeSettings extends RuntimeSettings { * Sets the WebGL MSAA level. * * @param level number of MSAA samples, 0 if MSAA should be disabled. - * @return This Builder instance. + * @return This GeckoRuntimeSettings instance. */ public @NonNull Builder glMsaaLevel(final int level) { getSettings().mGlMsaaLevel.set(level); return this; } - - /** - * Set the width of the special desktop mode viewport, which is used for displaying pages - * without a <meta> viewport tag, or for all pages when setting - * {@link GeckoSessionSettings#setViewportMode(int)} to - * {@link GeckoSessionSettings#VIEWPORT_MODE_DESKTOP}. - * - * @param width The width of the desktop mode viewport in CSS px. - * Some common default values are provided by the - * {@link GeckoRuntimeSettings#DESKTOP_VIEWPORT_WIDTH_PHONE - * GeckoRuntimeSettings#DESKTOP_VIEWPORT_WIDTH_*} constants. - * @return This Builder instance. - */ - public @NonNull Builder desktopViewportWidth(final int width) { - getSettings().mDesktopViewportWidth.set(width); - return this; - } } private GeckoRuntime mRuntime; @@ -428,8 +411,6 @@ public final class GeckoRuntimeSettings extends RuntimeSettings { "apz.allow_double_tap_zooming", true); /* package */ final Pref mGlMsaaLevel = new Pref<>( "gl.msaa-level", 0); - /* package */ final Pref mDesktopViewportWidth = new Pref<>( - "browser.viewport.desktopWidth", 980); /* package */ boolean mDebugPause; /* package */ boolean mUseMaxScreenDepth; @@ -998,42 +979,6 @@ public final class GeckoRuntimeSettings extends RuntimeSettings { return this; } - /** - * A desktop mode viewport width appropriate for use on phone-sized devices. - */ - public static final int DESKTOP_VIEWPORT_WIDTH_PHONE = 980; - /** - * A desktop mode viewport width appropriate for use on tablet-sized devices. - */ - public static final int DESKTOP_VIEWPORT_WIDTH_TABLET = 1280; - - /** - * Get the current width of the special desktop mode viewport. - * @return The width of the desktop mode viewport in CSS px. - */ - public int getDesktopViewportWidth() { - return mDesktopViewportWidth.get(); - } - - /** - * Set the width of the special desktop mode viewport, which is used for displaying pages - * without a <meta> viewport tag, or for all pages when setting - * {@link GeckoSessionSettings#setViewportMode(int)} to - * {@link GeckoSessionSettings#VIEWPORT_MODE_DESKTOP}. - * - *

Currently, any changes only take effect after a reload of the session. - * - * @param width The width of the desktop mode viewport in CSS px. - * Some common default values are provided by the - * {@link GeckoRuntimeSettings#DESKTOP_VIEWPORT_WIDTH_PHONE - * GeckoRuntimeSettings#DESKTOP_VIEWPORT_WIDTH_*} constants. - * @return This GeckoRuntimeSettings instance. - */ - public @NonNull GeckoRuntimeSettings setDesktopViewportWidth(final int width) { - mDesktopViewportWidth.commit(width); - return this; - } - @Override // Parcelable public void writeToParcel(final Parcel out, final int flags) { super.writeToParcel(out, flags); diff --git a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSessionSettings.java b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSessionSettings.java index 7110d4f2b54d..0235ec160ada 100644 --- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSessionSettings.java +++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSessionSettings.java @@ -231,14 +231,13 @@ public final class GeckoSessionSettings implements Parcelable { /** * Mobile-friendly pages will be rendered using a viewport based on their <meta> viewport * tag. All other pages will be rendered using a special desktop mode viewport, which has a - * default width of 980 CSS px. + * 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 default width - * of 980 CSS px, regardless of whether the page has a <meta> viewport tag specified or - * not. + * 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 <meta> viewport tag specified or not. */ public static final int VIEWPORT_MODE_DESKTOP = 1; diff --git a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/doc-files/CHANGELOG.md b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/doc-files/CHANGELOG.md index 18a04ccd9310..7914c9f873de 100644 --- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/doc-files/CHANGELOG.md +++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/doc-files/CHANGELOG.md @@ -11,6 +11,12 @@ exclude: true # GeckoView API Changelog. ## v70 + +- Add GeckoSession.LOAD_FLAGS_REPLACE_HISTORY + +- Removed the obsolete `success` parameter from + [`CrashReporter#sendCrashReport(Context, File, File, String)`][70.3] and + [`CrashReporter#sendCrashReport(Context, File, Map, String)`][70.4]. - Added API for session context assignment [`GeckoSessionSettings.Builder.contextId`][70.1] and deletion of data related to a session context @@ -22,13 +28,7 @@ exclude: true when the URI we're loading originates from another page. A common example of this would be long pressing a link and then opening that in a new `GeckoSession`. - Added capture parameter to [`onFilePrompt`][70.9] and corresponding [`CAPTURE_TYPE_*`][70.7] constants. -- Removed the obsolete `success` parameter from - [`CrashReporter#sendCrashReport(Context, File, File, String)`][70.3] and - [`CrashReporter#sendCrashReport(Context, File, Map, String)`][70.4]. -- Add GeckoSession.LOAD_FLAGS_REPLACE_HISTORY - Complete rewrite of [`PromptDelegate`][70.11]. -- Added [`GeckoRuntimeSettings.setDesktopViewportWidth`][70.12] for configuring the desktop mode - viewport width. [70.1]: {{javadoc_uri}}/GeckoSessionSettings.Builder.html#contextId-java.lang.String- [70.2]: {{javadoc_uri}}/StorageController.html#clearDataForSessionContext-java.lang.String- @@ -41,7 +41,6 @@ exclude: true [70.9]: {{javadoc_uri}}/GeckoSession.PromptDelegate.html#onFilePrompt-org.mozilla.geckoview.GeckoSession-java.lang.String-int-java.lang.String:A-int-org.mozilla.geckoview.GeckoSession.PromptDelegate.FileCallback- [70.10]: {{javadoc_uri}}/GeckoView.html#setSession-org.mozilla.geckoview.GeckoSession- [70.11]: {{javadoc_uri}}/GeckoSession.PromptDelegate.html -[70.12]: {{javadoc_uri}}/GeckoRuntimeSettings.html#setDesktopViewportWidth-int- ## v69 - Modified behavior of ['setAutomaticFontSizeAdjustment'][69.1] so that it no @@ -294,4 +293,4 @@ exclude: true [65.24]: {{javadoc_uri}}/CrashReporter.html#sendCrashReport-android.content.Context-android.os.Bundle-java.lang.String- [65.25]: {{javadoc_uri}}/GeckoResult.html -[api-version]: badc73dc79860a8f69a5e14d7c3725107af68c8e +[api-version]: 4550b507a55bdf91d21960209b66f893f4b5b317