Let's make these comments more interesting
I conjecture that this idea of an accurate ruler on a web page is impossible with the current state of web and device pixel ratios that can't be detected from javascript for all devices.
Prove me wrong. I'd love to see it.