Can someone explain the point of these lines to me?
https://github.com/wikimedia/mediawiki/blob/master/includes/Html.php#L269
If these tags are optional, they can be there, so why remove them? If you remove them, you should probably also care about them in closeElement() so that mediawiki doesn't produce html which has only ending tags for html and head.
It seems that on WMF installation we don't use anyway as there is head tag. So why is it there? What purpose does it server?