Commit ec323ff0 authored by Cristian Tuns's avatar Cristian Tuns
Browse files

Backed out 9 changesets (bug 1733039, bug 1730167, bug 1732334, bug 1730170,...

Backed out 9 changesets (bug 1733039, bug 1730167, bug 1732334, bug 1730170, bug 1730162, bug 1732690, bug 1732906) for causing mochitest failures. CLOSED TREE

Backed out changeset bf18a96d849f (bug 1733039)
Backed out changeset f2419a8c8c5f (bug 1732906)
Backed out changeset 3ff8cca764f1 (bug 1732690)
Backed out changeset 1107e4f2779f (bug 1732334)
Backed out changeset 090410cf3b8c (bug 1730170)
Backed out changeset d253c4bf94ac (bug 1730162)
Backed out changeset 6075634c3db2 (bug 1730167)
Backed out changeset 11370a6988be (bug 1730167)
Backed out changeset 6f2825300e65 (bug 1730167)
parent 34b456f2
Loading
Loading
Loading
Loading
+8 −11
Original line number Diff line number Diff line
@@ -43,14 +43,11 @@ class AccessibleFront extends FrontClassWithSpec(accessibleSpec) {
    return this.getParent();
  }

  get useChildTargetToFetchChildren() {
  get remoteFrame() {
    if (!BROWSER_TOOLBOX_FISSION_ENABLED && this.targetFront.isParentProcess) {
      return false;
    }
    // @backward-compat { version 94 } useChildTargetToFetchChildren was added in 94, so
    // we still need to check for `remoteFrame` when connecting to older server.
    // When 94 is in release, we can check useChildTargetToFetchChildren only
    return this._form.useChildTargetToFetchChildren || this._form.remoteFrame;
    return this._form.remoteFrame;
  }

  get role() {
@@ -176,7 +173,7 @@ class AccessibleFront extends FrontClassWithSpec(accessibleSpec) {
  }

  async children() {
    if (!this.useChildTargetToFetchChildren) {
    if (!this.remoteFrame) {
      return super.children();
    }

@@ -215,7 +212,7 @@ class AccessibleFront extends FrontClassWithSpec(accessibleSpec) {
   *         Complete snapshot of current accessible front.
   */
  async _accumulateSnapshot(snapshot) {
    const { childCount, useChildTargetToFetchChildren } = snapshot;
    const { childCount, remoteFrame } = snapshot;
    // No children, we are done.
    if (childCount === 0) {
      return snapshot;
@@ -223,7 +220,7 @@ class AccessibleFront extends FrontClassWithSpec(accessibleSpec) {

    // If current accessible is not a remote frame, continue accumulating inside
    // its children.
    if (!useChildTargetToFetchChildren) {
    if (!remoteFrame) {
      const childSnapshots = [];
      for (const childSnapshot of snapshot.children) {
        childSnapshots.push(this._accumulateSnapshot(childSnapshot));
@@ -238,9 +235,9 @@ class AccessibleFront extends FrontClassWithSpec(accessibleSpec) {
    const frameNodeFront = await inspectorFront.getNodeActorFromContentDomReference(
      snapshot.contentDOMReference
    );
    // Remove contentDOMReference and useChildTargetToFetchChildren properties.
    // Remove contentDOMReference and remoteFrame properties.
    delete snapshot.contentDOMReference;
    delete snapshot.useChildTargetToFetchChildren;
    delete snapshot.remoteFrame;
    if (!frameNodeFront) {
      return snapshot;
    }
@@ -487,7 +484,7 @@ class AccessibleWalkerFront extends FrontClassWithSpec(accessibleWalkerSpec) {
    // If no remote frames were found, currentElm will be null.
    while (currentElm) {
      // Safety check to ensure that the currentElm is a remote frame.
      if (currentElm.useChildTargetToFetchChildren) {
      if (currentElm.remoteFrame) {
        const {
          walker: domWalkerFront,
        } = await currentElm.targetFront.getFront("inspector");
+10 −16
Original line number Diff line number Diff line
@@ -281,15 +281,12 @@ class NodeFront extends FrontClassWithSpec(nodeSpec) {
  get numChildren() {
    return this._form.numChildren;
  }
  get useChildTargetToFetchChildren() {
  get remoteFrame() {
    if (!BROWSER_TOOLBOX_FISSION_ENABLED && this._hasParentProcessTarget) {
      return false;
    }

    // @backward-compat { version 94 } useChildTargetToFetchChildren was added in 94, so
    // we still need to check for `remoteFrame` when connecting to older server.
    // When 94 is in release, we can check useChildTargetToFetchChildren only
    return this._form.useChildTargetToFetchChildren || this._form.remoteFrame;
    return this._form.remoteFrame;
  }
  get hasEventListeners() {
    return this._form.hasEventListeners;
@@ -532,23 +529,20 @@ class NodeFront extends FrontClassWithSpec(nodeSpec) {
    return actor.rawNode;
  }

  async connectToFrame() {
    if (!this.useChildTargetToFetchChildren) {
      console.warn("Tried to open connection to an invalid frame.");
  async connectToRemoteFrame() {
    if (!this.remoteFrame) {
      console.warn("Tried to open remote connection to an invalid frame.");
      return null;
    }
    if (
      this._childBrowsingContextTarget &&
      !this._childBrowsingContextTarget.isDestroyed()
    ) {
      return this._childBrowsingContextTarget;
    if (this._remoteFrameTarget && !this._remoteFrameTarget.isDestroyed()) {
      return this._remoteFrameTarget;
    }

    // Get the target for this frame element
    this._childBrowsingContextTarget = await this.targetFront.getWindowGlobalTarget(
    // Get the target for this remote frame element
    this._remoteFrameTarget = await this.targetFront.getWindowGlobalTarget(
      this._form.browsingContextID
    );
    return this._childBrowsingContextTarget;
    return this._remoteFrameTarget;
  }
}

+23 −8
Original line number Diff line number Diff line
@@ -334,11 +334,11 @@ class WalkerFront extends FrontClassWithSpec(walkerSpec) {
  }

  async children(node, options) {
    if (!node.useChildTargetToFetchChildren) {
    if (!node.remoteFrame) {
      return super.children(node, options);
    }
    const target = await node.connectToFrame();
    const walker = (await target.getFront("inspector")).walker;
    const remoteTarget = await node.connectToRemoteFrame();
    const walker = (await remoteTarget.getFront("inspector")).walker;

    // Finally retrieve the NodeFront of the remote frame's document
    const documentNode = await walker.getRootNode();
@@ -407,12 +407,10 @@ class WalkerFront extends FrontClassWithSpec(walkerSpec) {
      if (!selector) {
        return nodeFront;
      }
      nodeFront = await nodeFront.walkerFront.querySelector(
        nodeFront,
        selector
      );
      nodeFront = await this.querySelector(nodeFront, selector);

      // It's possible the containing iframe isn't available by the time
      // walkerFront.querySelector is called, which causes the re-selected node to be
      // this.querySelector is called, which causes the re-selected node to be
      // unavailable. There also isn't a way for us to know when all iframes on the page
      // have been created after a reload. Because of this, we should should bail here.
      if (!nodeFront) {
@@ -446,6 +444,23 @@ class WalkerFront extends FrontClassWithSpec(walkerSpec) {
      return querySelectors(nodeFront) || nodeFront;
    };
    const nodeFront = await this.getRootNode();

    // If rootSelectors are [frameSelector1, ..., frameSelectorN, rootSelector]
    // we expect that [frameSelector1, ..., frameSelectorN] will also be in
    // nodeSelectors.
    // Otherwise it means the nodeSelectors target a node outside of this walker
    // and we should return null.
    const rootFrontSelectors = await nodeFront.getAllSelectors();
    for (let i = 0; i < rootFrontSelectors.length - 1; i++) {
      if (rootFrontSelectors[i] !== nodeSelectors[i]) {
        return null;
      }
    }

    // The query will start from the walker's rootNode, remove all the
    // "frameSelectors".
    nodeSelectors.splice(0, rootFrontSelectors.length - 1);

    return querySelectors(nodeFront);
  }

+1 −1
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ add_task(async function() {
    "Shapes highlighter toggle is active."
  );
  ok(
    inspector.inspectorFront.getKnownHighlighter(HIGHLIGHTER_TYPE).actorID,
    highlighters.highlighters[HIGHLIGHTER_TYPE],
    "CSS shapes highlighter created in the rule-view."
  );
  ok(highlighters.shapesHighlighterShown, "CSS shapes highlighter is shown.");
+1 −1
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ add_task(async function() {
    "shapes highlighter toggle is active."
  );
  ok(
    inspector.inspectorFront.getKnownHighlighter(HIGHLIGHTER_TYPE).actorID,
    highlighters.highlighters[HIGHLIGHTER_TYPE],
    "CSS shapes highlighter created in the rule-view."
  );
  ok(highlighters.shapesHighlighterShown, "CSS shapes highlighter is shown.");
Loading