Using WAI-ARIA (accessible rich internet applications) roles, states, and properties, we can improve the accessibility of Drupal 8. This, however, comes with the cost of invalidating pages, since ARIA (which is added through attributes) is not conforming xhtml.

One solution to this problem is to add ARIA using Javascript, this is what often happens anyway, since the components that we are trying to make more accessible (e.g. autocomplete) are added by Javascript. This, however, seems to only push the question of page validity from the source document to the DOM.

I would like to see us have a discussion about this question to determine if the pros of improved accessibility outweigh the cons of invalidating source documents. Perhaps a good compromise solution is to ensure that all ARIA is added through Javascript? Again, I would like to hear thoughts about what actual difference there is between invalidating the source document vs the DOM.

CommentFileSizeAuthor
#27 playdate-roles.png181.95 KBJeff Burnz

Comments

nick_vh’s picture

Could you maybe add some more sources for the people that would like to read about this standard?

Everett Zufelt’s picture

Accessible Rich Internet Applications (WAI-ARIA) 1.0

Abstract
Accessibility of web content requires semantic information about widgets, structures, and behaviors, in order to allow assistive technologies to convey appropriate information to persons with disabilities. This specification provides an ontology of roles, states, and properties that define accessible user interface elements and can be used to improve the accessibility and interoperability of web content and applications. These semantics are designed to allow an author to properly convey user interface behaviors and structural information to assistive technologies in document-level markup. This document is part of the WAI-ARIA suite described in the WAI-ARIA Overview.

jacine’s picture

subscribe :)

mjohnq3’s picture

Will Drupal 8 not be using HTML5?

Everett Zufelt’s picture

@mjohnq3

If Drupal 8 uses the html5 doctype then this question is moot. A decision to move to html5 would resolve this question, as ARIA will validate.

tim.plunkett’s picture

Is there an article that explains why conforming to xhtml is important or relevant? Also, I echo mjohnq3's question. If HTML5 doesn't care about validating as xhtml, why should Drupal?

Everett Zufelt’s picture

@tim.plunkett

Just to clarify, html5 cares about validating as html5. ARIA has been adopted as a compatible technology by html5, so it will validate under html5.

html5 is also backwards compatible, meaning that if you have a valid xhtml 1.0 document and switch the doctype to <!DOCTYPE HTML> it will validate as html5. The only exception to this, as far as I know, is that the img element's @longdesc attribute from xhtml does not validate under html5.

tim.plunkett’s picture

Oh, I crossposted with you Evertett.
Anyway, as the perpetual optimist, I'd say YES! ARIA will be permitted in markup, because Drupal 8 will be fully HTML5... Right? :)

jensimmons’s picture

I think putting ARIA into Drupal 8 should be a BIG goal for making Drupal 8 more accessible. And for having more-better HTML. Most of the front-end development leaders are embracing and evangelizing ARIA (when, by comparison, hardly any of them are talking about RDFa), and using ARIA for targeting CSS instead of so many classes (along with pseudo-selectors in CSS3).

And I also think Drupal 8 should be HTML5. In fact, I plan on personally helping to make that happen, and talked to Dries about it at Drupalcon Copenhagen.

So I do think this question is moot. But if for some reason Drupal 8 remains XHTML, then I think we should use ARIA anyway. Accessibility is way more important than validation.

Validation is just a tool to help us make better markup. If something doesn't validate because the validator doesn't "allow" the newer technique, but the technique is a good one — future-looking, standards-based, done properly — then the validation "errors" should just be ignored. For a few years, most of us webstandards-junkies saw failed validation as a total fail. That was back when we were trying to get people to use standards-based HTML in the first place. Now most webstandards leaders publicly say it's totally fine for a page to not validate. What matters is *why* is doesn't validate. If the validation is failing because the code of the page is more forward-thinking than the standards-spec, then that's awesome! Why in the world should we hold back the advancement of our HTML in order to conform to an older spec. XHTML validation should only be used as a way to evangelize and check for the use of web standards, not as a reason to hold us back from new standards.

ARIA is cool. We should be embracing ARIA. Using javascript to inject ARIA markup into the page as a way to improve validation is just silly, imo. A waste of precious page-loading resources in the name of some technical purity. Let's not be purists. Let's be practical-ists. And let's follow the lead of the people who are defining these standards in the first place.

mgifford’s picture

+1 for HTML5

if we can't get that in then

+1 for xHTML & ARIA

And yes, it's silly to be injecting ARIA with javascript just because the W3C hasn't updated their validator.

A big point against bringing more ARIA into D7 was that it is still draft - http://www.w3.org/TR/wai-aria/

This too will change.

jensimmons’s picture

Let's have the debate about HTML5 over here: #963832: Decide how to use HTML5 in Drupal 8

Jeff Burnz’s picture

As long as we change to HTML5 then yes, if not, then probably not in core.

Everett Zufelt’s picture

@Jeff

Could you please be more clear about your reasons why not?

Jeff Burnz’s picture

