Skip to content

Create content-present-reflow-sc9kkf - #2445

Open
WilcoFiers wants to merge 8 commits into
developfrom
content-present-reflow-sc9kkf
Open

WilcoFiers wants to merge 8 commits into
developfrom
content-present-reflow-sc9kkf

Conversation

@WilcoFiers

@WilcoFiers WilcoFiers commented Aug 31, 2026 •

Copy link
Copy Markdown
Member

First draft of the content-present-reflow rule: content is not missing at 320 CSS pixels.

Split from #2429 so each reflow rule can be reviewed independently. Original work by @HelenBurge.

Related to #2424.

Need for Call for Review:
This will require a 2 weeks Call for Review


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".
  • If your PR is for a new rule with an Accessibility Support note, or for updating the Accessibility Support note of an existing section, make sure to open a corresponding Accessibility Support issue.

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 Call for Review period. In case of disagreement, the longer period wins.

Made with Cursor

Split from #2429. Original work by Helen Burge.

Co-authored-by: HelenBurge <41951878+HelenBurge@users.noreply.github.com>
@WilcoFiers WilcoFiers added the Rule Use this label for a new rule that does not exist already label Aug 31, 2026
@netlify

netlify Bot commented Aug 31, 2026 •

Copy link
Copy Markdown

❌ Deploy Preview for act-rules failed.

Name Link
🔨 Latest commit 90d1e98
🔍 Latest deploy log https://app.netlify.com/projects/act-rules/deploys/6afdb808f123d7bb07a93977

@WilcoFiers WilcoFiers mentioned this pull request Aug 31, 2026
8 tasks
@HelenBurge
HelenBurge marked this pull request as ready for review September 3, 2026 13:03

@WilcoFiers WilcoFiers left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I stopped after the expectation. Plenty to do already. I can't request changes since this is my own PR.

Comment thread _rules/content-present-reflow-sc9kkf Resolved
Comment thread _rules/content-present-reflow-sc9kkf Resolved
Comment thread _rules/content-present-reflow-sc9kkf.md Outdated
Comment on lines +30 to +32
Each target element:

Retains all content and functionality when viewed with a height of at least 320 CSS pixels on pages with vertical scrolling, or a height of at least 256 CSS pixels on pages with horizontal scrolling:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This doesn't exactly follow how to write an ACT rule. I'd do something like this:

Suggested change
Each target element:
Retains all content and functionality when viewed with a height of at least 320 CSS pixels on pages with vertical scrolling, or a height of at least 256 CSS pixels on pages with horizontal scrolling:
For each target element, when the viewport is set to 320 by 256 CSS pixels, the content is not cut off, removed, or obscured by another element, except if one of the following is true:
- the hidden content can be scrolled into view, or
- an [instrument][] is available to reveal the content.

I think you're throwing far too much at the wall here hoping to find issues.

  1. First you say things can't be cut off, and then you follow it up by saying it can if you can scroll it into view.
  2. "unavailable as a result of viewport constraints, zoom, or responsive behaviour;" what are these things, and how do I test them? I know at least 3 different zoom methods, which ones do you mean? I think this can be cut.

Comment thread _rules/content-present-reflow-sc9kkf.md Resolved
Comment thread _rules/content-present-reflow-sc9kkf.md Resolved
HelenBurge and others added 2 commits September 17, 2026 15:39
Co-authored-by: Wilco Fiers <WilcoFiers@users.noreply.github.com>
Comment thread _rules/content-present-reflow-sc9kkf.md Resolved
Comment thread _rules/content-present-reflow-sc9kkf.md Outdated

## Applicability

Starting from a baseline mid-range desktop resolution of 1280 x 1024 pixels, this rule requires content to scale cleanly down to smaller viewports without forcing users to scroll in two dimensions. It applies to any element containing visible content or functional components that excludes components that inherently require a two-dimensional layout to be understood. When scaling down to a width of 320 CSS pixels for horizontal languages (or a height of 256 CSS pixels for vertical languages, equivalent to 400% browser zoom), content must smoothly reflow.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This isn't really an applicability. An applicability should tell you what to test. You're essentially re-stating the requirement here. The first and last sentence are more an explanation of the requirement, and then having the rule apply just about every element doesn't seem like it would work well to me.

I think you may want to narrow down the scope to content that is visible in the wide view, and hidden in the narrow view. I'd apply this directly to the content, not to containers. We'll need to come up with a better definition of content too, that skips decorative stuff

This rule applies to any HTML [content][] that is [visible][] in a [viewport] of 1280 by 1024 [CSS pixels][], and not [visible][] in a viewport of 320 by 256 CSS pixels.

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.

@WilcoFiers - have a look

@Pryzmastudio

Copy link
Copy Markdown

