Roan Kattouw wrote:
nikerabbit@svn.wikimedia.org schreef:
# Why we don't use Xml::element here?
# Is it because if $source is '', it returns <textarea />?
Yes. <textarea /> violates standards and renders very nastily in Firefox: the rest of the HTML is treated as the textarea's content.
Note that <textarea /> is perfectly good XHTML, but not compatible with HTML -- where the <element/> form is meaningless and taken to mean <element>.
Since we serve as text/html to be compatible with common browsers (*cough IE cough*) we need to ensure that we only use the short <element/> form for elements which are implicitly closed in HTML 4 (eg, <br/> and <hr/> and <img/>). Anything that must be explicitly closed needs to use the long form with separate opening and closing tags.
-- brion vibber (brion @ wikimedia.org)