Skip to content

Instantly share code, notes, and snippets.

View bkardell's full-sized avatar

Brian Kardell bkardell

View GitHub Profile

I think that for the most part I like this proposal. I have three 'concerns'.. The first two are mostly about impact and messaging.

The first is just that as steve said earlier it'd be effectively building in a pattern that would create something we historically advise authors to explicitly not to write manually. That could use a solid explanation of why everyone is ok flipping on that (and confirmation that they are) or I think that could go badly.

Second is that as it stands, for those people who spent a lot of time and effort using sectioning and made good headings that didn't rely on the phantom 'document outline' that never shipped, the beautiful AT heading relationships, the conceptual 'outline' that they built will get less beautiful. For example, given something like:

  <article>
    <h1>Apple varieties</h1>
    <p>The apple is the pomaceous fruit of the apple tree...</p>
function getClosestSectioningElement (el) {
return el.closest("article,aside,nav,section,blockquote,details,dialog,fieldset,figure,td")
}
function determineLevel(el) {
let level = 1;
// Arguably the parentNode being null check can be removed as it will never be null when this and
// the function below are run on a document, as is the case.
//
// This is "sectioning content" and "sectioning roots"
<!doctype html>
<html lang=en>
<meta charset=utf-8>
<script src=polyfill.js async></script>
<title>Heading levels</title>
<body>
<section>
<h1>One</h1>
<section>
<h1>Two</h1>
@bkardell
bkardell / heading-comments.md
Last active February 28, 2018 18:28
6409149

I think you can sort of roughly define a few different very distinct situations that will occur here.. As I thought through what my opinion on this is I found myself asking "what happens in those cases with this proposal" and "is that good or bad or what?" - I'm noting each below..

  1. Pages that used headings only for visual effect or SEO, or just wildly misunderstood headings and used no sectioning elements

This is really a lot of the web. Basically, nothing changes for them. They useless/confusing for accessibility. It changes precisely nothing for them.

  1. Same as #1, but with the addition of sectioning elements

People seem to like those sectioning elements whether they are thinking about a11y or not. I think there's probably no measurable or predictable significant practical gain or loss here. They were confusing for accessibility before, their particular kind of brokenness simply changes to match the default UA sheet more.

<p>This is a paragraph</p>
<p><span style="display:none">You can print this for your records</span><button>click me</button></p>
/* Why? see http://bkardell.com/blog/Greetings-Professor-Falken.html */
class BasicVoiceSpeaker {
/*
The constructor takes an optional regexp for determining the voice
this at least lets us simplify the process of searching for a decent voice
that sort of matches something we might expect
*/
constructor(config={}) {
@bkardell
bkardell / role-reflect.js
Created April 24, 2017 16:15
basically, reflects the implied roles from ARIA in HTML
var sectioningSelector = 'article,aside,main,nav,section'
var map = {
'A': (el) => {
return el.hasAttribute('href') ? 'link' : undefined
},
'AREA': (el) => {
return el.hasAttribute('href') ? 'link' : undefined
},

Just as in most standards efforts a whole lot of this discussion is about what developers will and won't do given a thing, or will and won't understand. This is speculation. It isn't that speculation is useless, it's just that it is low signal to noise. It's less valuable than saying "here is an actual usable thing I speculate that you will be able to use well. It solves some difficult problems you have today. You may use it if you want and I release the IP so standards can have it in the rare case that it is a "real winner". Don't think about it as 'this will be the new standard' just use it because it is useful. Go out and live your life for a while with it and come back and tell me what that was like or how you might change it and why."

Over the past year and a half I have drawn and painted with regularity, not always well (especially at first), but frequently I ask friends and people I follow on twitter if it's ok if I draw or paint them or ask for voluteers. For a decentish idea of where I am at with this now, you can check out my instagram - or to see friends/voluteers along the way of varying quality that I've tried to art in this time, there's a list below. If you're at interested, let me know and I can add you to my queue. If I did something of you and it's not on here, and you'd like it to be (or if you'd like to be removed), please remind me because I have been terrible at keeping track.

<div>
<common-button id="btn">Statu</common-button>
<common-badge icon="favorite" for="btn" label="favorite icon"></common-badge>
</div>