Html::closeElement: Don't omit closing tags.
authorMatthew Flaschen <mflaschen@wikimedia.org>
Thu, 7 Aug 2014 16:09:06 +0000 (12:09 -0400)
committerMatthew Flaschen <mflaschen@wikimedia.org>
Thu, 7 Aug 2014 16:26:59 +0000 (12:26 -0400)
commitd950da075dcb6c6dd3f68a50a0d427569350763a
tree2759597be6e1b6601ef0613b9546571b4d99782b
parente054e34af8dcda9c454c8cb04caa0d55d0d3c5af
Html::closeElement: Don't omit closing tags.

Although it's allowed by the HTML Living Standard in particular
circumstances, the rules are non-trivial and can not be enforced
by this method since it has no context.

For example, as of http://web.archive.org/web/20140807160955/http://www.whatwg.org/specs/web-apps/current-work/multipage/syntax.html#optional-tags
it says:

"A head element's end tag may be omitted if the head element is not
immediately followed by a space character or a comment."

Html::closeElement has no way of knowing whether there is a space
character or comment after the tag.

There are similar issues with some other tags (e.g. body).  Also,
even when the rule should be followed anyway (e.g. lists can only
contain li elements), there is evidence of browser issues (bug 52210).

Use closing tags for all elements for simplicity.

Bug: 52210
Change-Id: I97ce415288300e40c4d0aa0442bdf4ee3dedb30f
includes/Html.php