(In reply to Ting-Yu Lin [:TYLin] (UTC-7) from comment #0)
- We should add document to
NS_UNCONSTRAINEDSIZE to warn people not to rely on its value, and point to
nscoord_MAX if a giant number is needed.
Documenting it and advising people to not depend on its numeric value is good,
however I don't think we should use
nscoord_MAX directly in layout (in general).
If a new symbolic value is needed for some purpose then it's better to add it
to this header with documentation on what it represents symbolically.
- We should just replace
nscoord_MAX because it doens't have many usage per https://searchfox.org/mozilla-central/search?q=symbol:M_1833fe56%2CM_a4599bec68c82a18&redirect=false
I don't think replacing it with
nscoord_MAX is an improvement, since neither
convey any semantics or intention. We should probably replace
with some of the other symbolic values instead, or introduce new ones that
represent the specific use cases, if needed. (Like
- Do we really need
NS_AUTOOFFSET? Since they're all equal to
NS_UNCONSTRAINEDSIZE, can we just remove them? Without proper documentation, it's difficult (at least to me) to choose when to use which constant. Mnemonics are good unless we have a proper way to enforce them, but they are all
NS_INTRINSICSIZE can probably be replaced by
NS_UNCONSTRAINEDSIZE, since they have (roughly) the same meaning.
NS_AUTOOFFSET is a specific use case though, that we might want to
keep as a distinct constant.