Bug 1602669 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.

I think this is a promising direction, yes. A couple of potential suggestions to consider:

  * We could go a step further and derive `nscoord` from `IntCoordTyped<AppUnits>`, where `AppUnits` is a new type similar to `CSSPixel`. This would allow some additional strong typing, such as using `ScaleFactor` to represent the app units to CSS pixel and app units to device pixel scales (and make them harder to mix up).
  * We could introduce a `nsCoordTyped` class that behaves as described the above, and leave `nscoord` alone, and gradually transition usages of `nscoord` to `nsCoordTyped`, thereby avoiding a large transition all at once.
I think this is a promising direction, yes. A couple of potential suggestions to consider:

  * We could go a step further and derive `nscoord` from `IntCoordTyped<AppUnits>`, where `AppUnits` is a new type similar to `CSSPixel`. This would allow some additional strong typing, such as using `ScaleFactor` to represent the app units to CSS pixel and app units to device pixel scales (and make them harder to mix up).
  * We could introduce a `nsCoordTyped` class that behaves as described above, and leave `nscoord` alone, and gradually transition usages of `nscoord` to `nsCoordTyped`, thereby avoiding a large transition all at once.

Back to Bug 1602669 Comment 5