Wednesday, November 27, 2013

Thanksgiving, Technology, and Just Picking a Fight

November 25: Update Your Parents' Browser Day, with photo of little girl and perhaps father at computer.
My logs tell me that nobody took this 2011 plea seriously. I blame the typeface.

Last year on Thanksgiving I made the case for ignoring social media for the day. I felt strongly enough that for the new year I even wrote about some social media behavior goals for the coming year that we could all try to follow.

The year before I cautioned you that you might get wrapped up in helping your parents (or elders in general) with tech support issues (like upgrading browsers, surfing tips to save a turkey that has caught fire, and so on).

Those are both a far cry from the prior two years where I wrote about how nifty social media could be for the holidays. Oh the heady days of 2009, with so much opportunity to come from so much interconnectedness.

In the span of four short years I had mostly decided that social media can make for an awkward and unpleasant holiday if not used properly (or, in some cases, if used at all).

Let's Try Something Different

Maybe we should try to have ourselves a completely disconnected, proper face-to-face meal. I know this is difficult, but this time around I'm supplying talking points!

Politics!

The President of the United States of America has decided we should talk about Obamacare. He says that, chances are, folks at the dinner table probably look to you, mostly as a voice of reason, on the subject. And so his team has put together a brand new site just for the holidays: It's time to have the talk.

I should note, this site was most likely not done by the same folks who built HealthCare.gov. I do, however, think they were vying for a front-page spot over at TC;DR (Tab Closed; Didn't Read):

Screen shot of holiday discussion cheat sheet at barackobama.com.
And let's not even get started on the print styles.

It's impossible to make jokes about political subjects without people assuming it's a political statement. On balance, I also offer a link for the other side of the table: Healthcare.gov and the Gulf Between Planning and Reality. The advantage here is that each side will actually be talking about different things. How is that not hilarious?

Science!

Maybe you can pose a question to the table without letting on that you know the answer? Haven't you ever wondered how many batteries it might take to cook a turkey? I haven't. But Wired thinks it's a worthy topic: How Many Batteries Would It Take to Cook a Turkey?

I'll spare you the effort of clicking the link. Just do this quick math for a 10-pound bird starting at room temperature:

Solve for black bar.

Language!

If you have any pedants in your family, perhaps you'd like to quiz them on the history of the word turkey. Dictionary.com has a digestible (and according to the comments, mostly accurate) post that covers it: The Mistake that Gave Turkey (the Bird) the Same Name as Turkey (the Nation)

Or Just Suck It Up and Be Tech Support

If all goes wrong or you just can't get people to bite on any debate, then you can always fall back to the safety net of tech support. Heck, you might even end up like this guy: In Which I Fix My Girlfriend’s Grandparents’ WiFi and Am Hailed as a Conquering Hero.

Now go relax. Read The Oatmeal's comic on Thanksgiving as a Kid vs. as an Adult. Prepare for where you'll sit using College Humor's Thanksgiving Seating Chart (which ties in nicely with The 8 Relatives You'll Talk to at Thanksgiving). Take this Map of Thanksgiving Dinner to plan your assault on Crudités Dam. Maybe you can debate the merits of the turkey that, like an &lquo;elected” prom king or queen, will be the National Thanksgiving Turkey as designated by the White House:

While they are both pardoned, they'll still die an early death.

In short, disregard your family and stare at your computer/phone all day, just like the moody teen we all truly are.

Sunday, November 24, 2013

Image alt Exception Change Re-Re-Re-Requested

HTML5 logo — I am the 'alt,' not the 'title' This post is an unexpected follow-up to my post Image alt Exception Change Re-Re-Requested (note one fewer “re-”) from June 2012. Back then, some had called into question the need for alt attributes to be required and ubiquitous on all img tags.

Well, guess what — alt is back under review.

The Web Content Accessibility Guidelines (WCAG) working group is reviewing (and soliciting feedback on) changes to determine how a page may fail WCAG Guideline 1.1 Text Alternatives, which outlines how a page uses the alt attribute for images. This also means changing the techniques authors may use to pass Level A validation for WCAG SC 1.1.1.

To simplify, the discussion is centered on allowing authors to omit alt if the author uses aria-label, aria-labelledby, or title attributes. For example, the following three examples would all be valid:

<img src="fox.png" title="Photo of a fox reading aloud from a book.">
<img src="fox.png" aria-label="Photo of a fox reading aloud from a book.">
<img src="fox.png" aria-labelledby="FoxPic">
     <p id="FoxPic">Photo of a fox reading aloud from a book.</p>

David MacDonald has already captured the arguments for and against that are already being bandied about, which I reproduce here:

