After this patch, there are a lot of build errors since now int32_t and nscoord is not the same type anymore. BaseCoord can convert to int32_t automatically, but not at the follow cases. 1. Calling std::min(0, nscoord) or std::max(0, nscoord). We'll need to explicit create nscoord(0) instead of using 0, or calling std::min<nscoord>() or std::max<nscoord>(). 2. Ternary operator like `condition ? nscoord : 0`. Need a manually fix by `condition ? nscoord : nscoord(0)`. 3. The gecko interface between servo Au. For code like `Size2D::new(Au(area.width), Au(area.height))` [1], should we sprinkle nscoord's `value` member and use it like `area.width.value`? Or can we convert Au to nscoord automatically? I haven't figure this out yet. [1] https://searchfox.org/mozilla-central/rev/2c1092dc68c63f7bad6da6a03c5883a5ab5ff2ca/servo/components/style/gecko/media_features.rs#26
Bug 1602669 Comment 3 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
After this patch, there are a lot of build errors since now int32_t and nscoord is not the same type anymore. `BaseCoord` can convert to `int32_t` automatically, but not at the following cases. 1. Calling `std::min(0, nscoord)` or `std::max(0, nscoord)`. We'll need to explicit create `nscoord(0)` instead of using 0, or calling `std::min<nscoord>()` or `std::max<nscoord>()`. 2. Ternary operator like `condition ? nscoord : 0`. Need a manually fix by `condition ? nscoord : nscoord(0)`. 3. The gecko interface of the servo type `Au`. For code like `Size2D::new(Au(area.width), Au(area.height))` [1], should we sprinkle nscoord's `value` member and use it like `area.width.value`? Or can we convert `Au` to `nscoord` automatically? I haven't figured this out yet. [1] https://searchfox.org/mozilla-central/rev/2c1092dc68c63f7bad6da6a03c5883a5ab5ff2ca/servo/components/style/gecko/media_features.rs#26