@Everett - because its invalid markup for XHTML. No version of Drupal is going to ship and not validate. By and large Drupal follows best practices, sometimes it even defines them - at the moment the best practice is validation, I can't see that baby being thrown out with the bathwater, nor would I support it, not when we have several directions/options available - HTML5 or using JavaScript. In short validation is a systems design principle I would not give away lightly, so my vote would be a resounding no IF we stay with XHTML (which personally I think is a mistake, we should use HTML5 in D8).

I am far less worried about the draft status of both standards (ARIA and HTML5), the Landmark roles look very well defined and I can't see big changes coming and are in popular usage already.

There would be one caveat to this, if ARIA roles were a module or an option you could switch off, this wold allow validation in XHTML, this is kind of what I have done with RDFa in HTML5, my theme will validate if I switch off the RDF module.

Everett Zufelt’s picture

@Jeff

Do you believe that it is important for the source document, but not the DOM to validate? I agree that html5 is the best choice, but if we were to go the JS route for adding aria we would be invalidating the DOM. I don't see any difference from a systems design approach in invalidating the source document vs the DOM.

If we choose to neither invalidate the source or DOM then it would appear that html5 is the only option. I am personally more flexible on validation. Validation is a means to an end, if it is not serving the purpose of producing the most accessible sites we can then we should make an exception for aria to invalidate the source / DOM.

tim.plunkett’s picture

I would like to point out that any CSS that includes vendor prefixes fail validation. They aren't quite a standard, but they are codified, and should be allowed, same as ARIA.

bowersox’s picture

+1 Yes to ARIA in Drupal 8.

Applying ARIA using Javascript seems bad to me. It makes page loading more complex. It makes core harder to test* and troubleshoot. It puts more computation load on the browser. It means that ARIA roles might take a few seconds to be available since they won't be applied until the page finishes loading and the onLoad() javascript event is triggered. It also means that users without Javascript enabled cannot get the benefits of ARIA. It just seems like a work-around that we should get away from as soon as we can.

[edit: *it is harder to test because our simpletest framework cannot simulate browser-side javascript]

Jeff Burnz’s picture

The problem as I see it with validation is how W3C validation failures will be perceived - in short I think it will create a lot of FUD. It also depends quite a bit on how many roles get used - there are a lot, which could create hundreds of validation errors, and sorting out the wheat from the chaff could be problematic when faced with very long error pages. Remember validation is a useful tool and we make that tool harder to use.

At the end of the day I think we're having this conversation the wrong way around and is largely hypothetical - lets just push for HTML5 and render this argument moot.

jensimmons’s picture

From #14:

…at the moment the best practice is validation…

I disagree with this statement. Pretty strongly. It was the best practice a while ago, but since the industry has moved forward, and XHTML has not, ideas of what the best practice is have changed — a lot. << A discussion to have over a drink at DrupalCon Chicago, if we standards geeks want to get into it.

But also, I agree let's not have that discussion. Drupal 8 should be HTML5. Or, er, the modern browsers are going to read Drupal 8 sites as HTML5, no matter what we do. So let's figure out how we want to take advantage of HTML5, and use HTML5 Lint tools to check our D8 markup, and not XHTML 1.0 validators. Perhaps that is the very definition of "should we use HTML5 or not?" == "Should we use HTML5 Lint tools or XHTML 1.0 validators for checking our core code?"

Jeff Burnz’s picture

Jen, I think for D8 and HTML5 what we need is something that checks well formedness and syntax (HTML5 markup + XHTML syntax as a coding style) - that would tend to lead to advanced lint tools, but it really depends on how the validators develop/change/update with the new standards. Lint tools are pretty weak for debugging (think of more advanced usage like RDFa in HTML5 which at the moment is not checkable in any tool, but most likely the W3C will have options to do this when the specs are worked out).

We can't just look past the good things regarding validation - debugging, quality assurance, device independence and easing maintenance. These are all old arguments that have raged for years (is validation important), I don't think anyone is saying validation is old hat and not a best practice, certainly the landscape is changing, but right now validation is most certainly a best practice, to say any different seems rather out of touch with the real world - including the W3C, WASP and other high profile standards organizations. Take this article published just two months ago and endorsed/republished by the likes of Andy Clarke: http://bit.ly/cxON0L

tim.plunkett’s picture

I second Jen's comments in #19.

jacine’s picture

Can we please not have debates about validation? There are valid arguments on both sides, and we could fill pages of comments on this issue with that, but it doesn't really help anything.

BTW, for those of you who don't know, we are already using some ARIA attributes in Drupal 7:

  • jQuery UI adds a bunch
  • Progress bar:
    <div class="progress" aria-live="polite">
  • Password strength meter:
    <div class="password-strength"><div class="password-strength-text" aria-live="assertive">

That doesn't validate, and just because it's added with JavaScript doesn't change anything.

Assuming we go HTML5 in Drupal 8, which seems likely, of course we will use ARIA. If not, we'll have an actual reason to discuss this. As @mgifford said in #10, this is the reason why we aren't using it more:

A big point against bringing more ARIA into D7 was that it is still draft - http://www.w3.org/TR/wai-aria/

