Skip to content

New rule: Image contains no text (0va7u6) #1522

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

Merged
merged 63 commits into from
Feb 15, 2021

Conversation

carlosapaduarte
Copy link
Member

@carlosapaduarte carlosapaduarte commented Dec 16, 2020

New rule for 1.4.5 checking that images do not contain text unless it is essential

Need for Final Call:
This will require a 2 weeks Final Call (new rule)


Pull Request Etiquette

When creating PR:

  • Make sure you're requesting to pull a branch (right side) to the develop branch (left side).
  • Make sure you do not remove the "How to Review and Approve" section in your pull request description

After creating PR:

  • Add yourself (and co-authors) as "Assignees" for PR.
  • Add label to indicate if it's a Rule, Definition or Chore.
  • Link the PR to any issue it solves. This will be done automatically by referencing the issue at the top of this comment in the indicated place.
  • Optionally request feedback from anyone in particular by assigning them as "Reviewers".

When merging a PR:

  • Close any issue that the PR resolves. This will happen automatically upon merging if the PR was correctly linked to the issue, e.g. by referencing the issue at the top of this comment.

How to Review And Approve

  • Go to the “Files changed” tab
  • Here you will have the option to leave comments on different lines.
  • Once the review is completed, find the “Review changes” button in the top right, select “Approve” (if you are really confident in the rule) or "Request changes" and click “Submit review”.
  • Make sure to also review the proposed Final Call period. In case of disagreement, the longer period wins.

@carlosapaduarte carlosapaduarte changed the title Image contains no text 0va7u6 New rule: Image contains no text (0va7u6) Dec 16, 2020
@carlosapaduarte carlosapaduarte self-assigned this Dec 16, 2020
@carlosapaduarte carlosapaduarte added reviewers wanted Rule Use this label for a new rule that does not exist already labels Dec 16, 2020
Jym77
Jym77 previously requested changes Dec 22, 2020

## Assumptions

The text is the most significant content in the image. If there is text in the image, but it is not the most significant content, this rule might fail but the success criterion might still be satisfied.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why this is an assumption rather than part of the Expectation. Do you feel it's ambiguous? (it certainly is subjective).
I guess this is to exclude, say, image of a street with street signs or shop signs showing text. I'm a bit afraid this is going to exclude a ton of images from the rule (i.e. that it is a very strong assumption that often won't hold).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I do feel "most significant content" is ambiguous. That's why I moved this to an assumption.

It would be nice to have input on this from other reviewers...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The WCAG definition for "image of text" already excludes "text that is part of a picture that contains significant other visual content", so I'm not sure we need to have this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But we don't link to the WCAG definition of "image of text" so we need to have this here (or worked into the expectation).
And I don't think we could use it, because, at least for me, the part about "significant other visual content" is ambiguous. If you consider the example given in the definition, an image of "a person's name on a name tag in a photograph", assuming that the person is also on the photograph, I wouldn't consider it to be an image of text because there would be other significant visual content on the image.. So, I guess, this is ambiguous...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't quite see what is ambiguous about "significant other visual content". Can you explain what different ways there are to interpret this phrase? Sure we can disagree over when something is "significant" in the same way we can disagree about if something is "descriptive". There's a quantitative aspect to it; How significant is enough? How descriptive is enough? But I think the meaning of this is clear. It's subjective, but I don't see this is ambiguous.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My main concern would not be the "how much significant" but the "is this part of the image significant". As I said in my previous reply, the example of "image of text" in the WCAG definition is not something that I would consider an image of text (it's true that the example needs context that is not provided, so I had to assume the context), so I have to conclude that the "significant other visual content" is being ambiguously interpreted.

Nevertheless, I seem to be the only one having this doubt, so I can give it a try and include this in the expectation.

@carlosapaduarte carlosapaduarte dismissed Jym77’s stale review December 23, 2020 11:11

updates plus discussion needed

Jym77
Jym77 previously requested changes Dec 23, 2020
Copy link
Collaborator

@Jym77 Jym77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple new questions…


## Applicability

This rule applies to any HTML element that is [visible][] for which one of the following is true:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be a mention somewhere that the image is not decorative? ("convey information")

Either by checking roles rather than element (can be in applicability), or adding a condition in expectation about "the image is [pure decoration][]".

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was one of the the first thoughts that crossed my mind when I started thinking about this rule. I discussed this with @WilcoFiers and he easily convinced me that this is not relevant for this SC. If you are presenting text then you should use text and not images of text unless the presentation is essential. You can always mark text as decorative if it is not being used to convey information.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 I have to disagree with the conclusion…
1.4.9, the corresponding AAA criterion, is explicitly allowing images of text that are pure decoration. It would be weird if they were failing 1.4.5…

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That line in 1.4.9 really made me change my mind. I've updated the applicability.

