This is indeed what people expect but it’s still pretty far from true. There are still a bunch of CSS quirks that are vendor specific. Also if you want to have fun read about the history of the innerText API - it even works different in different versions of IE! And wasn’t adopted by Firefox until about two years ago. These are only a few of the myriad mines you dodge when developing a library for the web at large. Have a look at caniuse.com for a journey down a compatibility rabbit hole. :)
No-one expects Windows programs to work on macOS or Linux. But with the web that's different.