Backed out 2 changesets (bug 1707884, bug 1716284) for causing xpshell failures on test_layout-reflows-observer.js
authorMarian-Vasile Laza <mlaza@mozilla.com>
Wed, 16 Jun 2021 11:59:28 +0300
changeset 583528 85f859926dcf82f012f210ee4f1d12ed899c4d43
parent 583527 52a67ce78459464c6a2eb370f4b090f1003e8274
child 583529 b09f48b20f162583fb6b361d0753fa4024eca17b
push id145079
push usermlaza@mozilla.com
push dateWed, 16 Jun 2021 09:00:22 +0000
treeherderautoland@85f859926dcf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1707884, 1716284
milestone91.0a1
backs out58c3344a4f1917e1611aa542a5e7417f369f597b
22adda3b4bb1448f6eb820784be00e22593ee3ce
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 1707884, bug 1716284) for causing xpshell failures on test_layout-reflows-observer.js CLOSED TREE Backed out changeset 58c3344a4f19 (bug 1707884) Backed out changeset 22adda3b4bb1 (bug 1716284)
devtools/client/inspector/grids/grid-inspector.js
devtools/client/inspector/grids/test/browser.ini
devtools/client/inspector/grids/test/browser_grids_grid-list-on-target-added-removed.js
devtools/client/inspector/inspector.js
devtools/server/actors/layout.js
devtools/server/actors/reflow.js
devtools/server/actors/resources/index.js
devtools/server/actors/resources/moz.build
devtools/server/actors/resources/reflow.js
devtools/server/actors/watcher.js
devtools/shared/commands/resource/legacy-listeners/moz.build
devtools/shared/commands/resource/legacy-listeners/reflow.js
devtools/shared/commands/resource/resource-command.js
devtools/shared/commands/resource/tests/browser.ini
devtools/shared/commands/resource/tests/browser_resources_reflows.js
--- a/devtools/client/inspector/grids/grid-inspector.js
+++ b/devtools/client/inspector/grids/grid-inspector.js
@@ -108,16 +108,25 @@ class GridInspector {
    * Initializes the grid inspector by fetching the LayoutFront from the walker and
    * loading the highlighter settings.
    */
   async init() {
     if (!this.inspector) {
       return;
     }
 
+    try {
+      // TODO: Call this again whenever targets are added or removed.
+      this.layoutFronts = await this.getLayoutFronts();
+    } catch (e) {
+      // This call might fail if called asynchrously after the toolbox is finished
+      // closing.
+      return;
+    }
+
     if (flags.testing) {
       // In tests, we start listening immediately to avoid having to simulate a mousemove.
       this.highlighters.on("grid-highlighter-hidden", this.onHighlighterHidden);
       this.highlighters.on("grid-highlighter-shown", this.onHighlighterShown);
     } else {
       this.document.addEventListener(
         "mousemove",
         () => {
@@ -142,20 +151,24 @@ class GridInspector {
 
   /**
    * Get the LayoutActor fronts for all interesting targets where we have inspectors.
    *
    * @return {Array} The list of LayoutActor fronts
    */
   async getLayoutFronts() {
     const inspectorFronts = await this.inspector.getAllInspectorFronts();
-    const layoutFronts = await Promise.all(
-      inspectorFronts.map(({ walker }) => walker.getLayoutInspector())
-    );
-    return layoutFronts.filter(front => !front.isDestroyed());
+
+    const layoutFronts = [];
+    for (const { walker } of inspectorFronts) {
+      const layoutFront = await walker.getLayoutInspector();
+      layoutFronts.push(layoutFront);
+    }
+
+    return layoutFronts;
   }
 
   /**
    * Destruction function called when the inspector is destroyed. Removes event listeners
    * and cleans up references.
    */
   destroy() {
     if (this._highlighters) {
@@ -169,16 +182,17 @@ class GridInspector {
     this.inspector.sidebar.off("select", this.onSidebarSelect);
     this.inspector.off("new-root", this.onNavigate);
 
     this.inspector.off("reflow-in-selected-target", this.onReflow);
 
     this._highlighters = null;
     this.document = null;
     this.inspector = null;
+    this.layoutFronts = null;
     this.store = null;
   }
 
   getComponentProps() {
     return {
       onSetGridOverlayColor: this.onSetGridOverlayColor,
       onToggleGridHighlighter: this.onToggleGridHighlighter,
       onToggleShowGridAreas: this.onToggleShowGridAreas,
@@ -433,27 +447,26 @@ class GridInspector {
 
   /**
    * Get all GridFront instances from the server(s).
    *
    *
    * @return {Array} The list of GridFronts
    */
   async getGrids() {
-    const promises = [];
+    let gridFronts = [];
+
     try {
-      const layoutFronts = await this.getLayoutFronts();
-      for (const layoutFront of layoutFronts) {
-        promises.push(layoutFront.getAllGrids());
+      for (const layoutFront of this.layoutFronts) {
+        gridFronts = gridFronts.concat(await layoutFront.getAllGrids());
       }
     } catch (e) {
       // This call might fail if called asynchrously after the toolbox is finished closing
     }
 
-    const gridFronts = (await Promise.all(promises)).flat();
     return gridFronts;
   }
 
   /**
    * Handler for "grid-highlighter-shown" events emitted from the
    * HighlightersOverlay. Passes nodefront and event name to handleHighlighterChange.
    * Required since on and off events need the same reference object.
    *
--- a/devtools/client/inspector/grids/test/browser.ini
+++ b/devtools/client/inspector/grids/test/browser.ini
@@ -21,17 +21,16 @@ support-files =
 [browser_grids_grid-list-color-picker-on-RETURN.js]
 [browser_grids_grid-list-element-rep.js]
 [browser_grids_grid-list-no-grids.js]
 [browser_grids_grid-list-on-iframe-reloaded.js]
 skip-if = (verify && (os == 'win' || os == 'linux'))
 [browser_grids_grid-list-on-mutation-element-added.js]
 skip-if = true #Bug 1557326
 [browser_grids_grid-list-on-mutation-element-removed.js]
-[browser_grids_grid-list-on-target-added-removed.js]
 [browser_grids_grid-list-subgrids-z-order.js]
 [browser_grids_grid-list-subgrids_01.js]
 [browser_grids_grid-list-subgrids_02.js]
 [browser_grids_grid-list-toggle-grids_01.js]
 [browser_grids_grid-list-toggle-grids_02.js]
 [browser_grids_grid-list-toggle-multiple-grids.js]
 [browser_grids_grid-outline-cannot-show-outline.js]
 [browser_grids_grid-outline-highlight-area.js]
deleted file mode 100644
--- a/devtools/client/inspector/grids/test/browser_grids_grid-list-on-target-added-removed.js
+++ /dev/null
@@ -1,203 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-// Tests that the list of grids does refresh when targets are added or removed (e.g. when
-// there's a navigation and iframe are added or removed)
-
-add_task(async function() {
-  await addTab(getDocumentBuilderUrl("example.com", "top-level-com-grid"));
-  const { gridInspector } = await openLayoutView();
-  const { document: doc } = gridInspector;
-
-  const checkGridList = (expected, assertionMessage) =>
-    checkGridListItems(doc, expected, assertionMessage);
-
-  checkGridList(
-    ["div#top-level-com-grid"],
-    "One grid item is displayed at first"
-  );
-
-  info(
-    "Check that adding same-origin iframe with a grid will update the grid list"
-  );
-  const sameOriginIframeBrowsingContext = await SpecialPowers.spawn(
-    gBrowser.selectedBrowser,
-    [getDocumentBuilderUrl("example.com", "iframe-com-grid")],
-    src => {
-      const iframe = content.document.createElement("iframe");
-      iframe.id = "same-origin";
-      iframe.src = src;
-      content.document.body.append(iframe);
-      return iframe.browsingContext;
-    }
-  );
-
-  await waitFor(() => getGridListItems(doc).length == 2);
-  checkGridList(
-    ["div#top-level-com-grid", "div#iframe-com-grid"],
-    "The same-origin iframe grid is displayed"
-  );
-
-  info("Check that adding remote iframe with a grid will update the grid list");
-  const remoteIframeBrowsingContext = await SpecialPowers.spawn(
-    gBrowser.selectedBrowser,
-    [getDocumentBuilderUrl("example.org", "iframe-org-grid")],
-    src => {
-      const iframe = content.document.createElement("iframe");
-      iframe.id = "remote";
-      iframe.src = src;
-      content.document.body.append(iframe);
-      return iframe.browsingContext;
-    }
-  );
-
-  await waitFor(() => getGridListItems(doc).length == 3);
-  checkGridList(
-    ["div#top-level-com-grid", "div#iframe-com-grid", "div#iframe-org-grid"],
-    "The remote iframe grid is displayed"
-  );
-
-  info("Check that adding new grids in iframes does update the grid list");
-  SpecialPowers.spawn(sameOriginIframeBrowsingContext, [], () => {
-    const section = content.document.createElement("section");
-    section.id = "com-added-grid-container";
-    section.style = "display: grid;";
-    content.document.body.append(section);
-  });
-
-  await waitFor(() => getGridListItems(doc).length == 4);
-  checkGridList(
-    [
-      "div#top-level-com-grid",
-      "div#iframe-com-grid",
-      "section#com-added-grid-container",
-      "div#iframe-org-grid",
-    ],
-    "The new grid in the same origin iframe is displayed"
-  );
-
-  SpecialPowers.spawn(remoteIframeBrowsingContext, [], () => {
-    const section = content.document.createElement("section");
-    section.id = "org-added-grid-container";
-    section.style = "display: grid;";
-    content.document.body.append(section);
-  });
-
-  await waitFor(() => getGridListItems(doc).length == 5);
-  checkGridList(
-    [
-      "div#top-level-com-grid",
-      "div#iframe-com-grid",
-      "section#com-added-grid-container",
-      "div#iframe-org-grid",
-      "section#org-added-grid-container",
-    ],
-    "The new grid in the same origin iframe is displayed"
-  );
-
-  info("Check that removing iframes will update the grid list");
-  SpecialPowers.spawn(gBrowser.selectedBrowser, [], () => {
-    content.document.querySelector("iframe#same-origin").remove();
-  });
-
-  await waitFor(() => getGridListItems(doc).length == 3);
-  checkGridList(
-    [
-      "div#top-level-com-grid",
-      "div#iframe-org-grid",
-      "section#org-added-grid-container",
-    ],
-    "The same-origin iframe grids were removed from the list"
-  );
-
-  SpecialPowers.spawn(gBrowser.selectedBrowser, [], () => {
-    content.document.querySelector("iframe#remote").remove();
-  });
-
-  await waitFor(() => getGridListItems(doc).length == 1);
-  checkGridList(
-    ["div#top-level-com-grid"],
-    "The remote iframe grids were removed as well"
-  );
-
-  info("Navigate to a new origin");
-  await navigateTo(getDocumentBuilderUrl("example.org", "top-level-org-grid"));
-  await waitFor(() => {
-    const listItems = getGridListItems(doc);
-    return (
-      listItems.length == 1 &&
-      listItems[0].textContent.includes("#top-level-org-grid")
-    );
-  });
-  checkGridList(
-    ["div#top-level-org-grid"],
-    "The grid from the new origin document is displayed"
-  );
-
-  info("Check that adding remote iframe will still update the grid list");
-  SpecialPowers.spawn(
-    gBrowser.selectedBrowser,
-    [getDocumentBuilderUrl("example.com", "iframe-com-grid-remote")],
-    src => {
-      const iframe = content.document.createElement("iframe");
-      iframe.id = "remote";
-      iframe.src = src;
-      content.document.body.append(iframe);
-    }
-  );
-
-  await waitFor(() => getGridListItems(doc).length == 2);
-  checkGridList(
-    ["div#top-level-org-grid", "div#iframe-com-grid-remote"],
-    "The grid from the new origin document is displayed"
-  );
-
-  info(
-    "Check that adding same-origin iframe with a grid will update the grid list"
-  );
-  SpecialPowers.spawn(
-    gBrowser.selectedBrowser,
-    [getDocumentBuilderUrl("example.org", "iframe-org-grid-same-origin")],
-    src => {
-      const iframe = content.document.createElement("iframe");
-      iframe.id = "same-origin";
-      iframe.src = src;
-      content.document.body.append(iframe);
-    }
-  );
-  await waitFor(() => getGridListItems(doc).length == 3);
-  checkGridList(
-    [
-      "div#top-level-org-grid",
-      "div#iframe-com-grid-remote",
-      "div#iframe-org-grid-same-origin",
-    ],
-    "The grid from the new same-origin iframe is displayed"
-  );
-});
-
-function getDocumentBuilderUrl(origin, gridContainerId) {
-  return `http://${origin}/document-builder.sjs?html=${encodeURIComponent(
-    `<style>
-      #${gridContainerId} {
-        display: grid;
-      }
-    </style>
-    <div id="${gridContainerId}"></div>`
-  )}`;
-}
-
-function getGridListItems(doc) {
-  return Array.from(doc.querySelectorAll("#grid-list .objectBox-node"));
-}
-
-function checkGridListItems(doc, expectedItems, assertionText) {
-  const gridItems = getGridListItems(doc).map(el => el.textContent);
-  is(
-    JSON.stringify(gridItems.sort()),
-    JSON.stringify(expectedItems.sort()),
-    assertionText
-  );
-}
--- a/devtools/client/inspector/inspector.js
+++ b/devtools/client/inspector/inspector.js
@@ -1527,48 +1527,35 @@ Inspector.prototype = {
    * Starts listening for reflows in the targetFront of the currently selected nodeFront.
    */
   async trackReflowsInSelection() {
     this.untrackReflowsInSelection();
     if (!this.selection.nodeFront) {
       return;
     }
 
-    if (this._destroyed) {
-      return;
-    }
-
-    try {
-      await this.commands.resourceCommand.watchResources(
-        [this.commands.resourceCommand.TYPES.REFLOW],
-        {
-          onAvailable: this.onReflowInSelection,
-        }
-      );
-    } catch (e) {
-      // it can happen that watchResources fails as the client closes while we're processing
-      // some asynchronous call.
-      // In order to still get valid exceptions, we re-throw the exception if the inspector
-      // isn't destroyed.
-      if (!this._destroyed) {
-        throw e;
-      }
-    }
+    const { targetFront } = this.selection.nodeFront;
+    this.reflowFront = await targetFront.getFront("reflow");
+    this.reflowFront.on("reflows", this.onReflowInSelection);
+    this.reflowFront.start();
   },
 
   /**
    * Stops listening for reflows.
    */
   untrackReflowsInSelection() {
-    this.commands.resourceCommand.unwatchResources(
-      [this.commands.resourceCommand.REFLOW],
-      {
-        onAvailable: this.onReflowInSelection,
-      }
-    );
+    // Check the actorID because the reflowFront is a target scoped actor and
+    // might have been destroyed after switching targets.
+    if (!this.reflowFront || !this.reflowFront.actorID) {
+      return;
+    }
+
+    this.reflowFront.off("reflows", this.onReflowInSelection);
+    this.reflowFront.stop();
+    this.reflowFront = null;
   },
 
   onReflowInSelection() {
     // This event will be fired whenever a reflow is detected in the target front of the
     // selected node front (so when a reflow is detected inside any of the windows that
     // belong to the BrowsingContext when the currently selected node lives).
     this.emit("reflow-in-selected-target");
   },
@@ -1707,17 +1694,16 @@ Inspector.prototype = {
     resourceCommand.unwatchResources(
       [
         resourceCommand.TYPES.ROOT_NODE,
         resourceCommand.TYPES.CSS_CHANGE,
         resourceCommand.TYPES.DOCUMENT_EVENT,
       ],
       { onAvailable: this.onResourceAvailable }
     );
-    this.untrackReflowsInSelection();
 
     this._is3PaneModeChromeEnabled = null;
     this._is3PaneModeEnabled = null;
     this._markupBox = null;
     this._markupFrame = null;
     this._toolbox = null;
     this.breadcrumbs = null;
     this.panelDoc = null;
--- a/devtools/server/actors/layout.js
+++ b/devtools/server/actors/layout.js
@@ -494,20 +494,16 @@ const LayoutActor = ActorClassWithSpec(l
       node = node.rawNode;
     }
 
     // Root node can be a #document object, which does not support getElementsWithGrid.
     if (node.nodeType === nodeConstants.DOCUMENT_NODE) {
       node = node.documentElement;
     }
 
-    if (!node) {
-      return [];
-    }
-
     const gridElements = node.getElementsWithGrid();
     let gridActors = gridElements.map(n => new GridActor(this, n));
 
     const frames = node.querySelectorAll("iframe, frame");
     for (const frame of frames) {
       gridActors = gridActors.concat(this.getGrids(frame.contentDocument));
     }
 
--- a/devtools/server/actors/reflow.js
+++ b/devtools/server/actors/reflow.js
@@ -300,17 +300,17 @@ LayoutChangesObserver.prototype = {
   /**
    * Start the event loop, which regularly checks if there are any observer
    * events to be sent as batched events
    * Calls itself in a loop.
    */
   _startEventLoop: function() {
     // Avoid emitting events if the targetActor has been detached (may happen
     // during shutdown)
-    if (!this.targetActor || this.targetActor.isDestroyed()) {
+    if (!this.targetActor || !this.targetActor.attached) {
       return;
     }
 
     // Send any reflows we have
     if (this.reflows && this.reflows.length) {
       this.emit("reflows", this.reflows);
       this.reflows = [];
     }
--- a/devtools/server/actors/resources/index.js
+++ b/devtools/server/actors/resources/index.js
@@ -11,17 +11,16 @@ const TYPES = {
   CSS_CHANGE: "css-change",
   CSS_MESSAGE: "css-message",
   DOCUMENT_EVENT: "document-event",
   ERROR_MESSAGE: "error-message",
   PLATFORM_MESSAGE: "platform-message",
   NETWORK_EVENT: "network-event",
   STYLESHEET: "stylesheet",
   NETWORK_EVENT_STACKTRACE: "network-event-stacktrace",
-  REFLOW: "reflow",
   SOURCE: "source",
   THREAD_STATE: "thread-state",
   SERVER_SENT_EVENT: "server-sent-event",
   WEBSOCKET: "websocket",
   // storage types
   CACHE_STORAGE: "Cache",
   COOKIE: "cookies",
   INDEXED_DB: "indexed-db",
@@ -71,19 +70,16 @@ const FrameTargetResources = augmentReso
     path: "devtools/server/actors/resources/stylesheets",
   },
   [TYPES.NETWORK_EVENT]: {
     path: "devtools/server/actors/resources/network-events-content",
   },
   [TYPES.NETWORK_EVENT_STACKTRACE]: {
     path: "devtools/server/actors/resources/network-events-stacktraces",
   },
-  [TYPES.REFLOW]: {
-    path: "devtools/server/actors/resources/reflow",
-  },
   [TYPES.SOURCE]: {
     path: "devtools/server/actors/resources/sources",
   },
   [TYPES.THREAD_STATE]: {
     path: "devtools/server/actors/resources/thread-states",
   },
   [TYPES.SERVER_SENT_EVENT]: {
     path: "devtools/server/actors/resources/server-sent-events",
--- a/devtools/server/actors/resources/moz.build
+++ b/devtools/server/actors/resources/moz.build
@@ -14,17 +14,16 @@ DevToolsModules(
     "css-messages.js",
     "document-event.js",
     "error-messages.js",
     "index.js",
     "network-events-content.js",
     "network-events-stacktraces.js",
     "network-events.js",
     "platform-messages.js",
-    "reflow.js",
     "server-sent-events.js",
     "sources.js",
     "storage-cache.js",
     "storage-cookie.js",
     "storage-indexed-db.js",
     "storage-local-storage.js",
     "storage-session-storage.js",
     "stylesheets.js",
deleted file mode 100644
--- a/devtools/server/actors/resources/reflow.js
+++ /dev/null
@@ -1,63 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-const {
-  TYPES: { REFLOW },
-} = require("devtools/server/actors/resources/index");
-const Targets = require("devtools/server/actors/targets/index");
-
-const {
-  getLayoutChangesObserver,
-  releaseLayoutChangesObserver,
-} = require("devtools/server/actors/reflow");
-
-class ReflowWatcher {
-  /**
-   * Start watching for reflows related to a given Target Actor.
-   *
-   * @param TargetActor targetActor
-   *        The target actor from which we should observe reflows
-   * @param Object options
-   *        Dictionary object with following attributes:
-   *        - onAvailable: mandatory function
-   *          This will be called for each resource.
-   */
-  async watch(targetActor, { onAvailable }) {
-    // Only track reflow for non-ParentProcess FRAME targets
-    if (
-      targetActor.targetType !== Targets.TYPES.FRAME ||
-      targetActor.typeName === "parentProcessTarget"
-    ) {
-      return;
-    }
-
-    this._targetActor = targetActor;
-
-    const onReflows = reflows => {
-      onAvailable([
-        {
-          resourceType: REFLOW,
-          reflows,
-        },
-      ]);
-    };
-
-    this._observer = getLayoutChangesObserver(targetActor);
-    this._offReflows = this._observer.on("reflows", onReflows);
-    this._observer.start();
-  }
-
-  destroy() {
-    releaseLayoutChangesObserver(this._targetActor);
-
-    if (this._offReflows) {
-      this._offReflows();
-      this._offReflows = null;
-    }
-  }
-}
-
-module.exports = ReflowWatcher;
--- a/devtools/server/actors/watcher.js
+++ b/devtools/server/actors/watcher.js
@@ -151,17 +151,16 @@ exports.WatcherActor = protocol.ActorCla
           [Resources.TYPES.COOKIE]: hasBrowserElement,
           [Resources.TYPES.ERROR_MESSAGE]: true,
           [Resources.TYPES.INDEXED_DB]: hasBrowserElement,
           [Resources.TYPES.LOCAL_STORAGE]: hasBrowserElement,
           [Resources.TYPES.SESSION_STORAGE]: hasBrowserElement,
           [Resources.TYPES.PLATFORM_MESSAGE]: true,
           [Resources.TYPES.NETWORK_EVENT]: hasBrowserElement,
           [Resources.TYPES.NETWORK_EVENT_STACKTRACE]: hasBrowserElement,
-          [Resources.TYPES.REFLOW]: true,
           [Resources.TYPES.STYLESHEET]: hasBrowserElement,
           [Resources.TYPES.SOURCE]: hasBrowserElement,
           [Resources.TYPES.THREAD_STATE]: hasBrowserElement,
           [Resources.TYPES.SERVER_SENT_EVENT]: hasBrowserElement,
           [Resources.TYPES.WEBSOCKET]: hasBrowserElement,
         },
         // @backward-compat { version 91 } DOCUMENT_EVENT's will-navigate start being notified,
         //                                 to replace target actor's will-navigate event
--- a/devtools/shared/commands/resource/legacy-listeners/moz.build
+++ b/devtools/shared/commands/resource/legacy-listeners/moz.build
@@ -11,17 +11,16 @@ DevToolsModules(
     "css-messages.js",
     "error-messages.js",
     "extension-storage.js",
     "indexed-db.js",
     "local-storage.js",
     "network-event-stacktraces.js",
     "network-events.js",
     "platform-messages.js",
-    "reflow.js",
     "root-node.js",
     "server-sent-events.js",
     "session-storage.js",
     "source.js",
     "storage-utils.js",
     "stylesheet.js",
     "thread-states.js",
     "websocket.js",
deleted file mode 100644
--- a/devtools/shared/commands/resource/legacy-listeners/reflow.js
+++ /dev/null
@@ -1,20 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-const ResourceCommand = require("devtools/shared/commands/resource/resource-command");
-
-module.exports = async function({ targetFront, onAvailable }) {
-  const reflowFront = await targetFront.getFront("reflow");
-  reflowFront.on("reflows", reflows =>
-    onAvailable([
-      {
-        resourceType: ResourceCommand.TYPES.REFLOW,
-        reflows,
-      },
-    ])
-  );
-  await reflowFront.start();
-};
--- a/devtools/shared/commands/resource/resource-command.js
+++ b/devtools/shared/commands/resource/resource-command.js
@@ -1028,17 +1028,16 @@ ResourceCommand.TYPES = ResourceCommand.
   WEBSOCKET: "websocket",
   COOKIE: "cookies",
   LOCAL_STORAGE: "local-storage",
   SESSION_STORAGE: "session-storage",
   CACHE_STORAGE: "Cache",
   EXTENSION_STORAGE: "extension-storage",
   INDEXED_DB: "indexed-db",
   NETWORK_EVENT_STACKTRACE: "network-event-stacktrace",
-  REFLOW: "reflow",
   SOURCE: "source",
   THREAD_STATE: "thread-state",
   SERVER_SENT_EVENT: "server-sent-event",
 };
 module.exports = ResourceCommand;
 
 // Backward compat code for each type of resource.
 // Each section added here should eventually be removed once the equivalent server
@@ -1096,18 +1095,16 @@ const LegacyListeners = {
   [ResourceCommand.TYPES
     .NETWORK_EVENT_STACKTRACE]: require("devtools/shared/commands/resource/legacy-listeners/network-event-stacktraces"),
   [ResourceCommand.TYPES
     .SOURCE]: require("devtools/shared/commands/resource/legacy-listeners/source"),
   [ResourceCommand.TYPES
     .THREAD_STATE]: require("devtools/shared/commands/resource/legacy-listeners/thread-states"),
   [ResourceCommand.TYPES
     .SERVER_SENT_EVENT]: require("devtools/shared/commands/resource/legacy-listeners/server-sent-events"),
-  [ResourceCommand.TYPES
-    .REFLOW]: require("devtools/shared/commands/resource/legacy-listeners/reflow"),
 };
 
 // Optional transformers for each type of resource.
 // Each module added here should be a function that will receive the resource, the target, …
 // and perform some transformation on the resource before it will be emitted.
 // This is a good place to handle backward compatibility and manual resource marshalling.
 const ResourceTransformers = {
   [ResourceCommand.TYPES
--- a/devtools/shared/commands/resource/tests/browser.ini
+++ b/devtools/shared/commands/resource/tests/browser.ini
@@ -38,17 +38,16 @@ support-files =
 [browser_resources_css_changes.js]
 [browser_resources_css_messages.js]
 [browser_resources_document_events.js]
 [browser_resources_error_messages.js]
 [browser_resources_getAllResources.js]
 [browser_resources_network_event_stacktraces.js]
 [browser_resources_network_events.js]
 [browser_resources_platform_messages.js]
-[browser_resources_reflows.js]
 [browser_resources_root_node.js]
 [browser_resources_server_sent_events.js]
 [browser_resources_several_resources.js]
 [browser_resources_sources.js]
 [browser_resources_stylesheets.js]
 [browser_resources_target_destroy.js]
 [browser_resources_target_resources_race.js]
 [browser_resources_target_switching.js]
deleted file mode 100644
--- a/devtools/shared/commands/resource/tests/browser_resources_reflows.js
+++ /dev/null
@@ -1,109 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-// Test the ResourceCommand API for reflows
-
-const { TYPES } = require("devtools/shared/commands/resource/resource-command");
-
-add_task(async function() {
-  const tab = await addTab(
-    "http://example.com/document-builder.sjs?html=<h1>Test reflow resources</h1>"
-  );
-
-  const { client, resourceCommand, targetCommand } = await initResourceCommand(
-    tab
-  );
-
-  const resources = [];
-  const onAvailable = _resources => {
-    resources.push(..._resources);
-  };
-  await resourceCommand.watchResources([TYPES.REFLOW], {
-    onAvailable,
-  });
-
-  is(resources.length, 0, "No reflow resource were sent initially");
-
-  await SpecialPowers.spawn(tab.linkedBrowser, [], () => {
-    const el = content.document.createElement("div");
-    el.textContent = "1";
-    content.document.body.appendChild(el);
-  });
-
-  await waitFor(() => resources.length === 1);
-  checkReflowResource(resources[0]);
-
-  await SpecialPowers.spawn(tab.linkedBrowser, [], () => {
-    const el = content.document.querySelector("div");
-    el.style.display = "inline-grid";
-  });
-
-  await waitFor(() => resources.length === 2);
-  ok(
-    true,
-    "A reflow resource is sent when the display property of an element is modified"
-  );
-  checkReflowResource(resources.at(-1));
-
-  info("Check that adding an iframe does emit a reflow");
-  const iframeBC = await SpecialPowers.spawn(
-    tab.linkedBrowser,
-    [],
-    async () => {
-      const el = content.document.createElement("iframe");
-      const onIframeLoaded = new Promise(resolve =>
-        el.addEventListener("load", resolve, { once: true })
-      );
-      content.document.body.appendChild(el);
-      el.src =
-        "http://example.org/document-builder.sjs?html=<h2>remote iframe</h2>";
-      await onIframeLoaded;
-      return el.browsingContext;
-    }
-  );
-
-  await waitFor(() => resources.length === 3);
-  ok(true, "A reflow resource was received when adding a remote iframe");
-  checkReflowResource(resources.at(-1));
-
-  info("Check that we receive reflow resources for the remote iframe");
-  await SpecialPowers.spawn(iframeBC, [], () => {
-    const el = content.document.createElement("section");
-    el.textContent = "remote org iframe";
-    el.style.display = "grid";
-    content.document.body.appendChild(el);
-  });
-
-  await waitFor(() => resources.length === 4);
-  if (isFissionEnabled()) {
-    ok(
-      resources.at(-1).targetFront.url.includes("example.org"),
-      "The reflow resource is linked to the remote target"
-    );
-  }
-  checkReflowResource(resources.at(-1));
-
-  targetCommand.destroy();
-  await client.close();
-});
-
-function checkReflowResource(resource) {
-  is(
-    resource.resourceType,
-    TYPES.REFLOW,
-    "The resource has the expected resourceType"
-  );
-
-  ok(Array.isArray(resource.reflows), "the `reflows` property is an array");
-  for (const reflow of resource.reflows) {
-    is(
-      Number.isFinite(reflow.start),
-      true,
-      "reflow start property is a number"
-    );
-    is(Number.isFinite(reflow.end), true, "reflow end property is a number");
-    ok(reflow.end >= reflow.start, "end is greater than start");
-  }
-}