Closed Bug 985206 Opened 10 years ago Closed 10 years ago

Insert ":" after completing a CSS property name in the style editor

Categories

(DevTools :: Style Editor, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 31

People

(Reporter: harth, Assigned: harth)

Details

Attachments

(1 file, 1 obsolete file)

When you press enter or select an autocomplete suggestion for a CSS property name in the Style Editor, a colon and space should be inserted so that you can go right into typing the property value.
This just covers the case of pressing Enter, I didn't attempt to add it in the case where you're using up/down to cycle through suggestions. The patch also fixes a typo: "keyrames" -> "keyframes".
Assignee: nobody → fayearthur
Attachment #8396048 - Flags: review?(scrapmachines)
Comment on attachment 8396048 [details] [diff] [review]
Add a ": " after pressing Enter on a CSS property name

I think the right way here would be to add the ": " in the suggestions' label property, so that it gets applied on TAB/ENTER/UP/DOWN, and also user is aware of the fact that autocompleting to this property will also add ": ".

At a later point (in a follow up) we can be more intelligent about these insertions (including !important;) so that we do not add ";" or ": " again, if already present.
Attachment #8396048 - Flags: review?(scrapmachines)
(In reply to Girish Sharma [:Optimizer] from comment #2)
> Comment on attachment 8396048 [details] [diff] [review]
> Add a ": " after pressing Enter on a CSS property name
> 
> I think the right way here would be to add the ": " in the suggestions'
> label property, so that it gets applied on TAB/ENTER/UP/DOWN, and also user
> is aware of the fact that autocompleting to this property will also add ": ".

I just tried this out, it doesn't look good.
You mean the repeating : in the suggestions list ?

Then at least can you make it work for all possible ways of insertions ? TAB, UP, Down, etc. ?
Yeah, it looked bad when the colon appeared in each item in the popup. I got it so that it will also insert a colon when you press the cycle keys.
Attachment #8396048 - Attachment is obsolete: true
Attachment #8396650 - Flags: review?(scrapmachines)
Attachment #8396650 - Flags: review?(scrapmachines)
Attachment #8396650 - Flags: review?(jwalker)
Attachment #8396650 - Flags: feedback?(scrapmachines)
Comment on attachment 8396650 [details] [diff] [review]
Add ":" after autocompleting a CSS property name

Review of attachment 8396650 [details] [diff] [review]:
-----------------------------------------------------------------

Everything looks good.

Just about browser_styleeditor_autocomplete.js : I like that its more readable now, but honestly, there is too much duplicate and repeating code. I don't have strong feelings against it though.
Also, a try would be nice :)
Attachment #8396650 - Flags: feedback?(scrapmachines) → feedback+
Attachment #8396650 - Flags: review?(jwalker) → review+
Thanks for the feedback! Here's try running: https://tbpl.mozilla.org/?tree=Try&rev=e1bef4d5234d
Try looks good.
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/e472ec4a5280
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 31
QA Whiteboard: [good first verify]
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: