-
Notifications
You must be signed in to change notification settings - Fork 26
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
Inconsistent name calculations for input elements #231
Comments
Thank you @dd8 I've been working on updating content that would address the points you raise here, which are related to existing issues #209, #134, #225, #210. This issue will be noted in that update, however I'd be more than happy to accept a PR to address these more immediately, as everything you've listed are really editorial updates to match reality. |
@scottaohara We've just completed an green field implementation of accname-1.1/html-aam and noted a number of problems with both specs. Would you be interested in some suggestions / PRs? |
i'd be interested in your findings, sure. especially since i'd be interested to see if i'm missing anything from the work i've been drafting. |
One of the main problems we found is the flow of control between accname-1.1 and html-aam is not obvious and there seems to be duplication of some steps: https://w3c.github.io/accname/#mapping_additional_nd_te For example, to calculate name of this input field:
AccName There's mutual recursion between html-aam and accname, but the entry points to the algorithms aren't clear due to duplication. This leads to weird inconsistencies - for example:
I think there's an easy way to avoid duplication and make the flow of control clearer using the approach that css-syntax-3 uses - it has well-defined entry points intended for other specs: https://www.w3.org/TR/css-syntax-3/#parser-entry-points. For accname/html-aam you could have entry points like these:
|
Some of the accname unit tests depend on the correct calculation for Edit: Order is specified in https://www.w3.org/TR/wai-aria-1.1/#aria-owns, but I think the accname calc should specify where aria-owns nodes are used in the calculation (probably in Step 2F - compute name from content) |
It's not clear if this is a goto or a function call of steps 2F.i) through 2F.iv) css-syntax-3 handles this type of situation by splitting the CSS parsing algorithm into simple algorithms that call one another: |
Hi Mark, Going to try to respond to all your questions/points starting from your first post on, but at a high level I agree with you that there could be some wording to make it more clear when to defer to one spec over the other. HTML AAM notes that step one is to reference steps 2b/2c of accName. This is not meant as a duplicative effort, rather HTML is deferring to steps 2b/2c of accName if aria-label or labelledby are used as they are naming mechanisms not part of the HTML host language. Specifically looking at the example you presented, the algorithm would stop after step 5.1.1 step 2 (label), so nothing beyond that would be considered since the label would provide the accessible name. But if we were to look at a nameless 1 . initialize steps 2e - 2i are not run because HTML AAM returned no accessible name. For accName, if the role does not come from a native HTML element, HTML AAM would be skipped over and naming would resume with 2e. Now, regarding Hope that helps. |
@scottaohara Thanks - that's helpful. Looks like there's already an open issue for |
Another apparent inconsistency is the treatment of steps that can return an empty string or whitespace. An So whether this stops at 2B returning an empty label, or proceeds to 2C and returns 'Test1' is probably implementation dependant:
but the spec explicitly says this should continue to 2D:
From an implementors standpoint, it's easier to check for an empty string before executing the next step, than checking in advance whether all the conditions for each step are satisfied (although this might need special casing for
|
hmm. i can confirm, as i've run into this issue lately, that instances of @stevefaulkner we should have a think on this :) |
@scottaohara Some more info - this accname test case doesn't work unless white space is trimmed from the result of name-from-content: If the result isn't trimmed you get the accName calculated from the IMO it makes sense to trim the result for each step - not just aria-label. The only place that might matter is the difference between Most of the time it won't make any difference, but it does stop white-space only names being returned in cases like name_test_case_602 |
closing this issue due to the other linked issues that are related, and the PR #239 which will aim to resolve the white space issue that is also noted here. |
input type=number
input type=number
works like an (enhanced) edit box and displays placeholders, but isn't listed in 5.1 so falls back to the calculation in 5.7 Other Form Elements which doesn't use the placeholder attribute:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number#Additional_attributes
Multiple labels
The name calculation for Input types listed in 5.1 explicitly accounts for multiple labels:
but the name calculation for 5.7 Other Form Elements (e.g. type=week, type=datetime-local) says:
(There might be reasons to treat type=radio and type=checkbox differently, but edit box replacements like type=week should probably allow multiple labels)
Typo
Editorial: input type='email is listed in 5.1.1 and 5.1.2 but is missing from the 5.1 heading
https://w3c.github.io/html-aam/#input-type-text-input-type-password-input-type-search-input-type-tel-input-type-url-and-textarea-element
The text was updated successfully, but these errors were encountered: