Repository navigation
Create content-present-reflow-sc9kkf - #2445
WilcoFiers wants to merge 8 commits into
Conversation
Split from #2429. Original work by Helen Burge. Co-authored-by: HelenBurge <41951878+HelenBurge@users.noreply.github.com>
❌ Deploy Preview for act-rules failed.
|
WilcoFiers
left a comment
There was a problem hiding this comment.
I stopped after the expectation. Plenty to do already. I can't request changes since this is my own PR.
| 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: |
There was a problem hiding this comment.
This doesn't exactly follow how to write an ACT rule. I'd do something like this:
| 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.
- 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.
- "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.
Co-authored-by: Wilco Fiers <WilcoFiers@users.noreply.github.com>
|
|
||
| ## 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. |
There was a problem hiding this comment.
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.
|
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 ( 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 3. A few examples are missing the CSS they describe.
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. |
|
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:
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.
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 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: I used an AI assistant to help run the checks and draft this comment. I verified the results myself. |
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:
developbranch (left side).After creating PR:
Rule,DefinitionorChore.When merging a PR:
How to Review And Approve
Made with Cursor