Page MenuHomePhabricator

Vector is invalid XHTML (empty UL elements)
Closed, DuplicatePublic

Description

Author: fran

Description:
As currently running on the English Wikipedia, Vector generates invalid XHTML:

http://validator.w3.org/check?uri=http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FMain_Page&charset=%28detect+automatically%29&doctype=Inline&ss=1&group=0&user-agent=W3C_Validator%2F1.767

This is a regression from Monobook:

http://validator.w3.org/check?uri=http%3A%2F%2Fen.wikipedia.org%2Fw%2Findex.php%3Ftitle%3DMain_Page%26useskin%3Dmonobook&charset=%28detect+automatically%29&doctype=Inline&group=0&user-agent=W3C_Validator%2F1.767

It's invalid because the portlets can be generated with empty UL elements - apparently intended, since the ULs are wrapped in DIVs with the class "emptyPortlet". HTML and XHTML mandate (from HTML 2 onward) that there be at least one LI element inside every UL element.


Version: unspecified
Severity: major

Details

Reference
bz23575

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:05 PM
bzimport added a project: MediaWiki-Interface.
bzimport set Reference to bz23575.
bzimport created this task.May 18 2010, 3:52 AM

ayg wrote:

For the record, this is valid HTML5. Presumably the logic is that it makes no less sense than an empty div, makes authoring marginally easier, and is harmless. We still want to output valid XHTML 1.0, so this should prolly be fixed anyway. Plus it's silly. :)

It's actually not silly at all if you're a script trying to add stuff to that <ul>, and we change the skin so it isn't guaranteed to exist any more.

ayg wrote:

Oddly enough, that's exactly one of the reasons irc://irc.freenode.net/whatwg suggested when I asked why it was valid:

[100518 12:33:03] <AryehGregor> . . . Why is an empty <ul></ul> valid in HTML5?
...
[100518 12:40:57] <jgraham> AryehGregor: The idea was you might fill it in with script or so later iirc

We could just leave this alone, then. It breaks XHTML1 validation, but will un-break by default when we switch to HTML5.

  • This bug has been marked as a duplicate of bug 23015 ***