If things were working well in the web world, browsers would know how to implement a menubar for the user so the HTML code would only have to include the data that makes my menubar different from others.
Or a set of common user interaction dialogs that really work, so you can call them with parameters that include the language of your interaction but none of the layout.
There has been no factoring of user interface over a very long time. A pattern that was well-established in the 80s, and we still haven't caught up with the 1984 Macintosh in standardized UI. Throwing out standards like that, not good for business.
Seems like Mozilla was headed in that direction in the beginning but somehow didn't follow-through? It's all kind of a fog.