Closed
Bug 760370
Opened 12 years ago
Closed 11 years ago
Visually distinguish non-extensible objects
Categories
(DevTools :: Debugger, defect, P3)
DevTools
Debugger
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 24
People
(Reporter: past, Assigned: fitzgen)
References
Details
Attachments
(1 file, 2 obsolete files)
20.81 KB,
patch
|
vporof
:
review+
|
Details | Diff | Splinter Review |
From a recent discussion in es-discuss: https://mail.mozilla.org/pipermail/es-discuss/2012-May/022991.html We could alter the display of frozen, sealed and non-extensible objects in a similar fashion to what we do for writable, enumerable and configurable properties. I imagine a single character at the right side of the object value, with a "float: right" alignment, that reads either F(rozen), S(ealed) or N(on-extensible). Other ideas are more than welcome.
Updated•12 years ago
|
Assignee: nobody → vporof
Priority: -- → P3
Updated•12 years ago
|
Status: NEW → ASSIGNED
Comment 1•12 years ago
|
||
Test page: http://htmlpad.org/debugger-fsn/
Comment 2•12 years ago
|
||
Making a note here: We need protocol support. There's information only about the writable, enumerable, configurable properties in the messages.
Assignee | ||
Updated•11 years ago
|
Assignee: vporof → nfitzgerald
Comment 3•11 years ago
|
||
Somehow I think it would be more useful to have this in-your-face, not hidden in a tooltip. You don't get such objects everywhere, and it's important to.. distinguish them.
Assignee | ||
Comment 4•11 years ago
|
||
Victor, fair enough. Uploading my existing WIP now.
Assignee | ||
Comment 5•11 years ago
|
||
Breaking some mochitests, but hopefully I can sidestep this issue when switching from tooltips to something more in your face, as Victor suggests.
Assignee | ||
Comment 6•11 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=ca4f3deb58d3
Attachment #750523 -
Attachment is obsolete: true
Attachment #750728 -
Flags: review?(vporof)
Comment 7•11 years ago
|
||
Comment on attachment 750728 [details] [diff] [review] v1 Review of attachment 750728 [details] [diff] [review]: ----------------------------------------------------------------- Exemplary, but take a look at the comments below. ::: browser/devtools/debugger/test/browser_dbg_propertyview-12.js @@ +24,5 @@ > +} > + > +function testFSN() { > + gDebugger.DebuggerController.activeThread.addOneTimeListener("framesadded", function() { > + // XXX: Let the variables view do its thing and setup before we begin testing. I don't entirely understand this. Do what thing? Although I'm not happy about it, I'm not against a thread dispatch since all other test do this, so ok! But this comment makes me think you might want to listen to Debugger:FetchedVariables instead, otherwise intermittents may occur. (see other tests). @@ +65,5 @@ > + }, > + extensible: hasNoneTester, > + string: hasNoneTester, > + arguments: hasNoneTester, > + this: hasNoneTester This brings back FP memories. Thank you. ::: browser/devtools/shared/widgets/VariablesView.jsm @@ +2389,4 @@ > tooltip.setAttribute("orient", "horizontal"); > + > + let labels = ["configurable", "enumerable", "writable", "native-getter", > + "frozen", "sealed", "non-extensible"]; We.. should really localize these at some point. Care to file a followup bug? @@ +2389,5 @@ > tooltip.setAttribute("orient", "horizontal"); > + > + let labels = ["configurable", "enumerable", "writable", "native-getter", > + "frozen", "sealed", "non-extensible"]; > + labels.forEach(label => { When did for..of become too mainstream? @@ +2423,5 @@ > > if (this.ownerView.eval) { > this._target.setAttribute("editable", ""); > } > + if (!descriptor.null) { descriptor.null is a hack that makes me really sad. I'll file a bug to change it to something better. @@ +2433,5 @@ > + } > + if (!descriptor.writable && !this.ownerView.getter && !this.ownerView.setter) { > + this._target.setAttribute("non-writable", ""); > + } > + if (descriptor.value && typeof descriptor.value === "object") { Nit: I'd use == since really, typeof always returns strings, but I'm not holding a gun. ::: browser/themes/linux/devtools/widgets.css @@ +531,5 @@ > text-shadow: 0 0 8px #fcc; > } > > +.variable-or-property[non-extensible]:not([non-writable]) > .title:after { > + content: "N"; I'm not sure how I feel about this. These should probably be localized, but since tooltips aren't localized either, the followup bug I mentioned earlier would be ok.
Attachment #750728 -
Flags: review?(vporof) → review+
Reporter | ||
Comment 8•11 years ago
|
||
(In reply to Victor Porof [:vp] from comment #7) > ::: browser/devtools/shared/widgets/VariablesView.jsm > @@ +2389,4 @@ > > tooltip.setAttribute("orient", "horizontal"); > > + > > + let labels = ["configurable", "enumerable", "writable", "native-getter", > > + "frozen", "sealed", "non-extensible"]; > > We.. should really localize these at some point. Care to file a followup bug? Why do we need to localize values specified in the JavaScript language? I don't believe anyone thinks in their native language when reading code. But maybe we should change non-extensible to extensible. It's the only negative term and the strikeout effect would amount to a double negative.
Comment 9•11 years ago
|
||
> Why do we need to localize values specified in the JavaScript language? I > don't believe anyone thinks in their native language when reading code. > Good point. If you think it's ok, then I won't be worried. Although "native-getter" seems to be a special case, switching to "WebIDL" sounds good and universal. > But maybe we should change non-extensible to extensible. It's the only > negative term and the strikeout effect would amount to a double negative. Agreed.
Assignee | ||
Comment 10•11 years ago
|
||
> But maybe we should change non-extensible to extensible. It's the only negative
> term and the strikeout effect would amount to a double negative.
I think this could possibly be more confusing because
a) we don't show the tooltip when an object is extensible (which I can change, but the vast majority of objects are, and I think always showing it would be clutter)
b) it isn't double negative because it isn't strike-through'd
c) The "N" wouldn't stand for non-extensble anymore. I guess we could do an "E" with a strike-through.
Thoughts?
Reporter | ||
Comment 11•11 years ago
|
||
Now that I've actually played with the patch I see what you mean. It looks fine to me.
Assignee | ||
Comment 12•11 years ago
|
||
So can I [land-in-fx-team] this bad boy?
Comment 14•11 years ago
|
||
Or not! No updated patch yet. The only thing I mostly care about is using Debugger:FetchedVariables instead of framesadded, like I said in comment #7. I wouldn't mind the rest of the nits addressed, but they're.. just nits :)
Whiteboard: [land-in-fx-team]
Assignee | ||
Comment 15•11 years ago
|
||
* Using Debugger:FetchedVariables in test * Using for of loop instead of forEach * Using == instead of === in string comparison * Rebased on new devtools directory structure https://tbpl.mozilla.org/?tree=Try&rev=64b1769b7371
Attachment #750728 -
Attachment is obsolete: true
Attachment #755745 -
Flags: review?(vporof)
Comment 16•11 years ago
|
||
Comment on attachment 755745 [details] [diff] [review] V2 Review of attachment 755745 [details] [diff] [review]: ----------------------------------------------------------------- Ship it!
Attachment #755745 -
Flags: review?(vporof) → review+
Updated•11 years ago
|
Whiteboard: [land-in-fx-team]
Reporter | ||
Comment 17•11 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/842928279e36
Whiteboard: [land-in-fx-team] → [fixed-in-fx-team]
Comment 18•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/842928279e36
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 24
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•