Arguments for the Change

  • These alternatives on the img element work in assistive technology;
  • The ARIA spec says these attributes should get an accessible name in the API;
  • They say it's easy to teach beginner programmers to just always use an aria-label on everything, rather than requiring a label on form fields and alt on images;
  • They feel that F65 is overly strong since it can fail the entire page for a single missing alt (regardless of the validity of the rest of the page), and they would like to soften it to allow those other valid elements to carry the page;
  • HTML5 allows a figure/legend combination instead of alt, so they feel WCAG will have to change F65 regardless in order to allow a figure with a legend, and that helps open the door to this discussion.

Arguments against the Change

  • aria-label, aria-labelledby, and title, are not really suitable attributes for img alternative text because they imply a label or title, rather than alternate text, so they are not semantic equivalents;
  • title is not well supported;
  • Some feel that the ARIA spec is not in any way suggesting these as replacements to alt;
  • ARIA instructs authors to use native HTML where possible, and they could not come up with viable use cases for omitting alt text;
  • There are hundreds of millions of dollars invested in current evaluation tools and methodologies, and this would represent a major departure from one of the most basic accessibility conventions, one that is almost as old as the web and is the “rock star” of accessibility;
  • It could cost a lot of money to change guidance to developers and muddy the waters on a very efficient current evaluation mechanism;
  • When the figure/legend combination is supported by assistive technology we can amend F65, but that is a different issue and the semantics of this construct are OK for text alternatives, rather than the aria-label, aria-labelledby, and title options;
  • It may cause some confidence problems to WCAG legislation because it represents a strong loosening to a fundamental Success Criteria, an unnecessary change that doesn't help the cause of accessibility, but just complicates things;
  • alt is better supported;
  • The alt text appears when images are turned off;
  • Initial twitter feedback from the community is strongly against changing this failure.

Where You Come In

You don't have to be a part of any standards body to weigh in with your opinion. You can leave comments here and I will happily carry them back to those discussing this (even if I don't agree). You can also let me know on Twitter or you can let Steve Faulkner know, as he is one of the HTML editors.

My Opinion

It is my understanding that ARIA was intended to cover the gaps where HTML didn't already have elements or features to enable accessibility. Moving to supplant an accessibility feature that is widely understood and broadly supported with one that most web developers don't understand seems like a step backward, especially when that specification should fall away in time.

There is also the case to be made for the current status of WYSIWYG editors and code generating features of CMSes. It's taken more than a decade, but for the most part they have support for alt. It seems unlikely that these tools will implement logic to exclude alt when there are valid aria- or title attributes, so they will probably still include alt regardless.

Revisiting HTML elements and attributes is warranted and should be part of the process. We've removed oddities such as hgroup and re-instated valuable bits like time. However, I am not sure why alt seems to get an annual review when it has clear history and use cases.

My very quick responses to the arguments outlined above:

Alternatives to img work in assitive technology

I am not an AT user, so I cannot address this other than to say that it is my understanding that the alternatives work inconsistently across AT whereas alt has a far more consistent experience.

ARIA says these attributes should get an accessible name

That may very well be the case, but should itself doesn't require it.

Easier to teach aria-label on everything, rather than requiring a label on form fields and alt on images

I think there is a false dichotomy here. In modern development shops, the team making forms isn't necessarily the one placing images. Labels have a clear functional association that mirrors desktop software experiences. Alternative text for an image is not a label, though sometimes it may be considered such. This also implies the label element itself may be replaced with aria-label, which isn't the point of ARIA.

Missing alt can fail an entire page

As far as I am concerned, if your entire page fails accessibility validation because of a missing alt, then that is a valid failure. It stands to reason that some items should fail regardless of how perfect the rest of the code may be. Softening the failing power of alt can be a separate discussion, but allowing it to be bypassed seems like a blanket solution. I can't imagine an entire new building is considered accessible even though there is no ramp to bypass the front steps.

Since HTML5 allows a figure/legend combination to bypass alt

This goes back to my original resistance to allowing any exceptions for alt. I worried that any exceptions would be used as a wedge to ultimately tearing down alt. As such, I don't consider this a valid argument. If anything, it should be used as an argument to re-examine the value of making exceptions for alt and perhaps rolling them back (counter-suit!).

Related (on this blog)

Update: November 27, 2013

It is possible for W3C non-members to post their opinions/thoughts to the Accessibility Task Force list (one of the lists where this being discussed). Source:

All the info you need to respond (reproduced here):

Update: March 11, 2014

Today the W3C posted to its blog WCAG Techniques for image text alternatives, which reviews some of what's above. To distill it down:

