Backed out 2 changesets (bug 1504659) for test_innerWidthHeight_script.html failures CLOSED TREE
authorBogdan Tara <btara@mozilla.com>
Tue, 08 Jan 2019 04:10:11 +0200
changeset 509901 b3639a45cfc3d49ed698ea2cbee64a4ffbe4922c
parent 509900 4dceaafd23a84cefb4bcba39bdceb65a90852f06
child 509902 c9f108854caa76ec5bd2f7b3b8486195bd79106d
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1504659
milestone66.0a1
backs out0b7bbe6dda1d98b81149a86c62801e66b40ea32c
2ebae5c1463b2e4a8bcd415c3df420aa34d2ee09
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
Backed out 2 changesets (bug 1504659) for test_innerWidthHeight_script.html failures CLOSED TREE Backed out changeset 0b7bbe6dda1d (bug 1504659) Backed out changeset 2ebae5c1463b (bug 1504659)
devtools/client/responsive.html/test/browser/browser.ini
devtools/client/responsive.html/test/browser/browser_scroll.js
devtools/client/responsive.html/test/browser/head.js
devtools/client/responsive.html/test/unit/test_resize_viewport.js
layout/base/MobileViewportManager.cpp
--- a/devtools/client/responsive.html/test/browser/browser.ini
+++ b/devtools/client/responsive.html/test/browser/browser.ini
@@ -49,17 +49,16 @@ skip-if = true # Bug 1413765
 [browser_page_state.js]
 [browser_page_style.js]
 [browser_permission_doorhanger.js]
 tags = devtools geolocation
 skip-if = true # Bug 1413765
 [browser_preloaded_newtab.js]
 [browser_prompts.js]
 [browser_screenshot_button.js]
-[browser_scroll.js]
 [browser_state_restore.js]
 [browser_tab_close.js]
 [browser_tab_remoteness_change.js]
 [browser_target_blank.js]
 [browser_telemetry_activate_rdm.js]
 [browser_toolbox_computed_view.js]
 [browser_toolbox_rule_view.js]
 [browser_toolbox_rule_view_reload.js]