@carlosapaduarte carlosapaduarte dismissed Jym77’s stale review December 27, 2020 10:01

now with background images

Jym77
Jym77 previously requested changes Jan 4, 2021

## Applicability

This rule applies to any HTML element that is [visible][] for which one of the following is true:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 I have to disagree with the conclusion…
1.4.9, the corresponding AAA criterion, is explicitly allowing images of text that are pure decoration. It would be weird if they were failing 1.4.5…

@@ -26,11 +26,12 @@ acknowledgments:
This rule applies to any HTML element that is [visible][] for which one of the following is true:

- the element is an `img` element where at least one of the [image sources][] in its [source set][] does not reference an SVG document; or
- the element is an `input` element in the [Image Button][] state and its `src` [attribute value][] does not reference an SVG document.
- the element is an `input` element with a `type` [attribute value][] of `image` and its `src` [attribute value][] does not reference an SVG document; or
- the element has a [`background-image`][background-image] CSS property with at least one [`image`][css-image] that is a [url reference][url-reference] that does not reference an SVG document.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which value of the property do you consider? I guess the computed value (after resolving cascade and such).

@carlosapaduarte
Copy link
Member Author

@nitedog ready for your review again (changes made to the examples)

nitedog
nitedog previously approved these changes Jan 20, 2021
- the image resource contains text and it is [essential][] that the text is rendered with that specific presentation; or
- the image resource does not contain text expressing anything in a [human language][]; or
- the image resource contains text and the text is not a significant part of the visual content in the image; or
- the [visible pixels][visible] of the rendered image resource contain text and it is [essential][] that the text is rendered with that specific presentation; or
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like it could be simplified:

Suggested change
- the [visible pixels][visible] of the rendered image resource contain text and it is [essential][] that the text is rendered with that specific presentation; or
- the [visible pixels][visible] of the rendered image resource contain text for which its presentation is [essential]; or

@@ -36,24 +36,23 @@ This rule applies to any [visible][] [embedded image][].

For the rendered image resource of the [image sources][] of each test target, at least one of the following is true:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should hoist the visible pixels thing into the setup to avoid repeating that phrase 3 times:

Suggested change
For the rendered image resource of the [image sources][] of each test target, at least one of the following is true:
For the [visible pixels][] of the rendered image resource of the [image sources][] of each test target, at least one of the following is true:

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is that there is a 4th condition...

@carlosapaduarte carlosapaduarte dismissed stale reviews from nitedog, Jym77, and WilcoFiers January 25, 2021 16:16

changes made

Copy link
Collaborator

@Jym77 Jym77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the wordcloud asset is not used anymore and can be deleted.

Comment on lines 37 to 42
For each test target, at least one of the following is true:

- the [visible pixels][visible] of the rendered image resource contain text and it is [essential][] that the text is rendered with that specific presentation; or
- the [visible pixels][visible] of the rendered image resource do not contain text expressing anything in a [human language][]; or
- the [visible pixels][visible] of the rendered image resource contain text and the text is not a significant part of the visual content in the image; or
- the test target is [purely decorative][].
- the [visible pixels][visible] of the test target contain text for which its presentation is [essential][]; or
- the [visible pixels][visible] of the test target do not contain text expressing anything in a [human language][]; or
- the [visible pixels][visible] of the test target contain text and the text is not a significant part of the [visible pixels][visible] of the test target; or
- the [embedded image][] the test target belongs to is [purely decorative][].
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess if we want to factor in the "visible pixels" bit, we could do something like

For each test target, either is belongs to a purely decorative image or at least on of the following is true for its visible pixels:

But I'm not sure this is much better because it extracts a condition from the list, and because we usually want each individual condition to actually frontload the common thingie they apply to, so they would still real "the visible pixels contains no text", …

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to keep it as a list with all the conditions for the reasons you enumerate. If others prefer this solution, I won't oppose to the change.

Copy link
Collaborator

@nitedog nitedog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are still some comments on the definition for Embedded Image but I understand that these are mostly editorial.

@carlosapaduarte carlosapaduarte added Review call 2 weeks Call for review for new rules and big changes and removed reviewers wanted labels Jan 27, 2021
@carlosapaduarte
Copy link
Member Author

Final call until February 10

@carlosapaduarte carlosapaduarte merged commit f1b55d3 into develop Feb 15, 2021
@carlosapaduarte carlosapaduarte deleted the image-contains-no-text-0va7u6 branch February 15, 2021 13:12
@carlosapaduarte
Copy link
Member Author

Final call ended. Merging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Review call 2 weeks Call for review for new rules and big changes Rule Use this label for a new rule that does not exist already
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants