Closed Bug 1568157 Opened 5 years ago Closed 5 years ago

Replace toolbox.{inspector,walker,selection,highlighter} with something based on target.getInspector() or target.getFront("inspector")

Categories

(DevTools :: Inspector, enhancement, P1)

enhancement

Tracking

(firefox70 fixed)

RESOLVED FIXED
Firefox 70
Tracking Status
firefox70 --- fixed

People

(Reporter: ochameau, Assigned: gl)

References

(Blocks 1 open bug)

Details

(Whiteboard: dt-fission-m1)

Attachments

(5 files, 3 obsolete files)

47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review

There attributes on the toolbox: inspector, highlighter, walker, selection:
https://searchfox.org/mozilla-central/source/devtools/client/framework/toolbox.js#487-517
should be removed.

The usage of these attributes is overly convoluted.
You somehow have to ensure that toolbox.initInspector() has been called before you try using them.
Also, this is related to bug 1568151 as that's another place, where we store a unique reference to only the top level tab document's inspector front. This will most likely be an issue for fission.
Bug 1568151 may actually fix a couple of places where we use these toolbox attribute, but most likely not all of them.
In the few left, we would still have to remove them.

As of today, we would replace them like this:

  • toolbox.inspector => await target.getInspector()
  • toolbox.walker => (await target.getInspector()).walker
  • toolbox.highlighter => (await target.getInspector()).highlighter
  • toolbox.selection => (await target.getInspector()).selection
    And you would no longer have to ensure that toolbox.initInspector is called!

Note that bug 1568151 is also related to this. If bug 1568151 lands before this work,
we would have to replace getInspector() by getFront("inspector").

Assignee: nobody → gl
Status: NEW → ASSIGNED
Priority: -- → P3

Also, removes the inspectorFront getter in toolbox.js.

Depends on D40317

It doesn't seem like we run into any test failures from removing these events.
So, this is an attempt to remove them.

Depends on D40318

This patch series depend on Bug 1568151.

Keywords: leave-open
Pushed by gluong@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4ed2ae72d108
Part 1: Replace `toolbox.inspectorFront` with the `inspectorFront` from `target.getFront("inspector")`. r=yulia,ochameau
Pushed by gluong@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7a40f7db7b32
Part 1: Replace `toolbox.inspectorFront` with the `inspectorFront` from `target.getFront("inspector")`. r=yulia,ochameau
https://hg.mozilla.org/integration/autoland/rev/c9ba1246ad59
Part 2: Replace `toolbox.{inspector,walker,selection,highlighter}` usage with the attributes from `target.getFront("inspector")` in inspector.js. r=yulia,ochameau
Depends on: 1572460
Whiteboard: dt-fission
Priority: P3 → P1
Attachment #9082430 - Attachment is obsolete: true
Attachment #9082435 - Attachment is obsolete: true
Attachment #9082431 - Attachment description: Bug 1568157 - Part 4: Replace `toolbox.highlighter` with the `highlighter` from `target.getFront("inspector")`. r=yulia,ochameau → Bug 1568157 - Part 3: Replace `toolbox.highlighter` with the contextual HighlighterFront. r=yulia,ochameau
Attachment #9082433 - Attachment description: Bug 1568157 - Part 5: Replace `toolbox.walker` with the `walker` from `target.getFront("inspector")`. r=yulia,ochameau → Bug 1568157 - Part 4: Replace `toolbox.walker` with the contextual WalkerFront. r=yulia,ochameau
Pushed by gluong@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c2546c971118
Part 3: Replace `toolbox.highlighter` with the contextual HighlighterFront. r=yulia
Keywords: leave-open
Pushed by gluong@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/949a3bb4cab0
Part 4: Replace `toolbox.walker` with the contextual WalkerFront. r=yulia
https://hg.mozilla.org/integration/autoland/rev/8231b28c7507
Part 5: Move the NodePicker initialization into a getter. r=yulia
Attachment #9082434 - Attachment is obsolete: true
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 70
Regressions: 1588728
Whiteboard: dt-fission → dt-fission dt-fission-m1
Whiteboard: dt-fission dt-fission-m1 → dt-fission-m1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: