Giter Club home page Giter Club logo

Comments (9)

cookiecrook avatar cookiecrook commented on May 26, 2024

Some context (direct comment link) as to where this issue came from:

IOW, is it still a list item? Despite the unexpected (invalid?) context, if it renders the bullet, sighted users will probably perceive this as a list item, so the accessibility runtime should probably convey that to the screen reader or other assistive technology, too.

Another variant of the OP that contains the original list context, but includes a generic tweener div:

<ul>
  <div>
    <li>one</li>
  </div>
  <li>two</li>
  <li>three</li>
</ul>

from html.

domenic avatar domenic commented on May 26, 2024

I am not speaking for any particular implementation team, but I suspect that implementations will not want to deal with the compat fallout of changing UA styles here.

Additionally, I don't think we should change HTML's conformance criteria around <li> elements. If you use them outside an <ol> or <ul>, your HTML validator should give you an error.

So the most practical route here seems to me to be changing the AT mapping to match the visual mapping, so that invalid list items are displayed to AT users the same way they are to sighted users.

from html.

scottaohara avatar scottaohara commented on May 26, 2024

thanks for the thoughts, @domenic. i realized when raising this issue that compat would likely be the response to not change the styling. but, figured since it would be changing the styles for invalid use cases, maybe that wouldn't be as problematic.

Additionally, I don't think we should change HTML's conformance criteria around

  • elements. If you use them outside an <ol> or <ul>, your HTML validator should give you an error.

  • absolutely agree. i wasn't proposing otherwise. apologies if that wasn't clear.

    So the most practical route here seems to me to be changing the AT mapping to match the visual mapping, so that invalid list items are displayed to AT users the same way they are to sighted users.

    We can definitely bring this back to the ARIA wg to get consensus on what the mappings should end up being across browsers. i think there's more to discuss concerning what is visually presented and if that's necessarily how it should be mapped or not. but that can happen outside of this issue.

    thanks
    (going to leave this open a bit longer in case anyone else wants to comment. but if the HTML editors feel this issue has been answered, then i'd be fine with this issue being closed)

    from html.

    cookiecrook avatar cookiecrook commented on May 26, 2024

    For the sake of webcompat, shouldn’t the HTML or CSS spec document what is already happening, and therefore define rules for the WPT rendering tests, and subsequently accessibility WPT tests too?

    I’m not convinced it’s the best approach to leave it to accessibility engineering to figure out what to do about this mainstream rendering ambiguity. If the browsers are all doing the same thing, it should be reasonable to document the behavior. If the browsers are doing different things, we have a compatibility problem the HTML or CSS spec should address, even in the case of an author error.

    from html.

    annevk avatar annevk commented on May 26, 2024

    Do we have any data how big of a problem this is in practice?

    from html.

    cookiecrook avatar cookiecrook commented on May 26, 2024

    From talking to Anne offline, the spec-defined UA stylesheet rules (that render the bullets on orphaned list items) may sufficiently address what I called out as an ambiguity. If others agree, then I concur this could be addressed as a mapping issue in HTML-AAM.

    from html.

    domenic avatar domenic commented on May 26, 2024

    i think there's more to discuss concerning what is visually presented [...]. but that can happen outside of this issue.

    I mean, that's the topic of this issue, right? We should discuss if implementers are willing to change the UA stylesheet here, I think. Above I guessed they wouldn't be, but we haven't gotten any clear word yet from them!

    For the sake of webcompat, shouldn’t the HTML or CSS spec document what is already happening

    They do. The HTML spec documents that all <li>s are rendered with display: list-item. (I guess this is what @annevk explained offline.)

    from html.

    zcorpan avatar zcorpan commented on May 26, 2024

    I'm pretty sure that stray li elements, or li elements in div in ul, appear often enough on the web that it would break websites to change the UA stylesheet. But let's have a look.

    Here's a query in httparchive to figure out which tags precede li (ignoring ul/ol/menu and void elements and RCDATA/RAWTEXT elements and audio/video):

    https://docs.google.com/spreadsheets/d/1ea2vV0e8hKaaP-6zelZ_RS98LLq139MVp16b5DB8Jt0/edit?usp=sharing

    Summary: the table below shows how many pages use tag before li, out of 10,000 pages:

    tag count
    div 276
    a 62
    span 34
    nav 11
    td 8
    p 6
    strong 4
    font 3
    section 3
    form 3
    button 2
    aside 2
    center 2
    b 2
    marquee 1
    h 1
    figure 1
    header 1
    dd 1

    SELECT COUNT(DISTINCT page) AS count gives 406 pages, so 4.06% of pages are potentially affected. (I did not check for which author CSS is applied, so the breakage is likely a subset.)

    Example: http://lucabenetti.altervista.org/

    from html.

    zcorpan avatar zcorpan commented on May 26, 2024

    The dir element did not show up in the data (though it might in the full dataset which is ~1000x larger), but should probably be handled like ul in html-aam, see w3c/html-aam#486

    How to represent the above pages in a useful manner to ATs I'm not entirely sure.

    In any case, I think the data suggests that we shouldn't change the UA stylesheet. Closing.

    from html.

    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.