Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
285 changes: 285 additions & 0 deletions _rules/content-present-reflow-sc9kkf
Original file line number Diff line number Diff line change
@@ -0,0 +1,285 @@
---
id: sc9kkf
name: Content is not missing at 320 CSS pixels
rules_format: 1.1
rule_type: atomic
description: |
This rule checks content is not missing when the viewport is set to 320 CSS pixels in the orientation of the text.
accessibility_requirements:
wcag21:1.4.10: # Reflow (AA)
forConformance: true
failed: not satisfied
passed: further testing needed
inapplicable: further testing needed
input_aspects:
- DOM Tree
- CSS Styling
acknowledgments:
authors:
- Helen Burge
previous_authors:
-
---

## Applicability

This rule applies to any element containing visible content or functional components. It is rendered when the viewport is set to 320 CSS pixels in the orientation of the text.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I would encourage following the wording of the requirement.

As described in the understanding doc:

This criterion requires non-excepted sections of content that are written in horizontal languages reflow when narrowed to a width equivalent to 320 CSS pixels. Similarly, sections of content that are written in vertical languages (which are not as commonly used on the web and so will be used much less frequently in examples) need to be able to reflow when rendered at a height equivalent to 256 CSS pixels.

the orientation of the text is relevant in determining the applicable requirement. As currently written, the text appears to imply that the requirement is always 320 CSS pixels, even for vertically oriented content, which is inconsistent with the criterion.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We can refine the applicability even further. For example, it could apply only to visible content with:

  • a height of at least 320 CSS pixels on pages with vertical scrolling
  • a height of at least 256 CSS pixels on pages with horizontal scrolling

This would align the applicability more closely with the corresponding reflow requirements

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It is rendered when the viewport is set to 320 CSS pixels in the orientation of the text.

the current wording implies that if the content is hidden at 320 CSS pixels, the rule is not applicable, which isn't our intent


## Expectation (1)

Each target element:
Retains all content and functionality when viewed at 320 CSS pixels; and
- Does not hide, remove, or make content unavailable as a result of viewport constraints, zoom, or responsive behaviour; and

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'd say this is ambiguous. For example, a navigation menu that is expanded by default on desktop but programmatically hidden on mobile until the user activates the hamburger menu could be interpreted as violating this requirement. I think we need more precise wording than "hide" to avoid unintentionally including these common responsive design patterns

- Ensures that any content that is visually hidden at this viewport size is still programmatically available and accessible to users.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

With the examples that you included that always hide content, I feel like we may need to define a way to compare before and after. For example, should we compare content at 1280 vs 320?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'd agree with @G0dwin. We first need to define the default view

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

1.4.10 is fundamentally a visual requirement. While we as ACT CG don't necessarily need to cover every aspect of the SC, marking this as a pass seems risky to me. The fact that the content remains programmatically available does not help people who need to zoom or reflow the page to access it visually. From a user's perspective, the content is still effectively unavailable.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Also, in the first bullet we are saying not to hide or remove the content, whereas here we're saying that content that cannot be hidden (and is visually hidden) is programmatically available. I understand that the intent (even though I don't agree) is for the first bullet to cover programmatically hidden content and the second to cover only visually hidden content. However, that distinction isn't clear from the current wording


## Background

This rule supports WCAG 2.1 Success Criterion 1.4.10 Reflow, which requires that content be presented without loss of information or functionality at a width equivalent to 320 CSS pixels. When content is missing at smaller viewport sizes, users may lose access to essential information or controls, even if the layout appears functional. Responsive design should reposition or adapt content, not remove it entirely, unless an equivalent mechanism provides access.

### Assumptions

There are no assumptions.

### Accessibility Support

There are no accessibility support issues known.

## Examples

### Passed

#### Passed Example 1

Content reflows but remains fully available.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Content reflows but remains fully available.
Content remains fully available after reflow.

My feeling is that the use of "but" gives the sentence a negative tone


```html
<div style="max-width: 100%;">
<p>
All text content remains visible and accessible when the viewport is reduced.
</p>
</div>
```

#### Passed Example 2

Navigation collapses into a menu but remains accessible. Content is not removed, only hidden behind an accessible control.

```html
<button aria-expanded="false">Menu</button>
<nav hidden>
<ul>
<li>Home</li>
<li>About</li>
<li>Contact</li>
</ul>
</nav>
```
Comment on lines +63 to +76

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

IMO, this doesn't fully reflect the expectation. I agree with the example and that it should be a pass, but it doesn't align particularly well with the wording of the expectation


