Skip to content
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

Mention <br> element #4

Open
xi opened this issue Feb 10, 2018 · 8 comments
Open

Mention <br> element #4

xi opened this issue Feb 10, 2018 · 8 comments
Milestone

Comments

@xi
Copy link

xi commented Feb 10, 2018

<div>foo<br>bar</div>

I would expect the accessible name of that element to be "foo bar" (with a space where the <br> element was). However, I do not see how the <br> element is handled in the spec.

Maybe a step roughly like this could be added between 7 and 8:

Otherwise, if the current node represents some kind of whitespace (e.g. the <br> element in HTML), return a string containing a single space.

@accdc
Copy link
Contributor

accdc commented Feb 11, 2018 via email

@AmeliaBR
Copy link

I think it is a fair simplification to say that a <br> element is equivalent to CSS generated content of a line break character (although the CSS working group has determined that existing behavior cannot be described so simply, and so it's currently "magic" behavior outside the CSS model).

However, as Bryan hinted at in his reply, the <br> is only one of many block-level elements that can break up a text. In script-generated DOM, you often won't have whitespace between other block elements, such as <p> or <li>. The name & description computations still need to insert whitespace for the visual break caused by the block layout.

So that should be a broader issue: if elements are displayed as separate blocks, insert one whitespace character between them. For CSS-styled content, that could basically be defined as: If an element's CSS display type is not inline, add whitespace before and after its text alternative when compiling a parent node's alternative text.

For environments without CSS styling, you would use the default display type for the element, which could be defined as lists of block vs inline elements (e.g, in the HTML-AAM).

If specific additional details are required for <br>, that should probably also go in the HTML-AAM, although maybe with an informative note in the text alternative computation section of this spec.

@xi
Copy link
Author

xi commented Feb 12, 2018

<br> is only one of many block-level elements

I am not 100% sure, but <br> seems to get display: inline, at least in chrome. This is why I think it is special.

@accdc
Copy link
Contributor

accdc commented Feb 12, 2018 via email

@AmeliaBR
Copy link

I brought up block-level elements because they don't seem to be mentioned in the current spec text, and they have the same effect of breaking up text.

But yes, relying on CSS display to describe <br> would not be sufficient, since it is an inserted forced line break, not a new CSS box. Sorry for going off topic on that point.

My suggestion would therefore have 3 parts:

  • In HTML-AAM's Accessible Name and Description Computation section, include an entry for <br> that clarifies that it is equivalent to a line break character.
  • Clarify in AccName step 6 (where there is currently an Editor's note) that you need to add whitespace between the alternatives for block elements, but not between inline text spans.
  • Add an informative note about <br> to AccName, explaining that even though it is inline, it has an alternative text equivalent to non-collapsible whitespace.

@AmeliaBR
Copy link

Maybe @stevefaulkner or @jasonkiss could comment on the plausibility of adding a <br> text equivalent to HTML-AAM, for use when computing parent text even though it has no role itself.

@mcking65 mcking65 added this to the 1.2 milestone Mar 8, 2018
@mcking65
Copy link

mcking65 commented Mar 8, 2018

The issue of how to process <br> issue is closely related to #3. It should not be addressed independent of all the other white space considerations, which, due to their complexity, are targeted for accname 1.2.

@accdc
Copy link
Contributor

accdc commented Mar 9, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants