Closed Bug 1654754 Opened 6 years ago Closed 5 years ago

Remove usage of actorHasMethod in grid inspector and highlighters-overlay

Categories

(DevTools :: Inspector, task, P3)

task

Tracking

(firefox84 fixed)

RESOLVED FIXED
84 Branch
Tracking Status
firefox84 --- fixed

People

(Reporter: jdescottes, Assigned: jdescottes)

References

Details

Attachments

(1 file)

actorHasMethod has too many pitfalls to be reliably used.

https://searchfox.org/mozilla-central/rev/dcd9c2d2bc19d96d487825eb70c2333a4d60994e/devtools/client/inspector/grids/grid-inspector.js#417

      if (
        isSubgrid &&
        (await this.inspector.currentTarget.actorHasMethod(
          "domwalker",
          "getParentGridNode"
        ))
      ) {

https://searchfox.org/mozilla-central/rev/dcd9c2d2bc19d96d487825eb70c2333a4d60994e/devtools/client/inspector/shared/highlighters-overlay.js#129

    if (this._canGetParentGridNode === undefined) {
      this._canGetParentGridNode = await this.target.actorHasMethod(
        "domwalker",
        "getParentGridNode"
      );
    }

We should update the grid inspector to use traits instead of actorHasMethod.

However, it looks like this check was introduced for backward compatibility and can probably be simply removed. "getParentGridNode" should be defined on all domwalker actors.

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: General → Inspector
Assignee: nobody → jdescottes
Status: NEW → ASSIGNED

The backward compatibility code was introduced in FF69 and can be removed.

Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b9e70c09985e [devtools] Remove actorHasMethod usage from grid inspector and highlighters-overlay r=rcaliman
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 84 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: