CSS autocomplete: should not suggest "!important" (or at least less often)

RESOLVED DUPLICATE of bug 1260419

Status

()

Firefox
Developer Tools: Inspector
P3
normal
RESOLVED DUPLICATE of bug 1260419
2 years ago
2 years ago

People

(Reporter: jdescottes, Unassigned)

Tracking

48 Branch
Points:
---

Firefox Tracking Flags

(firefox48 affected)

Details

(Whiteboard: [btpp-backlog])

The CSS autocomplete of the Inspector suggests very often to add "!important" as a value. 

STRs:
- open inspector
- go to rule view
- add a background property
- type "red 0 0"

ER: !important should not be suggested or auto inserted
AR: "!important" is auto inserted after every space.

It is fine to suggest "!important" when the user already typed "!", otherwise this is not something the devtools should encourage.

Today "!important" is explicitly added as the first item of the suggestion list because we assume it will be the first in alphabetical order ([1] & [2]).
We also have logic to avoid suggesting important if nothing is typed, but that's not enough. 

Two options:
- move "!important" at the end of the list, but only after the filtering step. (filtering relies on the alphabetical order for now)
- only suggest important if the autocompletion query (startCheckQuery) is not empty (or going a bit further, only if it's "!" ...)

If we go for the first option, this bug can probably be handled by Bug 1238747 which should move suggestions starting with [a-z] before all others.

[1]https://hg.mozilla.org/integration/fx-team/file/30010c0e58af/devtools/client/shared/inplace-editor.js#l1242
[2]https://hg.mozilla.org/integration/fx-team/file/30010c0e58af/devtools/client/shared/inplace-editor.js#l1268
Priority: -- → P3
See Also: → bug 1238747
Whiteboard: [btpp-backlog]
Will handle this in 1260419, otherwise too much test impact for no reason.
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1260419
You need to log in before you can comment on or make changes to this bug.