Code Monkey home page Code Monkey logo

Comments (8)

accdc avatar accdc commented on May 29, 2024

from accname.

AmeliaBR avatar AmeliaBR commented on May 29, 2024

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.

from accname.

xi avatar xi commented on May 29, 2024

<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.

from accname.

accdc avatar accdc commented on May 29, 2024

from accname.

AmeliaBR avatar AmeliaBR commented on May 29, 2024

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.

from accname.

AmeliaBR avatar AmeliaBR commented on May 29, 2024

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.

from accname.

mcking65 avatar mcking65 commented on May 29, 2024

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.

from accname.

accdc avatar accdc commented on May 29, 2024

from accname.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.