Closed Bug 833963 Opened 11 years ago Closed 11 years ago

Variables View: better handling for long strings

Categories

(DevTools :: Debugger, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 21

People

(Reporter: msucan, Assigned: vporof)

Details

Attachments

(2 files, 2 obsolete files)

I have added support for expanding long string actors in variables view, with the web console integration for bug 808370. Found that the properties with long strings cannot be easily viewed/edited:

- no horizontal scroll bar,
- LSA grips render as objects, not as strings (token styling),
- string values should have a max-width (preferably in ems - relative to the font size).

This would make the use of long string properties much nicer in the variables view.
Attached patch wip (obsolete) — Splinter Review
WIP patch I worked on, with help from Victor.
Assignee: nobody → vporof
Status: NEW → ASSIGNED
Priority: -- → P2
Attached patch v1 (obsolete) — Splinter Review
Ok, so text inputs can't have ellipses (obvious reasons), and labels only need a crop attribute (they don't care about css overflow).
Attachment #705533 - Attachment is obsolete: true
Attachment #705553 - Flags: review?(mihai.sucan)
Attached patch v2Splinter Review
_setGrip was used in tests. Fixed.
Attachment #705553 - Attachment is obsolete: true
Attachment #705553 - Flags: review?(mihai.sucan)
Attachment #705560 - Flags: review?(mihai.sucan)
Comment on attachment 705560 [details] [diff] [review]
v2

Thanks for the updated patch!

Almost there. Problems I see:

1. the horizontal scrollbar always shows, even if I enlarge the variables view sidebar enough to see the entire token-string (property value). Cropping works, it renders very nicely, however, the scrollbar behaves as if there's no max-width on the value, as if there's no cropping happening.

2. when I click to edit the value, scrollbar always shows as if the input has width:30em. So it doesn't wait for me to type a 30em-long string, it just behaves as if you gave the input width:30em. Again, weird behavior.

I played a bit with the DOM Inspector tool and found that this looks like a bug I encountered last weekend when working on a web site layout using CSS 3 Flexbox (display:flex). I worked around an issue I had with display:flex by using the older flexbox implementation: display: -moz-box. I see xul:boxes use that. After two days of endless issues I reached the conclusion -moz-box is even buggier than display:flex.

One of the problems I had: container boxes had greater dimensions than they should, even if child elements had max-widths, and other constraints. It seems -moz-box ignores the end-result of child elements dimensions (things like overflow:hidden, or max-widths/heights).

With that in mind: I just tried changing .token-string from max-width to width: 30em and now rendering is correct. Horizontal scrollbar is as short as it should be. The caveat? Now any .token-string, no matter how short it is, takes 30ems.

I tried many things in the layout I worked on, in the weekend. I don't know how to workaround this issue, apart from switching to display:flex (which is saner, but beware  of other bugs).

Do you have any ideas?
Attachment #705560 - Flags: review?(mihai.sucan)
Attached patch v2.1Splinter Review
Reverted overflow as discussed on IRC.
Attachment #705818 - Flags: review?(mihai.sucan)
Attachment #705818 - Attachment description: v2 → v2.1
Comment on attachment 705818 [details] [diff] [review]
v2.1

This is fine. Thank you!
Attachment #705818 - Flags: review?(mihai.sucan) → review+
https://hg.mozilla.org/mozilla-central/rev/92644c33b05e
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 21
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: