W3C home > Mailing lists > Public > public-html-a11y@w3.org > December 2012

Re: change proposal for <main>: possible validation warning heuristic for misuse

From: Steve Faulkner <faulkner.steve@gmail.com>
Date: Tue, 4 Dec 2012 23:33:36 +0000
Message-ID: <CA+ri+VkEPCoFZ5k4LM_wf0QF9dODyk7CtOJ_uUen0nW-Mv0j6w@mail.gmail.com>
To: Maciej Stachowiak <mjs@apple.com>
Cc: James Craig <jcraig@apple.com>, HTML Accessibility Task Force <public-html-a11y@w3.org>, Michael Smith <mike@w3.org>, Henri Sivonen <hsivonen@iki.fi>
On 1 December 2012 22:19, Maciej Stachowiak <mjs@apple.com> wrote:
> This would end up documenting the semi-mythical "Scooby Doo algorithm" for
> cases when the <main> element is absent.

>From what I understand, the Scooby Doo algorithm concept was derived from
section '4.13.1 The main part of the content' of the spec. It was named and
further elucidated by bruce lawson [2] . Mike Taylor produced a script
based on the concept [3]

today I created a bookmarklet from the script (adds a dashed border and
yellow background to what it identifies as the main content)

Scooby Doo<javascript:(function(){var%20kids=[].slice.apply(document.body.children);for(var%20i=0,l=kids.length;i<l;i++){switch(kids[i].tagName.toLowerCase()){case"header":case"nav":case"aside":case"footer":break;default:kids[i].style.cssText='border:6px%20dashed%20green%20!important;%20background:yellow%20!important;';break;}break;}})()>

and tested it out on a hundred or so of the pages using <!DOCTYPE html> [4]
I found that in approximately 95% of cases the algorithm identified the
main content as either including all of the page content or an element at
the very start of the page. In other words it is of little to no use in
determining either what the main content consists of or where it starts.

I think a much more useful algorithm would take into account id values
commonly used to identify the main content.

[1] http://dev.w3.org/html5/spec/links.html#the-main-part-of-the-content
[2] http://www.brucelawson.co.uk/2012/scooby-doo-content-element/
[3] http://pastie.org/4663081
[4] http://www.html5accessibility.com/tests/HTML5-main-content/

Received on Tuesday, 4 December 2012 23:34:41 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:05:32 UTC