Closed Bug 1611096 Opened 5 years ago Closed 4 years ago

Blank inspector when using target-switching and fission

Categories

(DevTools :: Inspector, task, P1)

task

Tracking

(Fission Milestone:M6a, firefox78 fixed)

RESOLVED FIXED
Firefox 78
Fission Milestone M6a
Tracking Status
firefox78 --- fixed

People

(Reporter: jdescottes, Assigned: jdescottes)

References

(Blocks 1 open bug, Regressed 1 open bug)

Details

(Whiteboard: dt-fission-m2-mvp)

Attachments

(4 files, 22 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

What were you doing?

  1. set fission.autostart=true
  2. set devtools.target-switching.enabled=true
  3. restart Firefox
  4. open google.com, open the inspector
  5. navigate to mozilla.org

What happened?

Inspector will be blank with several errors in the stdout, mostly related to inspector-utils APIs called for an element that has apparently no ownerGlobal.

Spotted while reviewing https://bugzilla.mozilla.org/show_bug.cgi?id=1568874. It could be nice to fix the inspector a little bit (even if it's not perfect) it would make testing such patches easier. If the inspector is broken it's a bit hard to say if the sidebar panels support target-switching correctly or not.

For instance

"Error while calling actor 'domnode's method 'getAllSelectors'" "can't access property \"CSS\", ele.ownerGlobal is null"

What should have happened?

Target-switching for the inspector, with fission, never fully worked, even right after landing the initial support for it in Bug 1578242, but I think it's because the focus was rather on using targetlist apis, and maybe supporting the non-fission target switching (parent process <-> content process).

But most of the errors seem to come from the fact that we are trying to trigger the "onNewRoot" too soon on the inspector side. Looking at _onTargetAvailable, the method ends with

    if (this.isReady) {
      this.onNewRoot();
    }

If instead, we replace it with

    if (this.isReady) {
      this.walker.on("new-root", this.onNewRoot);
    }

The inspector seems to work better, at least when testing locally. Ideally, the walker would provide a way to know if the initial load is already done so that we can either call newRoot immediately or wait for the "new-root" event.

Anything else we should know?

The current comment above the onNewRoot call in _onTargetAvailable already mentions something similar, suggesting to share the code called in deferredOpen: https://searchfox.org/mozilla-central/rev/e878e5b81bb319c141900ce9cfcde732df5c8449/devtools/client/inspector/inspector.js#244-256

This was making the inspector destroy crash, if a target switch had occured before.

Assignee: nobody → jdescottes
Status: NEW → ASSIGNED

Tracking DevTools bugs for Fission Nightly (M6) milestone

Fission Milestone: --- → M6
Blocks: 1568874
See Also: 1568874

Depends on D60831
Adding a new trait in the previous changeset so let's remove this one.

Attachment #9122632 - Attachment is obsolete: true

Depends on D60964

This is often breaking target switching tests for the inspector. Depends on D62214

Depends on D62216

Depends on D62217

Attachment #9125432 - Attachment is obsolete: true
Attachment #9125433 - Attachment is obsolete: true
Attachment #9125434 - Attachment is obsolete: true
Attachment #9125435 - Attachment is obsolete: true
Attachment #9125436 - Attachment is obsolete: true
Attachment #9125437 - Attachment is obsolete: true

Depends on D62216

Depends on D62230

Depends on D62216
Same as D62229, but instead of introducing a new event, this preserves the new-root mutation approach

Priority: P3 → P1
Whiteboard: dt-fission-m2-mvp
Attachment #9125445 - Attachment is obsolete: true
Attachment #9125446 - Attachment is obsolete: true
Attachment #9125469 - Attachment is obsolete: true
Depends on: 1614918
Attachment #9125429 - Attachment is obsolete: true
Attachment #9122631 - Attachment is obsolete: true
Attachment #9122885 - Attachment is obsolete: true
Attachment #9125431 - Attachment is obsolete: true
Attachment #9126061 - Attachment is obsolete: true

This is often breaking target switching tests for the inspector
Depends on D62617

Attachment #9126174 - Attachment description: Bug 1611096 - Check webprogresslistener as a fallback for non loaded documents → Bug 1611096 - Check webprogresslistener as a fallback for non loaded documents
Attachment #9125444 - Attachment is obsolete: true
Depends on: 1619621
Attachment #9126167 - Attachment is obsolete: true

Depends on D62625

This is a WIP patch. It uses walker actor events directly instead of forwarding in the walker front.
It also simplifies the API around the RootNode exposed by the WalkerFront (mostly removing the internal rootNode promise)

Tentatively moving P1 Fission M6 bugs to M6a.

Fission Milestone: M6 → M6a
Depends on: 1628691

Comment on attachment 9126165 [details]
Bug 1611096 - Remove leftover usage of this._target in inspector.js

Revision D62616 was moved to bug 1628691. Setting attachment 9126165 [details] to obsolete.

Attachment #9126165 - Attachment is obsolete: true

Comment on attachment 9126166 [details]
Bug 1611096 - Remove deprecated trait retrieveNodeFromContentDomReference (Fx71)

Revision D62617 was moved to bug 1628691. Setting attachment 9126166 [details] to obsolete.

Attachment #9126166 - Attachment is obsolete: true
Attachment #9126173 - Attachment description: Bug 1611096 - Fix tests expecting newRoot mutations without calling watchRootNode → Bug 1611096 - Fix tests relying on newRoot mutations
Blocks: 1633348
Attachment #9136037 - Attachment is obsolete: true

Depends on D62625

Depends on D62625

Alternative to D73969

Attachment #9145994 - Attachment is obsolete: true
Attachment #9146066 - Attachment is obsolete: true
Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3703fbfe567a Add watch-like API for new root event r=ochameau,rcaliman https://hg.mozilla.org/integration/autoland/rev/a7242f506aa6 Add test for inspector target switching r=ochameau,rcaliman https://hg.mozilla.org/integration/autoland/rev/c86433fe8cd0 Fix tests relying on newRoot mutations r=rcaliman https://hg.mozilla.org/integration/autoland/rev/0fe3613ee36b Check webprogresslistener as a fallback for non loaded documents r=rcaliman,ochameau
Regressions: 1636444
Status: RESOLVED → REOPENED
Flags: needinfo?(jdescottes)
Resolution: FIXED → ---

I messed up the patch queue and missed a patch when landing...

Flags: needinfo?(jdescottes)
Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/0ba3aba8133f Add watch-like API for new root event r=ochameau,rcaliman https://hg.mozilla.org/integration/autoland/rev/690cc322f8be Add test for inspector target switching r=ochameau,rcaliman https://hg.mozilla.org/integration/autoland/rev/c67d4436a61e Fix tests relying on newRoot mutations r=rcaliman https://hg.mozilla.org/integration/autoland/rev/cc9959150347 Check webprogresslistener as a fallback for non loaded documents r=rcaliman,ochameau
Regressions: 1643442
Blocks: 1689572
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: