Closed Bug 1311189 Opened 8 years ago Closed 8 years ago

No separator between datalist and form history entries with richlistbox implementation

Categories

(Toolkit :: Autocomplete, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla52
Tracking Status
firefox52 --- fixed

People

(Reporter: mconley, Assigned: mconley)

References

Details

(Keywords: regression)

Attachments

(1 file, 1 obsolete file)

Bug 1296638 switched us from using a <xul:tree> to a <xul:richlistbox> to render the list of items in the autocomplete popup.

When a field has autocomplete results including both datalist and form history entries, we generally put the form history entries at the top, then a horizontal separator, and then the datalist entries.

We should probably still do that.
Attached image autocomplete-separator-bug.png (obsolete) —
So there's a slight problem with this patch in that there's a left (and right) transparent border that's interrupting the border-top that I've placed here. See screenshot.

I _think_ the transparent borders are to add a type of margin without messing with how the hover state looks.

Any suggestions on how to proceed here, MattN?
Flags: needinfo?(MattN+bmo)
Turns out that the transparent border is only needed for the AwesomeBar, and margins work fine for our purposes here.
Flags: needinfo?(MattN+bmo)
Attachment #8802610 - Attachment is obsolete: true
Comment on attachment 8802605 [details]
Bug 1311189 - Put back the separator between form history and datalist entries in the autocomplete popup.

https://reviewboard.mozilla.org/r/86964/#review87110

Thanks Mike

::: toolkit/components/satchel/nsFormAutoComplete.js
(Diff revision 2)
> -        if (values.length) {
> -            comments[0] = "separator";
> -        }

I forgot how the separator was previously styled but if it was via CSS I wonder if that rule can be removed now?

::: toolkit/components/satchel/nsFormAutoCompleteResult.jsm:140
(Diff revision 2)
>        return "fromhistory";
>      }
>  
> -    if (!this._comments[index]) {
> -      return null;  // not a category label, so no special styling
> +    if (this._formHistResult.matchCount > 0 &&
> +        index == this._formHistResult.matchCount) {
> +      return "separator";

A more semantic name that doesn't dictate styling may be nicer (e.g. datalistfirst) but I don't feel strongly about this.

::: toolkit/components/satchel/nsFormAutoCompleteResult.jsm:143
(Diff revision 2)
> -    if (index == 0) {
> +    return null;
> -      return "suggestfirst";  // category label on first line of results
> -    }
> -
> -    return "suggesthint";   // category label on any other line of results

I kinda wonder if any add-on relied on these but on the other hand we can't leave cruft around forever so this is fine.
Attachment #8802605 - Flags: review?(MattN+bmo) → review+
Comment on attachment 8802605 [details]
Bug 1311189 - Put back the separator between form history and datalist entries in the autocomplete popup.

https://reviewboard.mozilla.org/r/86964/#review87110

> I forgot how the separator was previously styled but if it was via CSS I wonder if that rule can be removed now?

At least for trees, nope, the separator is another piece of native magic: http://searchfox.org/mozilla-central/rev/3079f45ce59e105e2490b1c8b3a5a52cd47a5ac0/layout/xul/tree/nsTreeBodyFrame.cpp#3185

> A more semantic name that doesn't dictate styling may be nicer (e.g. datalistfirst) but I don't feel strongly about this.

Sure, I like datalist-first. I'll use that.
Pushed by mconley@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2849f953881f
Put back the separator between form history and datalist entries in the autocomplete popup. r=MattN
Pushed by mconley@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e3f252dc20b5
Put back the separator between form history and datalist entries in the autocomplete popup. r=MattN
https://hg.mozilla.org/mozilla-central/rev/e3f252dc20b5
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
Assignee: nobody → mconley
Flags: needinfo?(mconley)
Should we consider this for 51 still?
Flags: needinfo?(mconley)
Ignore that, some confusion over the versions set in the bug metadata.
Flags: needinfo?(mconley)
Version: 49 Branch → Trunk
Blocks: 1328557
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: