(In reply to Matthew N. [:MattN] (PM me if requests are blocking you) from comment #8)
(In reply to alexander :surkov (:asurkov) from comment #7)
ah, no, it shouldn't be I think, because we want to reuse an item if
- its style wasn't changed (for example, "autofill-profile" is changed to "autofill-profile") OR
- its old and new styles are both interchangeable, for example, style "bla-bla" is changed to style "foo-foo" (they both share same CE and thus we can reuse them)
From reading the comment at line 1040 I thought that we want an AND since it seemed to imply that once
_adjustAcItem is used on an item, it shouldn't be re-used. IIRC the issue is that the different autofill item types have different heights and that's what UNREUSEABLE_STYLES is for… I thought it was so that even if items have the same
style that they still don't get re-used e.g. an autofill-profile is rendered at one height on a narrow field and another on a wide field, see https://luke-chang.github.io/autofill-demo/layout.html
not sure, I know little about this code. There's also 2nd comment there though "// Reuse the item when its style is exactly equal to the previous style or neither of their style are in the UNREUSEABLE_STYLES." which also says "or". I assumed the point was to reuse autocomplete-richlistitem CE binding for everything that isn't listed in UNREUSEABLE_STYLES.
Also, the problem we're seeing in this bug is that the constructor doesn't run when a row is re-used. To me that means we should never re-use if the style isn't the same and therefore an AND makes sense.
I think we only need to change to an
&& and not modify UNREUSEABLE_STYLES.
It feels like a separate issue with me, and I'm not 100% sure this is a correct change, but if you are certain we should do that here, then I can adjust my patch.