-
Notifications
You must be signed in to change notification settings - Fork 22
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
Clarify adding additional whitespace #3
Comments
<div>foo</div> <div>bar</div>
<div>foo</div><div>bar</div>
Just curious... is it the whitespace, or the line-break that is causing the
different outcomes. I agree that different outcomes is not great, but want
to ensure what exactly is causing the difference...
JF
…On Sat, Feb 10, 2018 at 8:13 AM, Tobias Bengfort ***@***.***> wrote:
Consider the following two HTML snippets:
<div>foo</div>
<div>bar</div>
<div>foo</div><div>bar</div>
The text node between the two <div> elements (containing only whitespace)
in the first snippet does not influence the visual result. However, the
accessible name (according to the current spec) of the first snippet would
be "foo bar", that of the second "foobar".
The current algorithm leaves all control with authors. However, many
authors are not aware that this kind of whitespace is significant. Many
browsers add additional whitespace around block elements to counter this
inconsitency. There are some questions about this:
- There is more than just block and inline. In which cases do we add
additional whitespace? table? inline-block?
- Should CSS be considered when calculating the display property or
should the initial value be used?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#3>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABK-c-H_5ieAFXjPb7tVl4lIXJYI_ATKks5tTaQUgaJpZM4SA8OB>
.
--
John Foliot
Principal Accessibility Strategist
Deque Systems Inc.
[email protected]
Advancing the mission of digital accessibility and inclusion
|
The linebreak (i.e. a |
the correct approach here is still under discussion: w3c/accname#3
Resolving this issue completely is a major project. It will require changes outside of accname. To start, ARIA itself does not yet address the semantic implications of block vs inline. The use of block elements for visual positioning does not necessarily mean that the elements should be treated as blocks from a semantic perspective. Because of the scope and complexity of this project, per discussion in the March 1, 2018 ARIA WG caucus, it is not containable in the accname 1.1 timeline. It is a high priority for accname 1.2. |
I agree that the scope of adding this to the spec isn’t feasible at this time.
However browser implementers are making these decisions right now regardless because they have to, so I strongly encourage leaving this functionality within the functional AccName Prototype code for this reason so at the least we have a positive example of what is expected in practice. All of the areas where this is ambiguous are documented within the code so browser implementors can make their decisions using informed comparative analysis.
Otherwise, if omitted, and browser implementers strictly follow only what is implied and do nothing else, when this functionality is documented at a later date everybody will already be doing something different and have to change everything yet again to accomplish what should already make sense in practice right now, which leads to more confusion and time and money to fix.
From: Matt King <[email protected]>
Sent: Thursday, March 08, 2018 12:24 AM
To: w3c/accname <[email protected]>
Cc: Subscribed <[email protected]>
Subject: Re: [w3c/accname] Clarify adding additional whitespace (#3)
Resolving this issue completely is a major project. It will require changes outside of accname. To start, ARIA itself does not yet address the semantic implications of block vs inline. The use of block elements for visual positioning does not necessarily mean that the elements should be treated as blocks from a semantic perspective.
Because of the scope and complexity of this project, per discussion in the March 1, 2018 ARIA WG caucus, it is not containable in the accname 1.1 timeline. It is a high priority for accname 1.2.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#3 (comment)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/ABx1aANSl-70DKC1wUDAUMrWGxKzx9AGks5tcOqggaJpZM4SA8OB> . <https://github.com/notifications/beacon/ABx1aKx593zDTG4qJ6py5PknpmhHVO7lks5tcOqggaJpZM4SA8OB.gif>
|
Another case we need to address as part of whitespace clarification:
It is expected that there will be no space between "top" and "most." |
It is expected that there will be no space between "top" and "most."
I ran this code using the AccName prototype and got the following.
accName: "Make this the topmost element"
accDesc: ""
(Running Name Computation Prototype version: 1.15)
From: joanmarie <[email protected]>
Sent: Thursday, March 15, 2018 1:37 PM
To: w3c/accname <[email protected]>
Cc: Bryan Garaventa <[email protected]>; Comment <[email protected]>
Subject: Re: [w3c/accname] Clarify adding additional whitespace (#3)
Another case we need to address as part of whitespace clarification:
<label> <input type="checkbox"> Make this the <em>top</em>most element</label>.
It is expected that there will be no space between "top" and "most."
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#3 (comment)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/ABx1aJh1GxhnEau8sToHyri8vIj6Jx7jks5tetDpgaJpZM4SA8OB> . <https://github.com/notifications/beacon/ABx1aB6KbGHtE12SV-1oXGXZJGXwL2d6ks5tetDpgaJpZM4SA8OB.gif>
|
Cool @accdc. Then maybe that's already solved. There was an Editor's note about that use case indicating that it needed to be addressed, so I added it here. Thanks for the info!! |
I am a bit confused by that sentence. Is this prototype a normative part of the spec? If so, why is it not mentioned anywhere in the document? This whitespace issue is clearly not addressed anywhere in the spec document in this repo. |
"I ran this code using the AccName prototype and got the following." No, it's not normative as yet, but it's one of the things that we are trying to work out for implementors since it's an important consideration that needs to be addressed. As Matt pointed out though, this will need to be added to the 1.2 milestone where normative criteria can be documented, because there isn't time to put it into 1.1. The AccName Prototype is the same one that you contributed to earlier at This code is being used as a prototype so that we can work out any flaws in the logic of these processes in advance by having a working algorithm to test with, and is executable from each of the testable statements documented on the wiki at In this way, we can end up with a working model of the naming computation that will always produce the same results for the same tests within all browsers, and browser venders can use this to test against in order to bring them into alignment. This is why it's important to include the whitespace logic at this time, since the goal here is also to have an algorithm that does as much as possible to reflect the most desirable results, because then, these conclusions about what works and what doesn't in practice will more accurately shape the normative guidance when we update this. |
If I am not mistaken, the AccName does not currently clearly regulate whether two adjacent nodes are output with or without spaces. What is clear is that they are output with spaces if there is a space, line break, tab character, etc. between them in the source code.
These suggestions differ slightly from the output of https://whatsock.github.io/w3c-alternative-text-computation/Editable%20Live%20Input%20AccName%20Test.html . In my opinion it does not make sense to use the current output of the screenreaders for the AccName rule regarding space, because it is inconsistent. In the examples below, for example, Tab Navigation outputs some links with the label "12", but the same links are output when reading with the arrow keys in two reading steps with "1" and "2" (tested with JAWS 2019 and Chrome 77). Reason: HTML elements have a meaning that should be considered by AT. CSS, with a few exceptions, is only used for visual design and is ignored by AT. I plead for not weakening the clear separation between HTML and CSS. A web developer who uses the wrong HTML elements and thus causes a wrong output of spaces violates the SC 1.3.2 of WCAG: Failure of Success Criterion 1.3.2 due to using white space characters to control spacing within a word. Regardless of whether my suggestion is accepted or not, I am very much in favour of the correct output being regulated bindingly in AccName, because without regulation it is unclear how it would be correct. My suggestion would mean that the following links would be output with or without spaces between 1 and 2 as follows without space
with space
needs to be discussed
|
I think it's only unclear in 2.F.iii:
Every other mention of "append the result" explicitly states whether a Space is added or not. From what I can tell implementors interpreted this omission as "block" -> "Space", "inline" -> "no Space". |
In this context, the new CSS values for display, such as flex and grid, should also be considered, since the current output in Firefox, Chrome and Edge is wrong: FreedomScientific/standards-support#421 |
Hi, The Core AccName algorithm is not meant to be user agent specific, so it doesn't actually need to define and quantify all native host semantics where this concept may be variable when rendered by different technologies, because these differences will already be documented within the host spec using Core AccName as the baseline. As pointed out here, there are many ways visual rendering differences can be achieved depending on which technology is being used to do this, and the purpose of AccName is not to confine or restrict how content is rendered, or to ignore when these changes occur, but rather to represent an accessible human readable string from that content so it can be added within the accessibility tree. It seems like it may be useful to step back for a moment, and simply state what the ultimate purpose of this should be. Then it will be easier to define how this can be stated to make sure this purpose is conveyed as needed within the spec. So, to me, this is how it makes sense. When computing the name for an element, the accessible name as computed should insert a space between textual content that is visibly separated when rendered, so that the meaning of the accessible name or description matches the intuitive flow of the text that is human readable. It seems to me that the above statement best represents what is needed to produce the most accessible names and descriptions, because the goal here is not to debate what computers can understand, but rather what people will best understand when they hear these things announced. Regarding the Core AccName algorithm, it can be explicitly stated that, when computing the accessible name or description of an element, all owned elements that are visually perceived as being separated from adjacent content, must include a single space to separate them when computed as a flat string of text. Like I said, this isn't spec text, but it cuts to the core of the issue, which is to provide an equally accessible experience for non-sighted screen reader users when attempting to perceive the same content, and to perceive the same level of understanding of that content as it is announced verbally. It is a simple logic test to read allowed what is visually displayed and ask yourself, would that make sense if I couldn't see it? The explicit definitions of what constitutes visual separation will need to be handled within the specs that deal with specific host semantics, such as block level versus inline elements and special characters in HTML, or block level versus inline styling pseudo elements and special characters in CSS, and the same in SVG. First, we define the baseline behavior within the Core AccName algorithm, then it can be explicitly defined as it needs to be within specific user agents to handle native host semantics, and then these are added into the browsers so it can be accurately represented to assistive technologies like screen readers. Can we agree that this is a viable way to move forward? Thanks, |
Hi Bryan, I mostly agree that visual separation is a good indicator for semantic separation and that the details can be left to the host specs. But I also have some notes on both:
|
I understand what you mean, and agree that visual separation is a tall order in all cases. I don't believe that absolute conformity is possible in such cases where visual aspects are used as the only guiding principles. "I am wondering whether we should really focus on the visuals or if there is some more abstract layer of "truth" behind it that we could use." Though it's not possible to ensure that every case will be perfect when it comes to computing accessible names and descriptions, it is possible to ensure that block level styling will at least be a contributing factor when it comes to automatically computing when some spacing should be added. At present, adding support for this within the 1.2 spec is a priority that we've been discussing for a while now, including both elements and CSS pseudo elements. It will never be 100% perfect in all cases, but it will cover the majority of general use issues that we encounter often already. Accounting for whitespace characters within specific rendering environments, such as Defining what basic whitespace means is a bit of a separate issue, which is another aspect of the spec that needs to be changed to better conform with other specs and to act as a baseline for its definition. From the initial list of whitespace characters documented in the HTML spec, can you recommend any additions to it that would be helpful as a core set of characters to check for? |
Not sure if this draft specification of For the OneTwoThree example above, assuming the same css, the markup to ensure that AT read it as "One Two Three" would be:
If you think this new attribute would be helpful, and if you would like it finalized in time for ARIA 1.3, please add a comment to w3c/aria#996. |
While not formalized in the AccName spec yet, there are discussions about adding white-space around inline-block elements. - w3c/accname#205 - w3c/accname#15 - w3c/accname#3 This change will make Chromium add whitespace around inline-block, inline-grid, inline-table, and inline-flex elements when computing Name from Content. This will let us pass the WPT tests that are in progress of being written: web-platform-tests/wpt#42354 Notes: - The WPT tests only mention inline-block, and there is no mention of the other inline-* properties yet. I think it's OK that this patch adds whitespace around other inline-* display properties (probably moreso than inline-block) because those properties define special formatting rules for their children, but let me know if you disagree and I can special-case this logic for inline-block. - It seems that <math> elements have an AtomicInline display type, similar to the other inline-* display types. This means that we start outputting whitespace around <math> elements when computing name from content as well. This feels fine, but as before, let me know if you disagree and I can hardcode what cases are OK. (As an aside, something seems broken with Name from Content when children are MathML? It's preexisting, and should probably be fixed in another CL) Change-Id: I2a4fc3cf137de5167d160860c1bda5151b38277d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4921470 Commit-Queue: Aaron Leventhal <[email protected]> Reviewed-by: Aaron Leventhal <[email protected]> Cr-Commit-Position: refs/heads/main@{#1207629}
Newer issue: #225. I am closing this so discussion happens in a single place. |
Consider the following two HTML snippets:
The text node between the two
<div>
elements (containing only whitespace) in the first snippet does not influence the visual result. However, the accessible name (according to the current spec) of the first snippet would be "foo bar", that of the second "foobar".The current algorithm leaves all control with authors. However, many authors are not aware that this kind of whitespace is significant. Many browsers add additional whitespace around block elements to counter this inconsitency. There are some questions about this:
block
andinline
. In which cases do we add additional whitespace?table
?inline-block
?The text was updated successfully, but these errors were encountered: