DOM Inspector doesn't observe its preferences correctly

RESOLVED FIXED in mozilla1.9alpha

Status

Other Applications
DOM Inspector
RESOLVED FIXED
12 years ago
11 years ago

People

(Reporter: neil@parkwaycc.co.uk, Assigned: sdwilsh)

Tracking

Trunk
mozilla1.9alpha

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

12 years ago
Here is a snippet from dom.js:
  onPrefChanged: function(aName)
   {
     if (aName == "inspector.dom.showAnon")
       this.setFlashSelected(PrefUtils.getPref("inspector.blink.on"));
 
     if (aName == "inspector.blink.on")
       this.setFlashSelected(PrefUtils.getPref("inspector.blink.on"));
 
     if (this.mFlasher) {
       if (aName == "inspector.blink.border-color") {
         this.mFlasher.color = PrefUtils.getPref("inspector.blink.border-color");
       } else if (aName == "inspector.blink.border-width") {
         this.mFlasher.thickness = PrefUtils.getPref("inspector.blink.border-width");
As you can see, if you update inspector.dom.showAnon it uses the wrong preferences to update. Worse, the other preferences, such as for whitespace nodes, aren't updated at all.
(Assignee)

Comment 1

12 years ago
This is kind of a duplicate of Bug 361090, which I filed yesterday.  However, this is a larger scope, so I'll think I'll mark that one a dup of this.
Assignee: dom-inspector → comrade693+bmo
(Assignee)

Updated

12 years ago
Status: NEW → ASSIGNED
(Assignee)

Comment 2

12 years ago
*** Bug 361090 has been marked as a duplicate of this bug. ***
(Assignee)

Comment 3

12 years ago
So, just summarizing what needs to be changed (and to make sure I'm not missing anything):
1) inspector.dom.showAnon calls the wrong function when the preference changes
2) inspector.dom.showWhitespaceNodes isn't updated
3) inspector.dom.showAccessibleNodes isn't updated

Everything else there looks right to me - am I missing anything?
(Assignee)

Comment 4

12 years ago
Created attachment 246033 [details] [diff] [review]
v1.0

Fixes what was noted in previous comment.
Attachment #246033 - Flags: superreview?(neil)
Attachment #246033 - Flags: review?(timeless)
(Reporter)

Comment 5

12 years ago
Comment on attachment 246033 [details] [diff] [review]
v1.0

It occurs to me that the menuitem could just flip the preference - the observer would then actually update the view.
Attachment #246033 - Flags: superreview?(neil) → superreview+
(Assignee)

Comment 6

12 years ago
(In reply to comment #5)
> (From update of attachment 246033 [details] [diff] [review] [edit])
> It occurs to me that the menuitem could just flip the preference - the observer
> would then actually update the view.

That's actually not a bad idea.  Followup bug perhaps?
(Assignee)

Updated

12 years ago
Attachment #246033 - Flags: review?(timeless) → review?(db48x)
Comment on attachment 246033 [details] [diff] [review]
v1.0

r=db48x
Attachment #246033 - Flags: review?(db48x) → review+
(Assignee)

Updated

12 years ago
Whiteboard: [checkin needed]
mozilla/extensions/inspector/resources/content/viewers/dom/dom.js 	1.43
Status: ASSIGNED → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → FIXED
Whiteboard: [checkin needed]
Target Milestone: --- → mozilla1.9alpha
Version: unspecified → Trunk
Depends on: 362047
(Assignee)

Updated

12 years ago
No longer depends on: 362047
QA Contact: timeless → dom-inspector
You need to log in before you can comment on or make changes to this bug.