The result of these two changes is that the Working Group is recognising that authors need and want to use ARIA attributes. Given the evolving level of accessibility support the group then decided to:

  • Allow the responsible use of ARIA attributes for images when accessibility supported (by no longer failing images using aria attributes even if they do not use alt also).
  • Stop short of fully recommending only the use of ARIA attributes on images (by not including a sufficient technique that would encourage this practice).

Update: April 8, 2014

The SSB Bart Group asks the question, Is the Alt Attribute Dead?, and ultimately suggests that no, it is not. As developers, we should keep on using it as it's a simple aid that we don't need to complicate with the latest changes. However, SSB Bart does remind us of the following order in which the HTML Accessibility API exposes alternative content:

  1. Use aria-labelledby
  2. Otherwise use aria-label
  3. Otherwise use alt attribute
  4. Otherwise use title attribute
  5. If none of the above yield a usable text string there is no accessible name

Update: April 15, 2014

Steve Faulkner outlines the divergent requirements between WCAG 2.0 and HTML 5 in the post Short note on alt in HTML.

Friday, November 22, 2013

Print Styles Are Media Queries

I have alluded to this point in the past. Usually when I get off on a rant about print styles, I lump it into the overall process of making responsive sites and I use media query formatting in my examples. But I haven't just flat-out said that print styles are media queries.

I believe I always assumed that the reader would just understand that in the context of my writing, in using print styles on sites, and understanding that print is a medium in which web pages have been displayed for years.

Peter-Paul Koch (@ppk on Twitter) has spent years tracking browser support for even some of the most minute features. From way back in the evolt.org days I've watched him dive into testing without concern for his own wellbeing (browsers have sharp edges). Most recently he put out calls on the Twitters for web developers to fill out a survey about how they use media queries.

I did not grab a screen shot of the survey, but he asked the following two questions (which you can glean from the raw results):

  1. Which media queries have you used AT ALL in practical projects in the past year?
  2. Which media queries have you used in MORE THAN HALF of your practical projects in the past year?

He presented the following options:

  1. width
  2. height
  3. device-width
  4. device-height
  5. device-pixel-ratio
  6. resolution
  7. orientation
  8. aspect-ratio
  9. device-aspect-ratio
  10. Other

You'll note that “print” is not an option. Despite that, 1% of his respondents to the questions (of the 33 and 23, respectively, that chose “other”) wrote in “print,” because that's what this chart indicates in his write-up (Media query/RWD/viewport survey results):

Media query use
Media query Regular use Occasional use
width 84% 7%
device-width 32% 15%
device-pixel-ratio 25% 18%
height 17% 16%
orientation 13% 20%
resolution 9% 5%
device-height 7% 7%
aspect-ratio 3% 4%
device-aspect-ratio 3% 3%
print 1% 1%

I want to be clear, I am not faulting PPK. His survey was very much about the work he's been doing lately understanding how viewports, pixel densities, and screen sizes are reported across the current landscape (jungle) of devices. Instead, I am happy that 1% of his 1,251 respondents consider print to be a media query and took the time to make it a write-in answer.

Now I just wonder how long before the other 99% would do the same. Or even for the much smaller percentage who write media query tutorials, examples, libraries, CMSes, and so on.

Related

If you want to learn how print media queries can be useful to you, please follow the links below (which themselves contain many more links). “The more you know.”

Update: January 13, 2014

It's nice to see others agree: The printer is a device too!

Wednesday, November 13, 2013

Captions in Everyday Use

Yesterday Henny Swan asked a simple question on the Twitters:

Adam Banks put together a Storify of the responses that show there are plenty of use cases for those not hard of hearing to get value from closed captioning.

In general, any context where either the audio track is loud enough that the viewer doesn't want to disrupt those nearby, or the background noise is too much to hear the audio track clearly, is a case where captions have value for all users. Other cases that popped up include multi-tasking or working with a new language or just tough accents.

In short, closed captions have value for all users.

There is also no reason to panic about providing them, particularly if you use a video service that can do them for you. For example, back in 2010 YouTube committed to enabling auto-captioning for everyone, and Google has documents to help plus tutorials from others, such as this step-by-step or or this video.

Image of the captions in use on President Obama's speech about the Chile earthquake.

Of course, as I was writing this post, Henny posted her own reference to the Twitter conversation: The weird and wonderful reasons why people use subtitles / captions

The Storify of responses I mentioned above is embedded here to spare you all the hassle of clicking the link and to bloat my page with unnecessary script blocks:

Update: November 14, 2013

While I was writing this, Dave Rupert was putting together a very neat experiment, Caption Everything: Using HTML5 to create a real-time closed captioning system.

