This is hilarious:
A co-worker noticed something strange happening in his Chrome browser:
Every element in an HTML page that has an id attribute gets attached
as a member of the global window object!
I checked and it happens in my Safari as well. A bit of googling led us
to the answer at
StackOverflow:
What is supposed to happen is that ‘named elements’ are added as apparent properties of the
documentobject. This is a really bad idea, as it allows element names to clash with real properties ofdocument.IE made the situation worse by also adding named elements as properties of the
windowobject. This is doubly bad in that now you have to avoid naming your elements after any member of either thedocumentor thewindowobject you (or any other library code in your project) might want to use.
…
Opera copied IE, then WebKit joined in, and now both the previously-unstandardised practice of putting named elements on
documentproperties, and the previously-IE-only practice of putting them onwindoware being standardised by HTML5, whose approach is to document and standardise every terrible practice inflicted on us by browser authors, making them part of the web forever. So Firefox 4 will also support this.
This is such a funny turn of events. And a great metaphor for how these inner decisions are made in browser politics.