Page MenuHomePhabricator

wiki-text should support presentational tables
Closed, ResolvedPublic

Description

HTML tables should only be used for actual tabular data, not for grid-based layouts. When used for layout purposes, tables make it much harder for screen readers and similar aids to deliver a page's content to the user.

Web designers have been struggeling with this for a long time, since proper grid-less css-based layouts are quite tricky. Trying to get wiki users to do this for banners, infoboxes, etc would be very hard.

Wikitext should offer a simple solution for this. Perhaps some variation of the {|...|} syntax that lets mediawiki know that this table is actually a grid layout rather then tabular data. It can then make a best effort of representing that grid in HTML - using div/CSS, or using HTML tables with special markers (like WAI-ARIA "presentation" role). In any case, wiki users should have a clean and simple way to mark up a grid layout, and distingush it from an actual table of data bits.

Grid layouts need to be nestable, while actual data tables probably shouldn't be. The transition however is not trivial.


Version: 1.17.x
Severity: enhancement

Details

Reference
bz24583

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 11:09 PM
bzimport set Reference to bz24583.
bzimport added a subscriber: Unknown Object (MLST).

This report results from feedback from the German Central Library for the Blind
(DZB). Please see
http://www.mediawiki.org/wiki/Accessibility#Feedback_from_the_DZB.2C_June_2010
for some background.

We discussed this quite extensively on the English Wikipedia in the past (I think as late as last year for Infoboxes). I think the conclusion was: "Yes please, but unfortunately everyone would have to upgrade his browser to latest generation, so realistically, just not possible".

The warning boxes (mbox and friends) is the clearest example. We worked for months on something that was presented reasonably consistently on all browsers, and in the end we simply had to go with tables. We need almost everyone to be on IE8, FF3 and Safari 4.

So I guess we will need to use WAI ARAI roles for this. Such a property would need to be whitelisted in the parser first.

FWIW, in r68230, i implemented a mode for the {|...|} syntax that would output divs with table-* styles instead of a html table. This is just a prove of concept, I don't think it will stay in the core, especially since it doesn't work with older browesers, as pointed out in #2.

created bug 24659 for whitelisting WAI ARIA

I note in the Sanitizer.php that we actually do support role="presentation" (no other roles though).

I think it's safe to close this? includes/Sanitizer.php has whitelisted role="presentation" for all elements since 1.21.

TheDJ claimed this task.

We support role="presentation", which seems sufficient to avoid this problem. Note that is is still preferable to not use tables for purely presentational purposes, but where we already do this, the role attribute can help you out.