Bug 1692885 Comment 5 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

TLDR, this is facing a problem where some places used to set `hidden="false"` and the `false` value would be persisted, but now the `hidden`  attribute would just be removed (and `hidden=""` is persisted). This is problematic for treecols with `hidden="true"` by default, where un-hiding treecols would not be persisted after the underlying change (current state would restore `hidden=""` instead of `hidden="false"` which would both be considered as hidden in HTML land).

All usages of persistence with hidden are on <treecols>: https://searchfox.org/mozilla-central/search?q=persist%3D%22.*hidden&path=&case=false&regexp=true

Solutions include:

1. setting another attribute to force-hide and persist that too (kinda ugly imo)
2. switching to collapsed to hide columns (that would really just move the problem to the collapsed attribute though)
3. persisting some internal value like `_moz_attribute_removed_` instead of persisting an empty string? and make the xul store code handle that keyword differently. There's the potential issue of `.setAttribute("hidden", "_moz_attribute_removed_")` fooling this, but I guess that's unlikely...
4. wait for <treecols> to stop being used and stop caring about this issue.

3. seems best, since it gives room for migrating other boolean style attributes as well.
TLDR, this is facing a problem where some places used to set `hidden="false"` and the `false` value would be persisted, but now the `hidden`  attribute would just be removed (and `hidden=""` is persisted). This is problematic for treecols with `hidden="true"` by default, where un-hiding treecols would not be persisted after the underlying change (current state would restore `hidden=""` instead of `hidden="false"` which would both be considered as hidden in HTML land).

All usages of persistence with hidden are on <treecols>: https://searchfox.org/mozilla-central/search?q=persist%3D%22.*hidden&path=&case=false&regexp=true

Solutions include:

1. setting another attribute to force-hide and persist that too (kinda ugly imo)
2. switching to collapsed to hide columns (that would really just move the problem to the collapsed attribute though)
3. persisting some internal value like `_moz_attribute_removed_` instead of persisting an empty string? and make the xul store code handle that keyword differently. There's the potential issue of `.setAttribute("hidden", "_moz_attribute_removed_")` fooling this, but I guess that's unlikely...
4. wait for <treecols> to stop being used and stop caring about this issue.

Solution 3. seems best, since it gives room for migrating other boolean style attributes as well.

Back to Bug 1692885 Comment 5