On Sun, Nov 7, 2010 at 2:34 PM, Dmitriy Sintsov questpc@rambler.ru wrote:
I would like to thank Roan Kattouw for helping me to adapt my Extension:WikiSync to use ResourceLoader. Before asking, I've spend some hours trying to get it to work, unsuccessfully. One of key errors was not so easy to guess: it turned out that browsers violate "self-closing" xml tags sometimes (a tag without nested text node - with slash inside), and it was such case with iframe.
This is why the /> syntax in text/html is stupid and harmful -- it's just ignored by all browsers, but people assume it works. <foo> and <foo /> parse exactly the same way in text/html and always have, the / is ignored entirely. Elements that can never contain anything (like <img>) don't need a closing tag or closing slash or anything, and other elements (including <iframe>) must be explicitly closed with a separate closing tag.
Of course, since HTML5 parsers are still much harder to dig up than XML parsers, we still should probably continue outputting well-formed XML, which means including these trailing slashes that are pointless for browsers. Just a random little rant here. :)