Repository navigation
Conversation
This is work-in-progress still at its early stage, more examples will be added, some may be removed. Everything is open to discussion.
Updated the description and applicability of the heading relevance rule to clarify its requirements and scope.
Added authors to acknowledgments and clarified rule scope.
Updated the description for clarity and improved the explanation of the rule's evaluation criteria. Added sections on assumptions, limitations, and exceptions to provide more context.
Edits made until Passed example 6
❌ Deploy Preview for act-rules failed.
|
Examples section (work-in-progress) Text reviewed until Passed (situation D)
Updated comments in HTML examples for consistency by adding periods at the end of sentences.
Updated comments in HTML examples to remove unnecessary punctuation.
Clarified the definition of 'content' in relation to headings and corrected a comment in the passed example.
Updated the wording and structure of the rule to clarify the applicability and expectations regarding headings. Modified limitations and exceptions.
This will be the entire content, but not carefully reviewed yet. This is Draft 1.
The entire text is available. Fixing logical issues, adding or removing sentences.
Minor changes in the wording and in the ordering of the examples
|
Thanks for putting this together @grifare. Just as a reminder, the thing that kicked it off was that a heading shouldn't only have to describe the first thing after it. That's a real issue with the current rule. The reason we wrote it that way is we couldn't figure out how to say how much a heading should describe, or where a section actually ends. I do have to be straight with you about the big problem though. Your rule doesn't follow the ACT Rules Format or the style guide. We can't invent new sections or change how rules are written, like the whole "Situations A–F" thing, the "Limitations" bit, turning Expectation into a bulleted list, or writing test cases as prose instead of full HTML. What you've written is so fare removed from a valid ACT rules that I don't think we can do this with just inline comments on a pull request. This is all about the format. The ideas are a different story, and a bunch of them I like. Quick take on each: The "anything that functions as a heading" idea. I get the intent, but I think it makes the rule too complicated. It's really hard to say what has to be a heading. Usually the actual requirement is that content has a relationship, and a heading is one good way to do that but often not the only one. We can't just say "anything that looks like a heading". Sometimes a heading is a list item, sometimes it's a figcaption, sometimes a table caption, sometimes it's none of these and it should be. It's hard to say what an applicability like this means. If think this problem of "should it be a heading" is worth tackling, but I think that's done in a separate rule. Pulling content quality apart from other failures, the misleading-heading case, and the editorial-vs-accessibility line all seem reasonable. We just need a good spot for them. We usually do things like this through a definition, rather than a new section. That would be where I'd start. The one I'd push back on is making it subjective / human-only / test-to-pass. Rules should stay neutral on how they get tested. If a tool can do it, good on them, and full transparency, I'm building exactly that right now. Descriptiveness is something tools can test quite well these days. What I'd suggest: let's take the core problem, how much a heading should describe and where a section ends, and hash it out in a smaller PR first. We can look at what it means to be descriptive separately, and split the applicability idea into its own rule. Once we agree on direction the PR gets a lot easier to write. Let's discuss during an upcoming ACT call. |
| ### Applicability Type Designation | ||
|
|
||
| Each target element describes the topic or purpose of the first [perceivable content][] after the test target that is not [decorative][]. The order of elements is determined by the [flat tree][]. | ||
| Rule contains subjective applicability, depending on whether the target element should be considered a heading. | ||
|
|
There was a problem hiding this comment.
We can't just invent new sections to a rule. Can you explain why you felt we needed this documented? We don't document which expectation is subjective. I'm curious why you chose to do it for the applicability.
| ### Applicability Type Designation | |
| Each target element describes the topic or purpose of the first [perceivable content][] after the test target that is not [decorative][]. The order of elements is determined by the [flat tree][]. | |
| Rule contains subjective applicability, depending on whether the target element should be considered a heading. |
There was a problem hiding this comment.
I never intend to invent sections. I might have used an incorrect reference as this is my first ACT rule. I was following the directly-linked section of this document:
4.6.2.1. Applicability Type Designation (optional)
4.6.2.1. Applicability Type Designation (optional)
Composite rules can optionally include an applicability type identifier signifying whether the rule contains an objective or a subjective applicability. The applicability type of a composite rule is calculated as subjective if any of the input rules contain a subjective applicability or objective otherwise.
As we are now scoping Applicability strictly to semantic heading elements included in the accessibility tree (rather than visual-only headings), this sentence is not correct anymore: it was intended for images of text or code such as <p class="h1">Contact Us</p>.
Subjectivity section removed as requested.
| This `h1` element about the marketing content that follows is relevant. | ||
| ```html | ||
| <h1>Fresh deals just dropped: Printers</h1> | ||
| <div class="carousel" aria-label="Fresh deals"> |
There was a problem hiding this comment.
Maybe use article? You can't put aria-label on a div.
| <div class="carousel" aria-label="Fresh deals"> | |
| <article class="carousel" aria-label="Fresh deals"> |
There was a problem hiding this comment.
<div> is now <article> Sorry for the incorrect usage.
| <div class="carousel" aria-label="Fresh deals"> | ||
| <div class="carousel-slides"> | ||
| <div class="slide active"> | ||
| <img src="printer1.jpg" alt="Compact All-in-One Laser Printer"> |
There was a problem hiding this comment.
We're going to need to find images to put here. Something under a creative commons license that allows us to use them. Realistic examples means real images I'm afraid.
There was a problem hiding this comment.
As for the printer images, finding real, loyalty free printer photos will be a challenge. I was planning to use simple icons.
- Will we have to provide attributes for each image creator?
- Will the carousel really work?
- Would you prefer that I find some simpler example?
Please check these out, they are not so good. They are from Pixabay
madartzgraphics-printer-1910685_1920.zip
There was a problem hiding this comment.
🤖 Simple icons are fine. No need for photos or attribution, and no carousel. A simpler example is fine too.
There was a problem hiding this comment.
I implemented a much simpler, AI-generated SVG solution that requires no assets or copyright notice. Icons are too primitive, but code for better icons would be unnecessarily lengthy.
There was a problem hiding this comment.
Thanks for all the examples. Some general notes before the line comments:
- With the applicability limited to semantic headings, examples with elements that only look like headings need to go, or move to Inapplicable.
- Descriptions should say why the example passes or fails in one sentence. Leave out hedges like "as long as the section content retains basic contextual relevance".
- You said there are more examples than we need. I agree, and I've suggested which ones to drop below. That would leave 10 passed, 8 failed and 3 inapplicable examples.
- Could you add a passed example with an eyebrow heading, where the eyebrow text is inside the heading? For example:
<h2><span class="eyebrow">Case study</span> How Acme cut support calls in half</h2>
<p>Acme replaced its phone menu with an online help centre and halved its call volume in a year.</p>Whether eyebrow text has to be inside the heading is a question for a different rule, so let's leave that out of this one.
This review was AI generated 🤖 and human reviewed.
| ``` | ||
|
|
||
| #### Passed Example 4 | ||
| This `h2` element acting as a structural identifier for sequential content sections is relevant, where the content that follows rarely alters whether it is relevant as long as an obvious misplacement is not observed. |
There was a problem hiding this comment.
Good example of when a numbered heading is enough. Can the description be simpler, something like: "This h2 element passes because a chapter number describes a chapter of a book."
This is the opening of chapter 4 of Alice's Adventures in Wonderland (public domain), so please credit it under acknowledgments > assets in the frontmatter, like other rules do. For example:
assets:
- Excerpt from Alice's Adventures in Wonderland by Lewis Carroll (1865), in the public domain.There was a problem hiding this comment.
Today, I am updating the examples only. I will try to do this once examples are done. I did not include the sections after examples yet, as I don't know how to handle it.
|
|
||
| #### Passed Example 3 | ||
| #### Passed Example 5 | ||
| This `h3` element used as a generic section heading is relevant, as long as the section content retains basic contextual relevance. |
There was a problem hiding this comment.
Please drop the "as long as ..." part. Same for Passed Example 6.
| ``` | ||
|
|
||
| #### Passed Example 7 | ||
| This `h1` element is relevant to the page content despite exhibiting another WCAG failure for having a severely low contrast ratio. |
There was a problem hiding this comment.
The contrast problem doesn't tell us anything about this rule. I'd remove this example.
There was a problem hiding this comment.
Example removed. Yes, it would be confusing.
|
|
||
| #### Passed Example 4 | ||
| #### Passed Example 8 | ||
| This `p` element styled as a heading is relevant to the section content, despite failing other WCAG criteria due to using changes in text presentation without using the appropriate markup and utilizing an invalid ARIA value. |
There was a problem hiding this comment.
A p element with an invalid role isn't a semantic heading, so it's out of scope with the applicability we have. Please remove this example.
There was a problem hiding this comment.
Example removed. I understand WCAG does not want to include bad practices (such as non-existent roles) in passed examples.
|
|
||
| This `h1` heading element has a single character text that describes the topic of the following description list. | ||
| #### Passed Example 9 | ||
| This `h1` element is relevant to the purpose of the page content, despite being overly casual and unnecessarily verbose. |
There was a problem hiding this comment.
Good one: a heading doesn't have to be well written to describe the content. Passed Examples 10 and 11 show much the same thing, so I'd keep this one and drop those two. Also, there's a trailing space at the end of the line.
There was a problem hiding this comment.
Thanks. Former 11 removed. Please see the comment for "Travel Advisories and Travel Advisory Information".
|
|
||
| #### Failed Example 3 | ||
| #### Failed Example 5 | ||
| This `img` element displaying an image of text that visually acts like a heading is not relevant because "Page 1" as a heading lacks any topic-specific descriptor for the content that follows, despite passing other applicable WCAG criteria. |
There was a problem hiding this comment.
An img isn't a semantic heading, so this one is out of scope with the applicability we have. I'd remove it.
There was a problem hiding this comment.
I converted the img element into an h1 and edited the description accordingly.
| #### Failed Example 9 | ||
| This `h3` element is not relevant to the section as the text it contains cannot be reliably interpreted to understand what the following emails and phone numbers are for. | ||
| ```html | ||
| <h3>ortcontact Custo</h3> |
There was a problem hiding this comment.
Good pair with Passed Example 16. There's an empty line at the end of the code block that can go.
| ``` | ||
|
|
||
| #### Failed Example 10 | ||
| This `h3` element is not relevant as it contains the former placeholder text at the beginning of the heading. |
There was a problem hiding this comment.
This conflicts with Passed Example 17: both are leftover text plus the real heading, and one passes while the other fails. The heading does end with "Contact Customer Support", which describes the content, so I'm not sure this should fail. I'd remove it (and 17). Also, "Righ" should be "Right".
There was a problem hiding this comment.
Removed.
There is failed example 1 that already shows forgotten placeholder text. I forgot it, sorry for repetition.
|
|
||
| There is no heading. | ||
|
|
||
| This snippet is inapplicable because the page contains no headings, explicit heading roles, visual heading styles, or images of text acting as headings. |
There was a problem hiding this comment.
With the applicability back to semantic headings, this can just say there's no heading.
| This snippet is inapplicable because the page contains no headings, explicit heading roles, visual heading styles, or images of text acting as headings. | |
| This rule is inapplicable because there is no semantic heading. |
Could you also add an inapplicable example of a heading that is not included in the accessibility tree, e.g. <h1 aria-hidden="true">Opening hours</h1>?
There was a problem hiding this comment.
I made the edit as "This rule is inapplicable because there is no heading."
There was a problem hiding this comment.
I still argue that making <h1 aria-hidden="true">Opening hours</h1> out of scope is at least controversial, as sighted users are directly impacted, while screen reader users will not be aware of these headings at all. Is this rule for screen reader users only?
There was a problem hiding this comment.
🤖 You're right not to add it, but for a different reason. Inapplicable examples still need to meet the accessibility requirements the rule maps to. An aria-hidden heading is out of scope for this rule not because it's fine, but because it fails somewhere else (1.3.1). Whether it also passes 2.4.6 is debatable. That makes it a good boundary example, which is what @dan-tripp-siteimprove is working on in #2185, rather than an inapplicable example here.
Co-authored-by: Wilco Fiers <WilcoFiers@users.noreply.github.com>
Some examples removed, some improved, corrections made
Updated HTML structure for carousel example in heading rules.
Added passed example 12 for h2 element with eyebrow label as requested.
Changed as Wilco requested
Added definitions and links related to accessibility and semantic roles.
Removed subjective applicability section from the rule as requested.
grifare
left a comment
There was a problem hiding this comment.
Addressed review comments and updated examples
| This `h1` element about the marketing content that follows is relevant. | ||
| ```html | ||
| <h1>Fresh deals just dropped: Printers</h1> | ||
| <div class="carousel" aria-label="Fresh deals"> |
There was a problem hiding this comment.
<div> is now <article> Sorry for the incorrect usage.
| <div class="carousel" aria-label="Fresh deals"> | ||
| <div class="carousel-slides"> | ||
| <div class="slide active"> | ||
| <img src="printer1.jpg" alt="Compact All-in-One Laser Printer"> |
There was a problem hiding this comment.
As for the printer images, finding real, loyalty free printer photos will be a challenge. I was planning to use simple icons.
- Will we have to provide attributes for each image creator?
- Will the carousel really work?
- Would you prefer that I find some simpler example?
Please check these out, they are not so good. They are from Pixabay
madartzgraphics-printer-1910685_1920.zip
| ``` | ||
|
|
||
| #### Passed Example 4 | ||
| This `h2` element acting as a structural identifier for sequential content sections is relevant, where the content that follows rarely alters whether it is relevant as long as an obvious misplacement is not observed. |
There was a problem hiding this comment.
Today, I am updating the examples only. I will try to do this once examples are done. I did not include the sections after examples yet, as I don't know how to handle it.
|
|
||
| #### Passed Example 3 | ||
| #### Passed Example 5 | ||
| This `h3` element used as a generic section heading is relevant, as long as the section content retains basic contextual relevance. |
| ``` | ||
|
|
||
| #### Passed Example 7 | ||
| This `h1` element is relevant to the page content despite exhibiting another WCAG failure for having a severely low contrast ratio. |
There was a problem hiding this comment.
Example removed. Yes, it would be confusing.
|
|
||
| There is no heading. | ||
|
|
||
| This snippet is inapplicable because the page contains no headings, explicit heading roles, visual heading styles, or images of text acting as headings. |
There was a problem hiding this comment.
I still argue that making <h1 aria-hidden="true">Opening hours</h1> out of scope is at least controversial, as sighted users are directly impacted, while screen reader users will not be aware of these headings at all. Is this rule for screen reader users only?
| ### Applicability Type Designation | ||
|
|
||
| Each target element describes the topic or purpose of the first [perceivable content][] after the test target that is not [decorative][]. The order of elements is determined by the [flat tree][]. | ||
| Rule contains subjective applicability, depending on whether the target element should be considered a heading. | ||
|
|
There was a problem hiding this comment.
I never intend to invent sections. I might have used an incorrect reference as this is my first ACT rule. I was following the directly-linked section of this document:
4.6.2.1. Applicability Type Designation (optional)
4.6.2.1. Applicability Type Designation (optional)
Composite rules can optionally include an applicability type identifier signifying whether the rule contains an objective or a subjective applicability. The applicability type of a composite rule is calculated as subjective if any of the input rules contain a subjective applicability or objective otherwise.
As we are now scoping Applicability strictly to semantic heading elements included in the accessibility tree (rather than visual-only headings), this sentence is not correct anymore: it was intended for images of text or code such as <p class="h1">Contact Us</p>.
Subjectivity section removed as requested.
List of requests and actions taken:
Currently there are 12 passed, 9 failed and 2 inapplicable examples.
|
img element replaced with h1
Co-authored-by: Wilco Fiers <WilcoFiers@users.noreply.github.com>
|
🤖 Thanks, this is much better. I've answered in the threads. On the two-sentence failed descriptions: in Failed 1, 2, 3 and 7 the second sentence repeats the first. One is enough, e.g.:
After that I think the examples are done, and we can look at the sections after them. |
Right, they are better as single-sentence descriptions. How do you like these longer versions that are more explanatory without using a second sentence?
Please note that these have not been edited in the file yet. |
Applicability text edited, PASS 2 now uses icons with no carousel
Clarified applicability of the rule regarding heading elements, including those not semantically defined as headings.
|
|
||
| #### Failed Example 7 | ||
|
|
||
| This `h2` element misrepresents the operational direction of a financial transaction. The heading text is not relevant, as it explicitly contradicts the functional purpose of the content it introduces. |
There was a problem hiding this comment.
| This `h2` element misrepresents the operational direction of a financial transaction. The heading text is not relevant, as it explicitly contradicts the functional purpose of the content it introduces. | |
| This `h2` element is not relevant because it says "Request Money" above a form for sending money. |
🤖 AI-generated, reviewed by me.
There was a problem hiding this comment.
In the version you suggested, I think the reasoning is not explanatory enough. It does not explicitly include what is wrong, it repeats the text in the code.
Can we use this instead?
This h2 element is not relevant because it states the opposite of the transaction the form below will perform.
I made the edit using the sentence above, you can approve or open it again.
Co-authored-by: Wilco Fiers <WilcoFiers@users.noreply.github.com>
Co-authored-by: Wilco Fiers <WilcoFiers@users.noreply.github.com>
Co-authored-by: Wilco Fiers <WilcoFiers@users.noreply.github.com>
Simplified the description
Co-authored-by: Wilco Fiers <WilcoFiers@users.noreply.github.com>
Co-authored-by: Wilco Fiers <WilcoFiers@users.noreply.github.com>
|
I simply pressed the "Apply suggestion" buttons for everything, except for Failed 7. After all, you have better know-how about the structure of these intro sections. I assume you can always include something to mean |
<< Describe the changes >>
Closes issue(s):
Need for Call for Review:
<< choose one of the following and remove the rest >>
<< check Process Document on Call for Review >>
This can be merged with 1 approval << choose reason: editorial changes to website/test code, adding new contributor, other (explain). >>
This will not require a Call for Review << choose reason(s): editorial changes (including to the applicability, expectation or examples section), changes to assumptions, background, accessibility support, change to website/test code (not rule), other (explain). >>
This will require a 1 week Call for Review << small changes affecting a small number of examples, if in doubt do not use this. >>
This will require a 2 weeks Call for Review << new rule, or substantial changes affecting a large number of examples, if in doubt, use this. >>
Pull Request Etiquette
When creating PR:
developbranch (left side).After creating PR:
Rule,DefinitionorChore.When merging a PR:
How to Review And Approve