It's a neat proof-of-concept to show how real-time closed captioning is a possibility with current technology, albeit imprecise and cumbersome. If nothing else, hopefully it can bring more attention to a technique that, as demonstrated above, can benefit all users in everyday situations.

It's such a nifty experiment, I am embedding it here (remember, this isn't mine, this is Dave Rupert's code):

See the Pen Closed Captioning with HTML5 by Dave Rupert (@davatron5000) on CodePen

Tuesday, November 12, 2013

WayBack Machine Handler for Your 404 Pages

Image cheerily stolen from the Internet Archive blog post. Last week I mentioned that the Internet Archive WayBack Machine had released a feature to allow custom URLs for on-demand archiving. That wasn't the only coolr feature it announced.

Another nifty feature that the Internet Archive offers is the ability to enhance your 404 pages. You can provide a visitor to a missing page with a link to that page in the WayBack Machine: Free “404: File Not Found” Handler for Webmasters to Improve User Experience

A nice feature of this service is that if there is no page with the current URL (that the user requested) in the WayBack Machine archive, then no link will appear and your 404 page will appear unblemished.

While some businesses might not want to direct people to an archived version of a bio for a long-gone staff member, or perhaps product details that are no longer correct, there is plenty of value for governments, not-for-profits, and other organizations who, ostensibly, shouldn't be removing any information. Organizations whose sites undergo regular upheavals, whether by changing the entire site structure, changing platforms, or generally just not building redirections during normal content restructuring, can offer a better experience to users.

The code is pretty simple (though I recommend against the self-closing div in the Internet Archive example, as some WYSIWYG editors will create the closing tag and wrap it around the script block):

<div id="wb404"></div>
<script src="https://archive.org/web/wb404.js"></script>

Granted, it relies on client-side script, and there is a chance some browser configurations will block it, but the benefit may outweigh those concerns.

To test it, I hopped into our web content management system at Algonquin Studios (QuantumCMS) and dropped that code block into the content area of the generic 404 page. Then I scoured the site for a page that we hadn't updated or redirected during one of our site overhauls and that also existed in the WayBack Machine.

Until I can get around to redirecting that missing page, you can see the effects of the 404 handler from the Internet Archive. If you are reading this after I made that redirection, here's a screen shot of how the link appears on the page:

Screen shot of the 404 page with the WayBack Machine link (the Redeemer animated GIF has nothing to do with the WayBack Machine).

That's it. Simple, straightforward, and potentially very useful to your visitors.

Update: November 13, 2013

Thanks to the story Conservatives erase Internet history, we know that the Internet Archive's WayBack Machine can be pretty easily cleared of historic pages just by updating a site's robots.txt file. While I would expect that the effect should only kick in from the date of the edit of the robots.txt file forward, that doesn't appear to be how it works.

I guess this casual tweet from my one of my partners at Algonquin Studios was more prescient than I thought, though in the opposite direction:

Friday, November 8, 2013

Tables as Responsive Image Containers

If you've been following the latest chaos in the responsive image debate, you may know that there is a battle afoot between supporters of src-n, srcset and picture. If you don't believe me, I refer you to this WHATWG post, a polite round-up of today's bar fight. Key is that it links to multiple discussions in its round up:

[1] http://tabatkins.github.io/specs/respimg/Overview.html
[2] https://groups.google.com/a/chromium.org/d/msg/blink-dev/tV3T1wHuXqE/SvWKxIyG6IIJ
[3] https://lists.webkit.org/pipermail/webkit-dev/2013-October/025763.html
[4] https://lists.webkit.org/pipermail/webkit-dev/2013-November/025809.html
[5] https://bugzilla.mozilla.org/show_bug.cgi?id=870021

Granted, picture has been mostly abandoned by the Responsive Images Community Group (RICG), but after today's fight it looks like it might have legs again.

All of these, however, neglect a responsive image solution that we've had since 2005: tables.

Consider the RICG logo:

RICG logo.

And consider this version encoded as a table, with none of those troublesome pixels:

......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
Look, I even added transparency!

If you look through the Use Cases and Requirements for Standardizing Responsive Images, you'll see this approach satisfies none of the requirements and is made of incredibly complex code. This, in effect, guarantees employment for responsive web developers for years to come. You can make your own tabled images, though you'll want to tweak the code a bit.

I tried to make this clear earlier today:

I can only hope this example sets us all on the right path.

Update: November 14, 2013

If you came here actually looking for something useful about the status of responsive images in general, check out Mat Marquis' responsive images standings cheat-sheet, which he plans to update regularly.

Update: January 2, 2013

Other responsive image options: