The mouse absolute position is not directly related to the viewport size, so you probably don't actually want to compare them.
The mouse absolute position is basically the offset from the top-left of the canvas in CSS co-ordinates. The absolute position of the bottom-right corner depends on the window size, as a bigger canvas means a bigger absolute position. The viewport is how much of the layout content you see. Think of a 2D game: the viewport size stays the same even if you resize the window smaller or larger. It just means the same viewport sized content is displayed bigger or smaller.
You probably want to either compare the mouse absolute position to the canvas CSS size (from PlatformInfo), or compare the mouse position on a 2D layer to the viewport size.