Hi layout people, In bug 1523071[1] I've just uploaded some patches to use more types from the style system all around layout.
These are Rust types automatically generated from the style system code. The reasoning for doing this is outlined in comments 6 and 7. It allows us to: * Avoid conversions at the style system boundary (though we do the conversion at used-value time). * Better preserve precision (both for serialization and internally). This is not an issue for most layout properties, but for some like transform it's a big deal, and it'll allow us to eventually fix some of the rounding issues we have when interpolating transforms with calc() for example. * Generally avoid code duplication (nsStyleCoord / nsStyleSides are pretty similar to some of the data-structures written in Rust). * Make the variants a style system coord can hold clearer. For example, instead of an nsStyleCoord which can hold arbitrary units, now you have a LengthPercentageOrAuto, for example, that as its name indicates, it's either a <length-percentage> or an 'auto' value. I hope this will reduce calc handling bugs like bug 1517521, for example. * Make implementing new stuff (fit-content(<length>) / max() / min() / etc.) not painful. With these changes the idea is that once you make them parse and compute correctly on the style system you're good to go to use it on layout. It has the disadvantage of having to duplicate a bit of code in some cases because I haven't moved everything to that yet, but the padding / marging / inset change already grew larger than what I expected, so I think I would prefer to land that incrementally. Just wanted to ping in case somebody is really concerned about nsStyleCoord's existence being threatened or what not :). Now more seriously, if you have any concern with the change as a whole, or with doing it incrementally or whatever, please comment on the bug! Just wanted to ensure that this change didn't slip by your radar. -- Emilio [1]: https://bugzilla.mozilla.org/show_bug.cgi?id=1523071#c6 _______________________________________________ dev-tech-layout mailing list dev-tech-layout@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-tech-layout