Closed Bug 786803 Opened 14 years ago Closed 14 years ago

GCLI help command panel is too big

Categories

(DevTools :: General, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 18

People

(Reporter: msucan, Assigned: miker)

References

Details

Attachments

(2 files, 2 obsolete files)

Attached image screenshot —
The GCLI help command output is too tall and too narrow.
Mike - is this fixed by our resize fix?
I have never seen it look like that so I doubt it but it could be.
Mihai - do you know how you got it to look like that?
Joe: I just open Firefox, enable dev toolbar and type "help". I use Ubuntu 12.04, all up-to-date.
I was almost able to reproduce this by making the browser really narrow before typing help. Seems like it happens for Mihai without a narrow browser :o/ We could just set min-width in _resize() using Math.max(x, min_width). It would be good to know the cause - I suspect that _input is not very narrow as we try to match it's size. This could possibly be fixed by the addon install command (bug 771066) where I switched from _input.clientWidth to _input.getBoundingClientRect().width.
Assignee: nobody → mratcliffe
Status: NEW → ASSIGNED
The patch for bug 785134 allows us to reliably reproduce this, at least on Linux.
Attached patch Patch (obsolete) — — Splinter Review
Fairly simple patch ... not yet tested on Windows or OSX.
Attachment #666987 - Flags: review?(jwalker)
Comment on attachment 666987 [details] [diff] [review] Patch Review of attachment 666987 [details] [diff] [review]: ----------------------------------------------------------------- r+ with those fixes. ::: browser/devtools/shared/DeveloperToolbar.jsm @@ +723,5 @@ > } > > + let width = Math.min( > + this._panel.ownerDocument.documentElement.clientWidth, > + this.document.documentElement.scrollWidth + 15 Magic numbers. I know I was bad here, but some people say you should never have magic numbers at all. I can see the downside, but I also get that sometimes the calculations to work out the magic number as just as fragile as the magic number itself. Assuming 15 is hard to calculate, could you at least document what it represents? @@ +731,5 @@ > + this._panel.ownerDocument.documentElement.clientHeight, > + this.document.documentElement.scrollHeight > + ); > + > + this._frame.style.minWidth = width + 2 + "px"; Insert magic number comment here too. Also, nit, could you say: (width + 2) + "px"; Just to make it clear of the order that the addition should be done in.
Attachment #666987 - Flags: review?(jwalker) → review+
Attached patch Reimplemented (obsolete) — — Splinter Review
When making the requested changes I found the panel placement still to be unreliable. This new patch addresses this issue basically by manually positioning and sizing panels.
Attachment #666987 - Attachment is obsolete: true
Attachment #667555 - Flags: review?(jwalker)
Comment on attachment 667555 [details] [diff] [review] Reimplemented Review of attachment 667555 [details] [diff] [review]: ----------------------------------------------------------------- You don't have to fix this unless you strongly agree, or are editing the file for another reason. On the other hand I would be interested to know if you agree that Object.defineProperty is a better solution here. ::: browser/devtools/shared/DeveloperToolbar.jsm @@ +678,5 @@ > + * Determine the scrollbar width in the current document. > + * > + * @private > + */ > +OutputPanel.prototype.__defineGetter__("scrollbarWidth", function() { I think that Object.defineProperty(OutputPanel.prototype, 'scrollbarWidth', { get: function() { ... }, enumerable: true }; Is probably a more trendy way to spell __defineGetter__ these days?
Attachment #667555 - Flags: review?(jwalker) → review+
(In reply to Joe Walker [:jwalker] from comment #10) > Comment on attachment 667555 [details] [diff] [review] > Reimplemented > > Review of attachment 667555 [details] [diff] [review]: > ----------------------------------------------------------------- > > You don't have to fix this unless you strongly agree, or are editing the > file for another reason. > On the other hand I would be interested to know if you agree that > Object.defineProperty is a better solution here. > > ::: browser/devtools/shared/DeveloperToolbar.jsm > @@ +678,5 @@ > > + * Determine the scrollbar width in the current document. > > + * > > + * @private > > + */ > > +OutputPanel.prototype.__defineGetter__("scrollbarWidth", function() { > > I think that > > Object.defineProperty(OutputPanel.prototype, 'scrollbarWidth', { > get: function() { > ... > }, > enumerable: true > }; > > Is probably a more trendy way to spell __defineGetter__ these days? Yes, all of the cool kids are using it. Typing __defineGetter__ is an old habit that I do without thinking. Anyhow, we shouldn't be using deprecated stuff so I have updated it.
Attachment #667555 - Attachment is obsolete: true
Whiteboard: [land-in-fx-team]
Whiteboard: [land-in-fx-team] → [fixed-in-fx-team]
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 18
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: