On Wed, Feb 18, 2015 at 1:23 PM, Petr Bena benapetr@gmail.com wrote:
Can someone explain the point of these lines to me?
https://github.com/wikimedia/mediawiki/blob/master/includes/Html.php#L269
Someone thought it would be clever to reduce page size by a few bytes here and there. :)
In practice we always have attributes on the <html> so this would only take effect on <head> for this particular case. However there are other bits which can be more aggressively dropped, such as closing tags for table parts etc.
Here's the commit that added this and related bits: https://github.com/wikimedia/mediawiki/commit/eefe1b13a382a7d11c2137bbf900b7...
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.
I believe that's also covered, yes. (Keep in mind also that the way the HTML content model works is that those elements always exist in the DOM; the tags can simply be omitted from the markup because they are implied by the surrounding content.)
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?
I think we still have the well-formed XML mode enabled for backwards-compatibility?
-- brion