That's a good reason... But this is obviously expected to change. If it does not, and we don't go the HTML5 route, let's not forget that there are other ways to do this, such as making it a module that people can turn off it they want, like we do with RDF (as Jeff mentioned).

But, again, if we end up using HTML5, most of this conversation is moot, so I almost want to postpone it until there is a decision there. Just saying...

jensimmons’s picture

Re #20.
Oh I'm not saying validation isn't useful anymore. Of course it is. I just think we went from an era when if you wanted to get a job for a top-tier web shop, your work had to Validate. 100%. No errors. (Or at least the 2005 version of me thought that way and I tried to make my work always validate 100%.) I think it's much more common now to use validators as tools, and then look at the error messages and see why a site is failing validation. If it fails because you used inline styles (and I deleted some of those from a tpl file today) then your code is crapy. If it fails because you used ARIA with XHTML or something else, then I know of no webstandards geek who thinks there's something bad about that code. I just mean it used to be a binary test — pass or fail? And now it's more complex.

Also, about HMTL5 Lint tools, yeah — I don't think there are any good ones yet. It wasn't that long ago that there weren't any HMTL5 validators either. I meant that by the time we are hot and heavy writing code for D8, there will be good lint tools.

But yeah, this isn't just about validation. Are there any other reasons to not use ARIA besides validation worries? I can't think of any. I think mostly it's about how clean or junky do we want our HTML. Drupal classes and markup, plus RDFa, plus ARIA, plus.... whatever else (microformats?) starts to be a lot of code. I believe, however, that ARIA is well worth the extra markup, and should be a high priority. If we want cleaner code, we can look for other things to strip out.

That's cool to know we are already using ARIA in Drupal 7. That kind of makes this a silly debate, since we've already decided it's cool. Too bad we aren't using more it! I would have added it to Bartik if I had known more about it all.

Jeff Burnz’s picture

Well... recent investigations revealed there could be some issues with HTML5 elements + ARIA roles for some screen-readers, namely certain versions of Windows Eyes when used with IE8 and the roles are applied to certain HTML5 elements like <section> and <header>, and when a role is applied to an ol or ul. I know if the role is applied to a DIV there are no problems.

I'll have to dig deeper on this and find out what the exact issues are, I know Microsoft are making efforts to fix this as a more recent version has better handling (as recent as a few months ago things were improving). Will be something to keep our eye on.

rvilar’s picture

I think ARIA is a technology that we have to implement in D8, because, like RDFa, it is a technology that Drupal could be a pioneer in web application world.

+1 for ARIA in D8

mgifford’s picture

Just to be clear, by the time D8 comes out, WAI-ARIA is no longer going to be cutting edge. Both HTML5 (Working Draft 13 January 2011) & ARIA (Candidate Recommendation 18 January 2011) aren't finalized, but they will be soon. Looks like ARIA before HTML5 from the looks of it.

There is already some very limited ARIA used in Drupal 7, so expanding this for D8 isn't cutting edge. Here are some posts from 2009 on this:

http://www.standards-schmandards.com/2009/wai-aria-landmark-roles-in-cms...
http://www.brucelawson.co.uk/2009/redesigning-with-html-5-wai-aria/

@Jeff, is adaptive themes or any of your other themes use ARIA yet? I'm assuming that you've implemented it somewhere, but haven't dug in to find out.

Jeff Burnz’s picture

StatusFileSize
new181.95 KB

@mike, yes, they all have ARIA Roles, they're injected with JS, which has always been a stop-gap measure to foil validators, at some stage I'll have to rethink it (especially since Adaptivetheme for Drupal 7 is HMTL5) but will probably leave it for now and follow what develops for D8 core. It works and that's the main thing. Attaching a pic of a theme I am working on right now with roles highlighted with Juicy Studio toolbar tool.

Everett Zufelt’s picture

So, if we move to an html5 doctype <!DOCTYPE HTML> then there will be no problems with ARIA in D8 core. The question remains about whether ARIA will be permitted to break validation if we stick with an xhtml doctype.

Hopefully a D8 Core maintainer can jump in and help with some direction. I have no interst in working on any of the open ARIA issues if the answer is that there is currently no commitment to HTML5 in Core, and that we cannot break the xhtml page validation.

Everett Zufelt’s picture

Status: Active » Needs review
jensimmons’s picture

Issue tags: +html5

I'm feeling the need for an official decision as well. We can only hang out wondering what's going on for so long, before we tire of debating rather than doing.

Jeff Burnz’s picture

Lord-o-mighty its a done deal isn't it? I don't think we really need to debate this any more, come hell or high water D8 will carry the HTML5 doctype. That said we really need all core maintainers right behind the HTML5 thing, to gear up the implementation plans.

Everett Zufelt’s picture

@Jeff

I expect / hope you're right, but would love to here something from one of the two D8 maintainers to confirm.

Jeff Burnz’s picture

Status: Needs review » Fixed

This is a done deal - HTML5 is in for D8 and we can use ARIA in markup, hooray!

Status: Fixed » Closed (fixed)
Issue tags: -JavaScript, -Accessibility, -html5

Automatically closed -- issue fixed for 2 weeks with no activity.