-
Notifications
You must be signed in to change notification settings - Fork 257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
4.1.1 Parsing - Duplicate attributes with no user impact cause a conformance failure #542
Comments
I'm fairly sure that behaviour was unspecified when WCAG 2.0 was written, but also it was common for AT to read the HTML directly as well, which led to very inconsistent results. 4.1.2 does have the get-out clause of "except where the specifications allow these features", which it could be argued is the case now. However, do you (or anyone) know of cross-AT testing for these examples? In order to update (the understanding doc & techniques primarily) I think we'd need to convince people it really isn't a problem anymore, for which test results would be very useful. |
We'll do some testing and publish the results. We'll probably test the following:
@alastc - any other combos or attribute combinations worth doing?
A former member of the JAWS team said very old versions of JAWS had an HTML parser because until the introduction MSAA in 1997 there was no way to get at the browser DOM, and no accessibility tree, so AT had to grab the raw HTML and parse it. I'd be surprised if any AT still parses raw HTML because it won't work with any pages using JavaScript to modify the DOM. |
There are still cases where AT will cover for lack of browser support, e.g. Jaws and IE. That isn't quite the same thing, but perhaps @stevefaulkner is well placed to comment on this? (I.e. does any modern AT still parse HTML separately which can lead to differences in output?) For testing, I think the key is the second group, AT on top of browsers. |
In my personal opinion while it is a technical violation under SC 4.1.1 it may not have any practical impact on the user and would not fail other SC. Generally violations of SC 4.1.1 that impact the user would also fail other SC like 4.1.2 or 1.3.1. So technical conformance violation but may not impact on user. |
@mraccess77 you probably know the history better, but I thought the point of this one was to catch technical errors that don't fall under 4.1.2/1.3.1? I think there's a case that some (or all) of these issues could be ignored now that the HTML spec better defines the behaviors, but it would help to have some data to back that up. |
Building on Alastair's last point, the case to be made that these aren't failures hinges on the part where the SC reads "except where the specifications allow these features". The spec seems to accept that duplicate id's happen and describes how to handle it, but does that constitute "allowing"? |
Curt Bellew (a peer of mine who participates in the Aria working group) also informs me that Aria has a specification which allows/supports duplicate ID’s. I’d have to ask him for the details.
Regards,
Chuck
|
For HTML the nu validator in general gives an error for duplicate ids. Given that it's an error and not a warning I'd say it's an issue -- but perhaps some would say the validator is not correct? |
Duplicate IDs (as opposed to duplicate attributes) are definitely still a problem The DOM 2 and 3 specs said the behaviour is undefined when duplicate IDs are present: The WHATWG and DOM 4 specs do define the behaviour when duplicate IDs are present: However, if you use labels referencing duplicate ids, then gibberish is read for labels in lots of browser/AT combos: |
@mraccess77 - yes, I'm not sure. I wonder what @stevefaulkner would say? @dd8 - good info. I'd say that for your dupe id labelling example that is a 4.1.2 issue in that the controls do not have the right accessible names. |
Being very picky with the normative wording for 4.1.1
(emphasis added on "allow"). Taking the whatwg living standard for a second:
While in the real world, for user agents that implement the error correction behaviour which is now defined in the spec, any failures would happen consistently and therefore be noticeable (compared to validation errors back in the days before HTML5, where each browser/UA potentially parsed broken HTML differently, leading to possible unforeseen errors in some UAs that authors may not have tested at the time), the strict reading of the normative wording still applies I'd say. So broken markup that reuses the same Long story short: I'd still flag those as failures, as otherwise we may need to change the normative wording of SC 4.1.1 |
Oracle's takes the position that 'invalid HTML' will not necessarily be corrected if it's reported by an automated tool but has no negative ramifications on accessibility. |
After related discussion about what constitutes an accessibility barrier vs a WCAG conformance failure, the auto-WCAG Community Group took the literal interpretation outlined by @patrickhlauke in his comment from 6 February for its ACT Rule 'attributes are not duplicated'. I recall it was a borderline decision with some arguing against this rule. Clarification from AGWG would be helpful. Note: there is another ACT Rule 'ID attribute is not duplicated' but other aspects of SC 4.1.1 (eg. complete start and end tags) were intentionally left out because they generally do not constitute accessibility barriers (anymore). |
I think the question we are struggling with is: Given the improved HTML specs and handling by browsers, is this still an accessibility issue? I.e. Does anyone know of examples where these impact AT more than anyone else? I can't think of an instance from our audits where something fails this and impacts accessibility without also failing 1.3.1 / 4.1.2. |
@alastc agree. IF we're able to make normative changes, then my vote would be to ditch 4.1.1 unless there's clear indication that there are particular situations where invalid markup brings up issues. the only one i can think of at this stage are scenarios of older browsers/user agents which DON'T follow the spec's now clarified error correction algorithm |
https://html.spec.whatwg.org/multipage/introduction.html#syntax-errors has a discussion about the impact of different syntax error cases. None of these mention accessibility directly, but some might still have an impact on accessibility. |
I think duplicate IDs may still be an accessibility issue? If so, then dropping the entire SC may be going a bit too far. |
@nitedog yes - in cases where those |
Nesting issue still occur as well so i dont support dropping rhe whole SC. |
@mraccess77 What is the issue that you are referring to? @stevefaulkner those wind up being covered by 1.3.1 or 4.1.2, don't they? |
@awkawk An automated checker would not be able to tell if a form control is labeled incorrectly, would it (needs human judgement)? But it can easily check for duplicate IDs. But I suppose it could still give an error for duplicate IDs and cite 1.3.1 or 4.1.2, though I think that's less clear. Moreover, maybe the checker would need to allow some duplicate IDs, like if they're not referenced at all. I'm not sure that's a useful strategy. Separately, I would argue that duplicate ID is not a parsing issue. The HTML parser does not have knowledge of IDs. Handling of IDs happens in the DOM layer. Maybe 4.1.1 could be changed to only require unique IDs? |
My $.02... I've been at this a very long time and don't recall encountering a single instance of a 4.1.1 failure that impacts accessibility that is not captured elsewhere in WCAG. I can't think of an instance where multiple id's that impact accessibility wouldn't also be a 4.1.2 or 1.3.1 failure. On the other hand, I've encountered lots of 4.1.1 failures that have absolutely no impact on anything - yet authors sometimes spend incredible amounts of time making these tool/validation errors (I'd note that WAVE doesn't test such trivialities) go away for "conformance" rather than focusing those efforts on testing or fixing actual accessibility issues. I wouldn't miss 4.1.1 at all. |
A while back I asked Mike Smith for stats for different error messages in an instance of validator.w3.org. Here are the errors above 0.1% with an example of markup triggering the error and an analysis/guess if it affects accessibility.
|
EDIT: Sorry, my page was stale, I was responding to the 3 hour ago comment! @zcorpan It's hard to work out from that, the question is whether someone using assistive techology would get a different result. The criteria came from a time (mid 2000s) when screenreaders & other AT often interpreted the HTML themselves, and the browsers gave very different results to validation errors. If the browsers are generally consistent in how they deal with un-closed tags, nesting, and duplicate / non-unique IDs, there's an argument this criteria doesn't acheive anything (useful) anymore. ADDITION: the example with duplicate IDs is interesting, as I think it demonstrates why this isn't an accessibility issue anymore:
If the browsers deal with that consistently (my understanding is they do), then the duplication aspect is not important, the role is programatically determined and not ambigious, and we can use 4.1.2/1.3.1 to pick up the results. If it should be 'navigaiton', then |
That's a duplicate attribute, not duplicate id, but yeah.
This has been the case for HTML parsing since browsers implemented the HTML5 parsing algorithm:
|
That would be a fallback, but it doesn't seem the best way to deal with it, we'd be handwaving and saying "it's still here but just ignore it". On the dragon example, I'd happily fail that under 1.3.1. as the relationship conveyed through presentation is not programmatically determined. H93 (uniqe IDs) could become a technique under 1.3.1. @dylanb do you know of any examples that would fail 4.1.1 without failing 1.3.1 / 4.1.2? |
@alastc @awkawk I am no fan of 4.1.1 but I would actually like to see it changed and expanded rather than removed. Any 4.1.1 failure that resulted in a real accessibility problem could always previously also be categorized under another SC (as long as WCAG itself covered that issue - which it does not always do) There is an argument to be made that all of 1.1.1 can actually be categorized under 4.1.2 as can many other failures. What 4.1.1 is about that is unique in WCAG is: future proofing - its intent is to ensure that stuff that works today, will work in the future. I think it would be great to be able to drop issues which the specs evolve to cover and that also get implemented by all parties involved (not just browsers) If we are going to remove things, we also need to be able to add things that make sense. We should keep the 4.1.1 intent and expand specifics to include things like ARIA conformance. |
yeah there was an implied "so what's the point then?" in my previous comment |
Form controls inside of links that are against the spec I've seen buttons inside of links. Form I've seen ARIA markup use aria-owns on controls that contain owning elements. I've seen issues with links inside labels that impact Talkback on Android. |
Those cases are not parse errors. |
@zcorpan The NU Validator says Error: The element input must not appear as a descendant of the a element. |
do those fail / create problems for all users, or just specifically keyboard and/or AT users? aria-owns issues...possibly 1.3.1 and 4.1.2 issues? |
I'd say bad ARIA is almost always a failure of 4.1.2: Name, Role, Value, (and States and Properties).
I say "almost always" out of an abundance of caution. I can't think of when it isn't a failure of 4.1.2. |
@mraccess77 it's not wrong, it's just reporting all checkable conformance errors, not just parse errors. 4.1.1 is worded like it is specifically to subset all conformance errors to the smaller set of errors that is parse errors, as @DavidMacDonald wrote in "Background" earlier. If you enter that markup in https://parsetree.validator.nu/ (and include a But it might still violate other requirements of the HTML standard, that are not in scope for 4.1.1. |
@zcorpan the normative text doesn't say anything about parsing errors The normative text says "elements are nested according to their specifications" -- so whether it is or is not related to parsing it is covered by the SC. |
Oh, yes, I stand corrected. Content model requirements do fall into that. |
Let me make one more argument in favor of adding ARIA conformance to 4.1.1 When 4.1.1 was created, there were real and important differences in the ways that different browsers and ATs handled non-conforming HTML. This meant that the only way to guarantee consistent behavior across browsers (or as close as possible) was to stick to the spec. I would say that 4.1.1 served this purpose very well. But the HTML spec has evolved to the point where all of those differences are now gone because they are covered in the (evolved) spec itself. The implementation of ARIA is in a similar situation today that HTML was 10 ish years ago. There is no specification to say what to do under all of the absurd non-conforming ways the technology might be used. Therefore we would be adhering to the intent of 4.1.1 by dropping the HTML parsing errors and adding ARIA non-conformance. |
I might be missing something, when would code would fail "ARIA conformance" but not fail 4.1.2? |
@alastc There are a lot of ways to create invalid ARIA without causing accessibility issues. You just slap an random ARIA attribute onto an element that shouldn't have it: <button aria-colspan="five">Submit</button> I think the question of should correct use of ARIA be required by WCAG is a separate question. I would suggest opening a separate issue for that. It seems to me the original intent of 4.1.1 is to handle the problem of ambiguity in markup specs. If a popular inaccessible browser parses something one way, and some AT does it a different way, and the spec isn't clear about which one is correct, content should work in both. That problem was solved years ago, at least as far as technologies web browsers support go. Duplicate IDs, duplicate attributes, incorrect nesting, none of these things are accessibility problems. They can cause them, but they are symptoms of a problem, not the problem itself. I think AG can simply declare that the HTML 5.x meets the exception in 4.1.1. |
Good points @WilcoFiers It is a separate question, and if we expand/add something to cover ARIA conformance, it would be separate from 4.1.1. I'd also like to see it looking for outcomes rather than conformance to a spec. I.e. does this thing do what it's supposed to, rather than catching random stuff that has no impact on end users. Otherwise we could be in the same position next time, wondering how to depricate it.
That would be one method, I'd like to explore removing it though. |
Do we know the situation with other markup languages, specifically SVG? |
@michael-n-cooper Based on yesterday's discussion, can you assign this to me? I'm thinking to show that this should be deprecated, what I'll need to do is prove that any type of non-conformance that can come form 4.1.1 is either not an accessibility concern for modern markup technologies, or also a conformance issue under a different success criteria. |
I just tried to assign you, but your @WilcoFiers account doesn't seem to be enabled on this repo, probably needs a tweak from Michael. |
@WilcoFiers any updates? |
I've opened an issue here: #770. I propose we close this thread. |
OK, this conversation is referenced from #770 so I'll close. |
Not all attributes affect how content is presented to the user. When attributes with no effect are duplicated, there's no affect on accessibility or the on the end user, but there is a conformance failure.
For example:
a) when the duplicate attribute is not part of HTML/SVG so has no effect at all:
b) when the duplicate attribute does not affect browser rendering, browser interactions or the accessibility tree:
c) when the duplicate attribute is not valid, and has no meaning, for the element it's applied to:
d) when the duplicated attributes specify the same value - because the browser stores exactly one value for this attribute in the DOM, and can choose either with no change in behaviour:
e) when the duplicated attributes specify have different values with exactly the same meaning - because the browser stores exactly one value for this attribute in the DOM, and can choose either with no change in behaviour:
Also worth noting that the HTML 5 spec describes behaviour when duplicate attributes are present - browsers must ignore duplicate attributes in HTML documents and use the first value:
https://www.w3.org/TR/html5/syntax.html#attribute-name-state
This behaviour was probably unspecified when WCAG 2.0 was written.
The text was updated successfully, but these errors were encountered: