-
Notifications
You must be signed in to change notification settings - Fork 27
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 img naming steps #322
Conversation
related to w3c/accname#27
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
I think this helps clarify immensely. Thanks, @scottaohara !
I'm not convinced discarding title where alt="" is present is a good thing. The title is still available on hover for sighted users. Contrary to the purpose of alt="", that suggests the image isn't purely decorative; it has some meaning beyond decoration. Strictly speaking, it can be argued that you shouldn't combine alt="" with title for the above reason and that this should be considered authoring error. However, when mistakes like this are made (and they invariably are), I'd argue it's better in the real world to avoid hurting the user if we can (only of course if we can do so without breaking valid use cases). An analogy is what browsers (tested Firefox and Chrome) do if you specify role="presentation" but also specify ARIA attributes: The question is: is there a valid use case for alt="" title="something"? If not, why take potentially useful info away from the user? |
I agree 100% with @carmacleod and with @jcsteh. The new wording makes things so clear that even I can understand it. 😀 Thanks @scottaohara! That said, whether or not those now-clear steps describe what we really want to happen is something I question. |
agreed, all. Which is why i wanted to leave this open for a bit before pulling it in - so thank you for responding. The following is my current stance on this. I'm mentioning it not because I am completely rooted in it, only to provide reasoning to why I think this change makes sense. Please, rebut me if you see things differently. point 1 - author errorMore often than not, in the audits/reviews of audits that I do, a For example, the following code snippets are representations of what I've seen in just the last week:
clearly the above is still going to be an issue regardless of but then there's also many instances like the following:
where again Granted, I know I am constantly exposed to incorrect usage due to the nature of my job. But because of that, i also see this happening a lot. It doesn't make the content "inaccessible" - just unnecessarily redundant/verbose. Though, this verbosity is ignored in Webkit and Chromium as they do not expose images with point 2 -
|
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The mapping for "img (alt attribute value is an empty string, i.e. alt="" or alt with no value in the markup)" states "See also the Note under img element Accessible Name Computation."
There is no note under img element Accessible Name Computation any more
add in new note as a reminder that `alt=“”` means the `img` is meant to be exposed as role=presentation
I agree this is author error... but on the other hand, this is also going to impact sighted users, albeit less impact than for screen reader users (they'll see a redundant tool tip when they hover).
That's true. One other concern I've been reluctant to raise until now (because it really complicates things) is that Firefox actually doesn't ever prune images with |
JAWS outputs a link with graphic with alt="" as follows:
NVDA outputs href of the link with Firefox and Chrome |
@jnurthen i would like to request this be taken up in an ARIA wg call before I merge this. |
@aleventhal and I discussed offline, and we'd be ok with either the Chrome or the Firefox approach, as long as there's consensus. |
I'd be ok with any approach that has consensus, for
|
I'd also be ok with any approach that has consensus, but I have a mild preference for the Firefox approach for the reasons Jamie specified in the context of considering users over authors over implementors. Quoting @jcsteh:
|
@mcking65 what say you? |
Given that
|
Steve, good question. I just compared what browsers do now using: I compared Chrome, Firefox and Safari (Edge will be the same as Chrome): |
Per those results, I'm really only surprised at Chromium not exposing the Of note, the ARIA spec states the following in the middle of the
So, ARIA is stating that I'm still on the fence (though more leaning more towards Webkit/Chromium behavior) with which direction is actually going to be more helpful to users in reality, particularly due to the numerous instances of misuse I've encountered (and more since this thread started). But if we do go the Firefox route here, I think it's important to surface the change in other places. Why are Chromium/Webkit no longer using Or do we agree that is a Firefox bug? For instance, taking Steve's example a step further, what should happen here From my earlier comment, what say people to point 2? Because that's essentially what we'd be doing here. For better or worse. And, imo, otherwise it's not really clear why this behavior would be happening when the general expectation/author guidance has been The counter point to that, would be allowing And that makes me nervous... accessibility is hard enough for developers to understand and get right. Having inconsistencies in how things behave doesn't help. |
As an author, I use I think this should be considered a Firefox bug. ETA: I think we can spin our wheels a lot on this and I would encourage us to not get stuck in the edge cases but think about the sensible implementation. |
@jcsteh we spoke about this again in the ARIA wg today. We wanted to make sure you were pinged on this again for any further thoughts you'd like to add. |
Somewhat related to w3c/aria#1628 |
I don't really have anything more to add beyond what I've already said. I understand and agree we need to fix the inconsistency here. I understand Firefox's approach might be confusing for authors. However, I still believe we need to consider users first (in a world of brokenness) at the end of the day, as I argued in #322 (comment). |
I agree with all of the reasons provided by @jcsteh for using title for the image name when alt="". However, I wonder if it could be feasible to revise the proposal slightly to avoid blocking valid use cases. I can imagine a design that legitimately calls for title on a image that should be treated as presentational because the information in the title is provided to assistive technologies via another element in the UI. Would it be feasible for ...
This would enable reduction of harm when alt="" might possibly be misused while still allowing for the possibility of hover text on a presentational image. It also continues to allow for reduction in harm when role presentation is mistakenly declared on an image where aria-label is specified. |
@jcsteh wrote:
AFAIK it's only available to sighted mouse users, and even then causes problems for magnifier users and others. It's not available to sighted keyboard users or to anyone using a touch screen device. We've spent decades drumming it into authors that Yes, if we agree that But if we allow title to override Like @scottaohara, I've seen So my preference would be to accept this PR. |
It's certainly fair to be cautious of assuming one situation is more prevalent than another. On the other hand, removing an element entirely means there is almost no possibility of a user working around that situation; e.g. in the case of a clickable image. In contrast, if the info is duplicated or slightly incorrect, the user has a chance of working around it, even if it's annoying, reduces efficiency or requires assistance the first time. To put this another way, you can learn that an incorrect label is incorrect, but if there's nothing there at all, you've got nothing to work with, incorrect or not. |
As an adendum, keep in mind that we're talking about what gets exposed via APIs here. If something isn't exposed, an AT can't even consider the possibility of a hacky caveat emptor workaround mode. |
Here's some data in case it adds to the conversation. I ran a query on the raw responses (i.e. not the rendered page) of the 7.85 million mobile sites, and 5.77 million desktop home pages crawled by the HTTP Archive in November:
So it's about 1% of images that are in scope of what we're talking about here. Which is higher than I thought it would be to be honest! What's more difficult to ascertain (and hence most of the discussion here!) is what the intent of those mixed signals were? The last column shows Not sure if that helps or hinders the conversation. SQL (warning this costs $136 to run, as that response bodies table is LARGE!)SELECT _TABLE_SUFFIX AS client, --client, COUNT(0) as images, COUNTIF( REGEXP_CONTAINS(image_elements, '(?i) alt *= *\'[^\']+\'') OR REGEXP_CONTAINS(image_elements, '(?i) alt *= *"[^"]+"') ) AS non_blank_alt, COUNTIF( REGEXP_CONTAINS(image_elements, '(?i) alt *= *\'\'') OR REGEXP_CONTAINS(image_elements, '(?i) alt *= *""') OR REGEXP_CONTAINS(image_elements, '(?i) alt *[^=]') ) AS empty_alt, COUNTIF( REGEXP_CONTAINS(image_elements, '(?i) title *= *\'[^\']+\'') OR REGEXP_CONTAINS(image_elements, '(?i) title *= *"[^"]+"') ) AS non_blank_title, COUNTIF( ( REGEXP_CONTAINS(image_elements, '(?i) title *= *\'[^\']+\'') OR REGEXP_CONTAINS(image_elements, '(?i) title *= *"[^"]+"') ) AND ( REGEXP_CONTAINS(image_elements, '(?i) alt *= *\'\'') OR REGEXP_CONTAINS(image_elements, '(?i) alt *= *""') OR REGEXP_CONTAINS(image_elements, '(?i) alt *[^=]') ) ) AS non_blank_title_explict_no_alt, COUNTIF( ( REGEXP_CONTAINS(image_elements, '(?i) title *= *\'[^\']+\'') OR REGEXP_CONTAINS(image_elements, '(?i) title *= *"[^"]+"') ) AND NOT( REGEXP_CONTAINS(image_elements, '(?i) alt') ) ) AS non_blank_title_no_alt_at_all, COUNTIF( ( REGEXP_CONTAINS(image_elements, '(?i) title *= *\'[^\']+\'') OR REGEXP_CONTAINS(image_elements, '(?i) title *= *"[^"]+"') ) AND ( REGEXP_CONTAINS(image_elements, '(?i) alt *= *\'\'') OR REGEXP_CONTAINS(image_elements, '(?i) alt *= *""') OR REGEXP_CONTAINS(image_elements, '(?i) alt *[^=]') ) AND ( REGEXP_CONTAINS(image_elements, '(?i)aria-hidden*= *"true"') OR REGEXP_CONTAINS(image_elements, '(?i)aria-hidden*= *\'true\'') ) ) AS non_blank_title_explict_no_alt_aria_hidden FROM --`httparchive.sample_data.summary_response_bodies`, `httparchive.response_bodies.2021_11_01_*`, UNNEST (REGEXP_EXTRACT_ALL(body, '(?i)]*>')) AS image_elements GROUP BY client |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now
@scottaohara is this now ready to merge? |
I am merging this PR, but please note that I do not consider this discussion resolved. Rather, this is being merged because I have other content I need to work on in this section of the document, and what's being merged matches 2 of the 3 implementations. If Firefox does not update to match the updated content of this PR, then nothing has actually changed. Rather, I would submit that maybe Firefox doesn't update at this time, as outside of this detail, they otherwise follow the spec. Instead, I have opened #404 with a summary of the discussion of this issue, and have provided a few proposals of what could be done next. I would very much appreciate feedback on that issue, and even alternative proposals if none of those seem feasible. |
related to w3c/accname#27
firefox bug
https://bugzilla.mozilla.org/show_bug.cgi?id=1700174
Preview | Diff
💥 Error: 504 Gateway Time-out 💥
PR Preview failed to build. (Last tried on May 10, 2022, 5:08 PM UTC).
More
PR Preview relies on a number of web services to run. There seems to be an issue with the following one:
🚨 Spec Generator - Spec Generator is the web service used to build specs that rely on ReSpec.
🔗 Related URL
If you don't have enough information above to solve the error by yourself (or to understand to which web service the error is related to, if any), please file an issue.