Following up on my reflow data for #2446, I went through this draft's examples too. floorcheck only checks for sideways scrolling, so it has nothing to say here. Instead I measured each example in Chrome 156 at 1280×1024 and at 320×256, which is the comparison Wilco suggested for the applicability.

1. Wilco's applicability works for most failed examples and shows two that don't fit. Failed Examples 1, 2, 5 and 6 are visible at 1280×1024 and gone at 320×256, as intended. Failed Example 4 (left: -9999px) and Failed Example 7 (display: none) are hidden at both sizes, so they would become inapplicable. Failed Example 7 then renders exactly like Inapplicable Example 1 (the hidden attribute is also display: none), and right now the two have opposite outcomes.

2. Failed Example 3 doesn't cut off any text. At 320×256 the paragraph wraps to two lines and its line box ends at 60px, while the div clips at 58px. Those 2px are below the descenders: I rendered it again without the clipping and found no text pixels below the edge. With height: 40px the second line is clearly cut at 320 and the paragraph still fits on one line at 1280.

3. A few examples are missing the CSS they describe.

  • Passed Example 3 uses class="visually-hidden", but the class isn't defined, so the paragraph is plain visible text. If it's defined the common way (positioned off-screen or clipped to 1px), it becomes the same technique as Failed Example 4, and a pass and a fail would share one pattern.
  • Inapplicable Example 2 relies on aria-hidden="true", which doesn't hide anything on screen. With no CSS for .offscreen-menu the text shows at both sizes, so as written the example is applicable.
  • Smaller things: example.jpg in Passed Example 5 doesn't exist, so the image renders at 0×0 and there's nothing to test (an image from the test assets folder would fix that). order: 2 in Passed Example 4 has no effect without a flex or grid parent, and Passed Example 6 has no accordion, only a label and an input.

Happy to rerun these whenever the examples change.

I used an AI assistant to help run the checks and draft this comment. I verified the results myself.

@Pryzmastudio Pryzmastudio mentioned this pull request Nov 4, 2026
2 of 8 tasks
@Pryzmastudio

Copy link
Copy Markdown

I reran the examples against the new applicability (commit 90d1e98) in Chrome 157, Firefox 157 and WebKit 27.2. For "visible" I used the ACT definition: making the content transparent changes pixels in the viewport or in what can be scrolled into it. The three browsers agree on every example.

1. Failed examples. 1, 2, 5 and 6 are applicable: their content is visible at 1280×1024 and not visible at 320×256. The other three are inapplicable with the new wording:

  • Failed Example 4 and 7 are not visible at either size. Failed Example 7 still renders the same as Inapplicable Example 1.
  • Failed Example 3 is visible at both sizes. Text that is cut off stays partly visible, so it will not match "not visible" whatever the height is. Clipping may fit better in the draft about clipped text (Create text-cutoff-reflow-lf4ym8 #2447).

2. Passed examples. None of the eight has content that is visible at 1280×1024 and not visible at 320×256, so all eight are inapplicable now.

  • In Passed Example 1, 3, 4, 6 and 7 everything is visible at both sizes.
  • In Passed Example 2 the nav has the hidden attribute and there is no media query, so the links are not visible at either size.
  • Passed Example 5 still points at example.jpg, which renders at 0×0.

A passed example for this applicability needs content that goes away at 320 and an instrument that brings it back. This one does that in all three browsers: the links are visible at 1280×1024, not visible at 320×256, and visible again after the button is pressed.

<style>
  #menu-button { display: none; }
  @media (max-width: 320px) {
    #menu-button { display: inline-block; }
    nav:not(.open) { display: none; }
  }
</style>
<button id="menu-button" aria-expanded="false" aria-controls="menu">Menu</button>
<nav id="menu">
  <ul>
    <li><a href="#home">Home</a></li>
    <li><a href="#about">About</a></li>
    <li><a href="#contact">Contact</a></li>
  </ul>
</nav>
<script>
  const button = document.getElementById('menu-button');
  button.addEventListener('click', () => {
    const open = document.getElementById('menu').classList.toggle('open');
    button.setAttribute('aria-expanded', String(open));
  });
</script>

3. The first exception cannot be reached. By the definition of visible, content that can be scrolled into view is visible, so it is never a target. Passed Example 8 shows it: the code is visible at both sizes. Its max-width: 320px also applies at 1280, so the block scrolls the same way at both.

4. Smaller things. Passed Example 3 now has a visible link, but the description still says the content is visually hidden. Inapplicable Example 2 is inapplicable with the new wording, though for another reason than it gives: .offscreen-menu has no CSS, so the text is visible at both sizes.

I used an AI assistant to help run the checks and draft this comment. I verified the results myself.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

3 participants