Closed Bug 795978 Opened 12 years ago Closed 10 years ago

Error: this._containers is undefined in MarkupView.jsm Line: 327

Categories

(DevTools :: Inspector, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 852996

People

(Reporter: Optimizer, Unassigned)

References

Details

(Whiteboard: [backed-out])

Attachments

(1 obsolete file)

After opening and closing the html panel of inspector once, using the latest Nightly build of 1st October, I am getting these errors in my error console:

Timestamp: 10/1/2012 10:40:51 PM
Error: TypeError: this._containers is undefined
Source File: resource:///modules/devtools/MarkupView.jsm
Line: 327

Some mutation observer was not removed upon closing markup view.
Noticed this today while looking for another problem with the Inspector.

I am able to get a bunch of these errors on the Web Console after I close the Inspector so it does seem like we have an observer sticking around.
Dave, could you take a quick look at that?
Flags: needinfo?(dcamp)
Flags: needinfo?(dcamp)
I found when I do a 
$.get(url, function(data){ 
   $('#mydiv').html(data);
}
and inside this "data" I have more jquery functions, the error occurs.

/**
   * Mutation observer used for included nodes.
   */
  _mutationObserver: function MT__mutationObserver(aMutations)
  {
    for (let mutation of aMutations) {

### here!!!!! this._containers is undefined
      let container = this._containers.get(mutation.target);
###
      if (!container) {
        // Container might not exist if this came from a load event for an iframe
        // we're not viewing.
        continue;
      }
      if (mutation.type === "attributes" || mutation.type === "characterData") {
        container.update();
      } else if (mutation.type === "childList") {
        this._updateChildren(container);
      }
    }
    this._inspector._emit("markupmutation");
  },
importNode is adding a load handler on the root that isn't being removed.
https://mxr.mozilla.org/mozilla-central/source/browser/devtools/markupview/MarkupView.jsm#304

We need to save a reference to MP_watch_contentLoaded and remove it in the destroy function (MarkupView.jsm#625).
I'm seubg a very similar error after upgradeing to 21 on the beta channel:
TypeError: this._containers is undefined @ resource://app/modules/devtools/MarkupView.jsm:330
Assignee: nobody → jryans
Status: NEW → ASSIGNED
OS: Windows 7 → All
Hardware: x86_64 → All
Attached patch Patch v1 (obsolete) — Splinter Review
This removes the handler on destroy, which prevents the error from being triggered.

I wasn't quite sure how to test this change, but let me know if you have a suggestion.  I've verified that the existing markup view tests pass locally.
Attachment #744200 - Flags: review?(mratcliffe)
Comment on attachment 744200 [details] [diff] [review]
Patch v1

Review of attachment 744200 [details] [diff] [review]:
-----------------------------------------------------------------

Perfect, r+
Attachment #744200 - Flags: review?(mratcliffe) → review+
Whiteboard: [land-in-fx-team]
can this land?
https://hg.mozilla.org/integration/fx-team/rev/70538913a42e

cha cha!

Thanks Ryan. :)
Whiteboard: [land-in-fx-team] → [fixed-in-fx-team]
Whiteboard: [fixed-in-fx-team] → [backed-out]
Assignee: jryans → nobody
Status: ASSIGNED → NEW
What's the status of this bug?
I attempted a fix a few months back, but it led to further issues and was backed out.

I haven't had time to try again myself, so that's why I unassigned this one.

IIRC, my patch fixed the reported error, but then introduced intermittent testing issues.  For example, with the patch, markup view tests would pass when run independently, but not when run as a group.
Priority: -- → P3
Actually, marking as P2 because this is a verified bug with a verified (but flawed) fix. We should get this fixed and relanded ASAP.
Priority: P3 → P2
any progress on this?
It looks like a similar fix to my attempted patch was made in bug 852996, so this should be taken care of now.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: