Landmark map
The canvas draws a small page in grey and tints each landmark region: the parts a screen reader lists so that its user can jump between them. Each label is the role and the name. A dashed outline marks an element that looks like a landmark and isn't one. Tap a region to read about it. "Add three faults" changes the small page, and the map outlines the faults in red.
Show the code roles from a rule table, positions from a measuring draw, tints over a grey picture
- The markup. A small page as one drawable child. The map adds nothing to it.
- Which elements are landmarks. The role and the name of each.
- What's wrong with them.
- One frame. Measure, draw the page in grey, draw the map with the same transform.
- The measuring draw. Shared with the layout debugger.
- Drawing the map.
- When to draw again. A change to
aria-labelraises no paint event.
How it works
- The roles come from a rule table in the page's script.
main,nav,search,asideandformhave a landmark role.headerandfooterhave one only when they aren't inside an article, aside, main, nav or section.sectionhas one only when it has a name. Aroleattribute with a landmark role wins. - The small page's own
<header>and<footer>get dashed outlines. The canvas is inside this site's<main>, so they aren't a banner and a contentinfo for the browser. "Treat the drawn page as a whole document" stops the rules at the drawn element, and the two become landmarks. - The name is the text of the elements in
aria-labelledby, oraria-label, ortitle. - The small page is drawn once with
globalAlpha = 0at 0, 0 to read where each element is, then drawn scaled to fit the canvas withctx.filter = 'grayscale(1)'. The tints are drawn after it under the same transform. - Four faults are checked: more than one main, banner or contentinfo landmark (or no main), two landmarks with the same role that have the same name or no name, a form with no name, and text that is in no landmark.
- A tap is a
clickon the element under the finger. The page walks up from it to the nearest landmark.
Live checks
Each check builds a small canvas of its own in a corner of the window. The picture above isn't touched.
| Result | Experiment | Detail |
|---|
Findings
From Chromium 157, headless, on 2026-11-21. The rows above say what your browser does.
- Works: the rule table matches the browser. A script read Chromium's accessibility tree for this page through the DevTools protocol and compared the role and name of every element of the small page with the table, with and without the faults. They agreed. The script is
tools/devtools-pages/verify.mjs. - Found by that comparison: ancestors outside the canvas count. The first version of the table stopped at the drawn element and called the small page's header a banner. The browser calls it a section header, because the canvas is inside a
<main>. A page drawn inside another page has no banner and no contentinfo of its own. - Found by that comparison: a form with no name has the role
formin Chromium. The HTML accessibility mapping says it should have no landmark role. The map follows the browser and reports the missing name as a fault. - Limit: the page can't ask the browser.
element.computedRoleandcomputedNamedon't exist in Chromium 157 without a flag, so a page has to carry its own rules. A live check uses them when they exist. - Found: a change to a name raises no paint event. Setting
aria-labeldoesn't change the picture, so the canvas isn't told. The page watches attributes with aMutationObserver. - Works:
ctx.filteron the drawn page. The page is drawn in grey without changing its CSS, and controls in it still take taps and typing. - Seen in the map: the header and footer of the article, and the section with no name, aren't landmarks. The search form is a search landmark because of
role="search". With the faults on it is a form with no name. - Not covered: names from
<label>or content,aria-owns, shadow trees and landmarks inside frames. - Not verified here: a screen reader. TalkBack's landmark navigation on the phone should list the same six regions with the same names for the canvas content. That wasn't run.