#### Passed Example 3

Content is visually hidden but remains available programmatically.

```html
<p class="visually-hidden">
Additional instructions available to screen reader users.
</p>
```
Comment on lines +78 to +86

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

1.4.10 is fundamentally a visual requirement. While we as ACT CG don't necessarily need to cover every aspect of the SC, marking this as a pass seems risky to me. The fact that the content remains programmatically available does not help people who need to zoom or reflow the page to access it visually. From a user's perspective, the content is still effectively unavailable.


#### Passed Example 4

Content is moved in the layout but still present.

```html
<style>
.sidebar {
order: 2;
}
</style>
Comment on lines +93 to +97

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't think this works in practice unless the element is inside a flex or grid container

<div class="sidebar">
<p>Sidebar content is still available, just repositioned.</p>
</div>
```

#### Passed Example 5

Accordion reveals content without removing it.

```html
<button aria-expanded="false">Show details</button>
<div hidden>
<p>Additional content remains available when expanded.</p>
</div>
```
Comment on lines +105 to +112

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same as example 2


#### Passed Example 6

Images resize but are still visible.

```html
<img src="example.jpg" style="max-width: 100%;">
```

#### Passed Example 7

Form fields collapse but remain accessible.

```html
<form>
<label for="name">Name</label>
<input id="name" type="text">
</form>
```
Comment on lines +122 to +131

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Unclear


#### Passed Example 8

Content requiring two-dimensional layout (covered under reflow exceptions).

```html
<table>
<tr><th>Column</th><th>Column</th></tr>
</table>
```
Comment on lines +135 to +141

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I see the 1.4.10 exception, but I don't see any exception for this in our rule


### Failed

#### Failed Example 1

Content removed at smaller viewport.

```html
<style>
@media (max-width: 400px) {
.important-content {
display: none;
}
}
</style>
<div class="important-content">
This content disappears on smaller screens.
</div>
```

#### Failed Example 2

Navigation items removed instead of adapted.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This looks like a repetition of the first example. Does this add or clarify something that the first example doesn't cover?


```html
<style>
@media (max-width: 400px) {
nav li:nth-child(n+3) {
display: none;
}
}
</style>
<nav>
<ul>
<li>Home</li>
<li>About</li>
<li>Services</li>
<li>Contact</li>
</ul>
</nav>
```

#### Failed Example 3

Content visually clipped and inaccessible.

```html
<div style="height: 50px; overflow: hidden;">
<p>
Important content is hidden and cannot be accessed or revealed.
</p>
</div>
```

#### Failed Example 4

Content moved off-screen and not reachable.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It looks to me like this content would not be available at any viewport size, this is also a common valid technique for applying text only available to AT.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yes, we need a default state where this is available. In any case, this also seems to contradict the expectation


```html
<div style="position: absolute; left: -9999px;">
Hidden content that cannot be accessed by users.
</div>
```

#### Failed Example 5

Interactive element missing at smaller viewport.

```html
<style>
@media (max-width: 400px) {
button {
display: none;
}
}
</style>
<button>Submit</button>
```

#### Failed Example 6

Image removed without alternative.

```html
<style>
@media (max-width: 400px) {
img {
display: none;
}
}
</style>
<img src="important-diagram.png" alt="Important diagram">
```

#### Failed Example 7

Collapsed content has no mechanism to access it.

```html
<div style="display: none;">
<p>This content is permanently hidden.</p>
</div>
```

### Inapplicable

#### Inapplicable Example 1

Decorative content.

```html
<div role="presentation">
Decorative content only.
</div>
```
Comment on lines +252 to +256

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There is no mention of decorative content in either the SC or this rule. As written, this cannot be marked as inapplicable. Also, even if we decide to move in that direction (and I'm not convinced we should), I would replace the text with a decorative image, since the concept of "decorative text" is debatable


#### Inapplicable Example 2

Content explicitly hidden from all users.

```html
<div hidden>
Hidden content not intended for display.
</div>
```

#### Inapplicable Example 3

Content outside the user viewport by design (e.g. off-canvas patterns before interaction).

```html
<div aria-hidden="true" class="offscreen-menu">
Menu content appears only when activated.
</div>
```

#### Inapplicable Example 4

Content that is replaced by an equivalent alternative. The full content is replaced with an equivalent that preserves meaning.

```html
<p class="mobile">Short summary version</p>
<p class="desktop">Full detailed version</p>
```
Comment on lines +278 to +285

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There is no mention of alternative in this rule. As written, this cannot be marked as inapplicable.

Loading