deleted file mode 100644
--- a/devtools/client/responsive.html/test/browser/browser_scroll.js
+++ /dev/null
@@ -1,75 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
-http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-/**
- * This test is checking that keyboard scrolling of content in RDM
- * behaves correctly, both with and without touch simulation enabled.
- */
-
-const TEST_URL = "data:text/html;charset=utf-8," +
-  "<div style=\"background:blue; width:200px; height:200px\"></div>";
-
-addRDMTask(TEST_URL, async function({ ui, manager }) {
-  info("Turning off keyboard APZ for this test.");
-  await SpecialPowers.pushPrefEnv({
-    set: [["apz.keyboard.enabled", false]],
-  });
-
-  await setViewportSize(ui, manager, 100, 100);
-  const browser = ui.getViewportBrowser();
-
-  info("Setting focus on the browser.");
-  browser.focus();
-
-  info("Testing scroll behavior with touch simulation OFF.");
-  await testScrollingOfContent(ui);
-
-  // Run the tests again with touch simulation on.
-  const reloadNeeded = await ui.updateTouchSimulation(true);
-  if (reloadNeeded) {
-    info("Reload is needed -- waiting for it.");
-    const reload = waitForViewportLoad(ui);
-    browser.reload();
-    await reload;
-
-    await ContentTask.spawn(browser, null, () => {
-      content.scrollTo(0, 0);
-    });
-  }
-
-  info("Testing scroll behavior with touch simulation ON.");
-  await testScrollingOfContent(ui);
-});
-
-async function testScrollingOfContent(ui) {
-  let scroll;
-
-  info("Checking initial scroll conditions.");
-  const viewportScroll = await getViewportScroll(ui);
-  is(viewportScroll.x, 0, "Content should load with scrollX 0.");
-  is(viewportScroll.y, 0, "Content should load with scrollY 0.");
-
-  /**
-   * Here we're going to send off some arrow key events to trigger scrolling.
-   * What we would like to be able to do is to await the scroll event and then
-   * check the scroll position to confirm the amount of scrolling that has
-   * happened. Unfortunately, APZ makes the scrolling happen asynchronously on
-   * the compositor thread, and it's very difficult to await the end state of
-   * the APZ animation -- see the tests in /gfx/layers/apz/test/mochitest for
-   * an example. For our purposes, it's sufficient to test that the scroll
-   * event is fired at all, and not worry about the amount of scrolling that
-   * has occurred at the time of the event. If the key events don't trigger
-   * scrolling, then no event will be fired and the test will time out.
-   */
-  scroll = waitForViewportScroll(ui);
-  EventUtils.synthesizeKey("KEY_ArrowDown");
-  await scroll;
-  info("Scroll event was fired after arrow key down.");
-
-  scroll = waitForViewportScroll(ui);
-  EventUtils.synthesizeKey("KEY_ArrowRight");
-  await scroll;
-  info("Scroll event was fired after arrow key right.");
-}
--- a/devtools/client/responsive.html/test/browser/head.js
+++ b/devtools/client/responsive.html/test/browser/head.js
@@ -327,23 +327,16 @@ function getSessionHistory(browser) {
 
 function getContentSize(ui) {
   return spawnViewportTask(ui, {}, () => ({
     width: content.screen.width,
     height: content.screen.height,
   }));
 }
 
-function getViewportScroll(ui) {
-  return spawnViewportTask(ui, {}, () => ({
-    x: content.scrollX,
-    y: content.scrollY,
-  }));
-}
-
 async function waitForPageShow(browser) {
   const tab = gBrowser.getTabForBrowser(browser);
   const ui = ResponsiveUIManager.getResponsiveUIForTab(tab);
   if (ui) {
     browser = ui.getViewportBrowser();
   }
   info("Waiting for pageshow from " + (ui ? "responsive" : "regular") + " browser");
   // Need to wait an extra tick after pageshow to ensure everyone is up-to-date,
@@ -351,20 +344,16 @@ async function waitForPageShow(browser) 
   await BrowserTestUtils.waitForContentEvent(browser, "pageshow");
   return waitForTick();
 }
 
 function waitForViewportLoad(ui) {
   return BrowserTestUtils.waitForContentEvent(ui.getViewportBrowser(), "load", true);
 }
 
-function waitForViewportScroll(ui) {
-  return BrowserTestUtils.waitForContentEvent(ui.getViewportBrowser(), "scroll", true);
-}
-
 function load(browser, url) {
   const loaded = BrowserTestUtils.browserLoaded(browser, false, url);
   BrowserTestUtils.loadURI(browser, url);
   return loaded;
 }
 
 function back(browser) {
   const shown = waitForPageShow(browser);
--- a/devtools/client/responsive.html/test/unit/test_resize_viewport.js
+++ b/devtools/client/responsive.html/test/unit/test_resize_viewport.js
@@ -2,28 +2,20 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 // Test resizing the viewport.
 
 const { addViewport, resizeViewport } =
   require("devtools/client/responsive.html/actions/viewports");
-const { toggleTouchSimulation } = require("devtools/client/responsive.html/actions/ui");
 
 add_task(async function() {
   const store = Store();
   const { getState, dispatch } = store;
 
   dispatch(addViewport());
   dispatch(resizeViewport(0, 500, 500));
 
-  let viewport = getState().viewports[0];
+  const viewport = getState().viewports[0];
   equal(viewport.width, 500, "Resized width of 500");
   equal(viewport.height, 500, "Resized height of 500");
-
-  dispatch(toggleTouchSimulation(true));
-  dispatch(resizeViewport(0, 400, 400));
-
-  viewport = getState().viewports[0];
-  equal(viewport.width, 400, "Resized width of 400 (with touch simulation on)");
-  equal(viewport.height, 400, "Resized height of 400 (with touch simulation on)");
 });
--- a/layout/base/MobileViewportManager.cpp
+++ b/layout/base/MobileViewportManager.cpp
@@ -392,16 +392,20 @@ void MobileViewportManager::UpdateDispla
         scrollable, nsLayoutUtils::RepaintMode::DoNotRepaint);
   }
 }
 
 void MobileViewportManager::RefreshVisualViewportSize() {
   // This function is a subset of RefreshViewportSize, and only updates the
   // visual viewport size.
 
+  if (!gfxPrefs::APZAllowZooming()) {
+    return;
+  }
+
   ScreenIntSize displaySize = ViewAs<ScreenPixel>(
       mDisplaySize, PixelCastJustification::LayoutDeviceIsScreenForBounds);
 
   CSSToLayoutDeviceScale cssToDev =
       mPresShell->GetPresContext()->CSSToDevPixelScale();
   LayoutDeviceToLayerScale res(mPresShell->GetResolution());
   CSSToScreenScale zoom = ViewTargetAs<ScreenPixel>(
       cssToDev * res / ParentLayerToLayerScale(1),
@@ -467,20 +471,16 @@ void MobileViewportManager::RefreshViewp
   // If it's the first-paint or the viewport changed, we need to update
   // various APZ properties (the zoom and some things that might depend on it)
   MVM_LOG("%p: Updating properties because %d || %d\n", this, mIsFirstPaint,
           mMobileViewportSize != viewport);
 
   if (gfxPrefs::APZAllowZooming()) {
     UpdateResolution(viewportInfo, displaySize, viewport,
                      displayWidthChangeRatio, UpdateType::ViewportSize);
-  } else {
-    // Even without zoom, we need to update that the visual viewport size
-    // has changed.
-    RefreshVisualViewportSize();
   }
   if (gfxPlatform::AsyncPanZoomEnabled()) {
     UpdateDisplayPortMargins();
   }
 
   CSSSize oldSize = mMobileViewportSize;
 
   // Update internal state.