Note: There are a few cases of duplicates in user autocompletion which are being worked on.

Replace InspectorStore dictionaries with Inspector instances

RESOLVED FIXED in Firefox 14

Status

()

Firefox
Developer Tools: Inspector
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: dcamp, Assigned: dcamp)

Tracking

13 Branch
Firefox 14
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

5 years ago
Bug 707809 exposes a new Inspector object that's supposed to have the same lifetime as an InspectorStore.  Inspector should replace InspectorStore.
(Assignee)

Updated

5 years ago
Summary: Merge Inspector and InspectorStore objects → Replace InspectorStore dictionaries with Inspector instances
(Assignee)

Comment 1

5 years ago
Created attachment 612391 [details] [diff] [review]
v1
Attachment #612391 - Flags: review?(rcampbell)
Comment on attachment 612391 [details] [diff] [review]
v1

   toggleHTMLPanel: function TP_toggle()
   {
     if (this.treePanel.isOpen()) {
       this.treePanel.close();
       Services.prefs.setBoolPref("devtools.inspector.htmlPanelOpen", false);
-      this.store.setValue(this.winID, "htmlPanelOpen", false);
+      this.currentInspector._htmlPanelOpen = false;
     } else {
       this.treePanel.open();
       Services.prefs.setBoolPref("devtools.inspector.htmlPanelOpen", true);
-      this.store.setValue(this.winID, "htmlPanelOpen", true);
+      this.currentInspector._htmlPanelOpen = true;
     }
   },

this method still bugs me.

I think we could do something like:

toggleHTMLPanel() {
  let wasClosed = !this.treePanel.isOpen();

  if (wasClosed)
    this.treePanel.open();
  else
    this.treePanel.close();

  Services.prefs.setBoolPref("devtools.inspector.htmlPanelOpen", wasClosed);
  this.store.setValue(this.winID, "htmlPanelOpen", wasClosed);
  this.currentInspector._htmlPanelOpen = wasClosed;
}

I'm not sure this is worth the change or if this is more or less confusing than the duplicated methods though. Dealer's choice.

-    this._currentInspector = new Inspector(this);
+    this.initializeStore();

I thought we were getting rid of InspectorStore...

I see what you did there. Repurposing it to store the inspector instances. Looks good.

does browser_inspector_tab_switch.js just work with this new implementation? If so, that's pretty sweet.

Should probably send it through try before landing.
Attachment #612391 - Flags: review?(rcampbell) → review+
(Assignee)

Comment 3

5 years ago
(In reply to Rob Campbell [:rc] (:robcee) from comment #2)

> this method still bugs me.
> 
> I think we could do something like:
> I'm not sure this is worth the change or if this is more or less confusing
> than the duplicated methods though. Dealer's choice.
> 

Yeah, that makes sense.  I'll do it.

> -    this._currentInspector = new Inspector(this);
> +    this.initializeStore();
> 
> I thought we were getting rid of InspectorStore...
> 
> I see what you did there. Repurposing it to store the inspector instances.
> Looks good.
> 
> does browser_inspector_tab_switch.js just work with this new implementation?
> If so, that's pretty sweet.

On my machine...

> 
> Should probably send it through try before landing.

Indeed.
(Assignee)

Comment 4

5 years ago
Created attachment 615517 [details] [diff] [review]
v2

Unbitrot (jimb and I spent a little while trying to find a reverse of 'rot', but this is the best we could find)
Attachment #612391 - Attachment is obsolete: true
(Assignee)

Updated

5 years ago
Blocks: 746010
(Assignee)

Comment 5

5 years ago
https://tbpl.mozilla.org/?tree=Try&rev=9bded5c0b43a
(Assignee)

Comment 6

5 years ago
https://hg.mozilla.org/integration/fx-team/rev/db5627efe52f
Whiteboard: [fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/db5627efe52f
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 14
You need to log in before you can comment on or make changes to this bug.