Live data from Hacker News

Things Developers Should Do For Web Accessibility

laneshill.me

11–20 of 23 posts

Re: Things Developers Should Do For Web Accessibility

#11
post #6
post #4

Earlier quoted context omitted.

please. build for people, not validators. it's good to check for mistakes, but validators are far from a stamp of approval for anything. know what you're doing instead of seeking 'validated' crap.

People generally don't read HTML... machines do; the further levels of validation you can obtain (and certainly to the extent to which the code is somewhat valid at all, such as making certain to have tags that aren't misusing quotation marks or brackets or entities), the more likely your code is to be understood in the same way by random implementations of HTML parsing that may be used in the field.

yeah, I remember injecting flash objects with javascript wrapped in cdata, so the w3c validator confirms my awesome coding skills in green, good times. now I treat validators as useful tools for double-checking syntax, and nothing else. it validates more often than not anyway, but it's not that I care.

invalid code doesn't mean shitty code, and the other way around - being valid doesn't say anything about the practical quality of code. know your craft = know the rules + know when you can break them.

Re: Things Developers Should Do For Web Accessibility

#12
Number 1 (and throughout the article) isn't right, the input should go inside the label.

See https://developer.mozilla.org/en-US/docs/HTML/Element/input Permitted content: None, this is a void element.

And https://developer.mozilla.org/en-US/docs/HTML/Element/label for an example of doing it correctly

Re: Things Developers Should Do For Web Accessibility

#13
post #12

Number 1 (and throughout the article) isn't right, the input should go inside the label. See https://developer.mozilla.org/en-US/docs/HTML/Element/input Permitted content: None, this is a void element. And https://developer.mozilla.org/en-US/docs/HTML/Element/label for an example of doing it correctly

It's completely legitimate to have an input tag outside of a label. Even the link you provided states:

The HTML Element represents a caption for an item in a user interface. It can be associated with a control either by using the for attribute, or by placing the control element inside the label element.

As long as you use the for attribute, it's fine.

Re: Things Developers Should Do For Web Accessibility

#14
post #4

0) Make sure all of your HTML is valid.

please. build for people, not validators. it's good to check for mistakes, but validators are far from a stamp of approval for anything. know what you're doing instead of seeking 'validated' crap.

Valid HTML makes pages render better which helps out screen readers in certain cases. I've seen this in action too.

Re: Things Developers Should Do For Web Accessibility

#15
post #10

Earlier quoted context omitted.

Well, yes (build for people) and no (stuff should be technically correct, as well ). For instance, the WGAC 2.0 guidelines require that HTML be valid, and if a client wants WGAC 2.0 compliance (even A level, not AA), the site's gotta validate [1]. [1] http://www.w3.org/TR/UNDERSTANDING-WCAG20/ensure-compat-pars...

unless you are doing it for bureaucracy's sake (public sector, etc.), do what works, not what some ink on paper from half a decade ago says, otherwise it's CYAE[1]. http://www.alistapart.com/articles/tohellwithwcag2 "To Hell with WCAG 2" (2006) [1] cover your ass engineering

> do what works

Too many people build something that works for them; on their browser version, at their screen size, on their OS.

That's especially harmful for accessible sites.

Re: Things Developers Should Do For Web Accessibility

#16
post #13
post #12

Number 1 (and throughout the article) isn't right, the input should go inside the label. See https://developer.mozilla.org/en-US/docs/HTML/Element/input Permitted content: None, this is a void element. And https://developer.mozilla.org/en-US/docs/HTML/Element/label for an example of doing it correctly

It's completely legitimate to have an input tag outside of a label. Even the link you provided states: The HTML Element represents a caption for an item in a user interface. It can be associated with a control either by using the for attribute, or by placing the control element inside the label element. As long as you use the for attribute, it's fine.

Yes, quite right. I probably wasn't clear enough there, but I was referring to this from the article:

  Social Security Number
Should be marked up as

  Social Security Number
if you want to omit the 'for' attribute.

Doing it the wrong way around will still render as you expect, but defeats the purpose as you won't get the click-to-activate behaviour.

Re: Things Developers Should Do For Web Accessibility

#17
post #16
post #13

Earlier quoted context omitted.

It's completely legitimate to have an input tag outside of a label. Even the link you provided states: The HTML Element represents a caption for an item in a user interface. It can be associated with a control either by using the for attribute, or by placing the control element inside the label element. As long as you use the for attribute, it's fine.

Yes, quite right. I probably wasn't clear enough there, but I was referring to this from the article: Social Security Number Should be marked up as Social Security Number if you want to omit the 'for' attribute. Doing it the wrong way around will still render as you expect, but defeats the purpose as you won't get the click-to-activate behaviour.

Ah yes, that's horribly, horribly wrong. :)

Re: Things Developers Should Do For Web Accessibility

#18
"Use alt tags where appropriate"

When you don't have need of an alt attribute, add one but keep it empty. In the absence of an alt attribute some screen readers will read out the path of the image instead. Setting it to empty allows you to remove this, almost always, unnecessary noise.

Re: Things Developers Should Do For Web Accessibility

#19
post #7
post #2

Number 2 is simply misleading. It doesn't take in consideration HTML 5 Document Outline speification. It's not enough anymore to simply use h1-6 accordingly. You must take the whole document landing marks sructure in account (`article`, `section` etcetera.) Number 8 is not completely correct anymore. Javascript was recently included in the accessible tecnologies. Screen readers nowadays do own a DOM and a full render…

Not really misleading: most screen readers aren't yet using the HTML5 Document Outline algorithm, so for accessibility you still have to rely on proper h1-6. Ideally, you'd use them in combination for future proofing. It takes a little work, but you can arrive at the same general outline from both algorithms, since the new one ignores the ordinality of the h tag.

Screen readers will use whatever document outline that the browser renders, no?

Re: Things Developers Should Do For Web Accessibility

#20
The mention of Fangs alone made this article valuable to me. Accessibility has had lots of lip service for years but it is essentially impossible to do any legitimate work optimizing for screen readers if you don't have access to them (being prohibitively expensive.) It's like writing for a browser you never get to test in. If anyone was serious about accessibility they should get simply get screen readers in the hands of the people building web sites.
Post reply on HN