Uploaded https://gerrit.wikimedia.org/r/191473/ for consistency with closeElement.
Thanks for reporting.

Il 18/02/2015 22:38, Petr Bena ha scritto:
I was digging and I found that commit you sent - eefe1b13a but you can
see that this commit modified 2 functions: both open and closeElement,
however for some reason the code was removed from closeElement so now
calling openElement('html') would produce empty string, while
closeElement('html') would produce </html> and that should IMHO create
HTML code that would only contain closing tags in case that html /
head didn't have any parameters. Actually head, at least on wmf
installation doesn't have any parameters, but it has opening tag,
which is weird. (Perhaps wgWellFormedXml is true by default?)

On Wed, Feb 18, 2015 at 10:31 PM, Brion Vibber <bvib...@wikimedia.org> wrote:
On Wed, Feb 18, 2015 at 1:23 PM, Petr Bena <benap...@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/eefe1b13a382a7d11c2137bbf900b783ee445323


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
_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to