Skip to content

Commit 1736b7b

Browse files
scottaoharadbjorgefstrrgiacomo-petripatrickhlauke
authored
Updated Reflow understanding doc (#4055)
This initial commit takes the current draft from the google doc that had been worked on for quite some time now, and makes it into a PR for further editing and review. Not all feedback from the google doc was directly taken/addressed, but there have been additional changes made that attempted to consider a good portion of the unresolved comments. Marking this PR as a draft, as there is still work to do (and I also need to upload all the new graphics for the examples - and a few examples still need to be created, which are currently marked as comments in the HTML file). - [x] identify all the reflow related issues this PR will close or address in some form (see: [this comment](#4055 (comment))) - there are others, but this lists at least references all the ones that were considered while working on this PR. - [x] add all the new graphics to this PR / render properly (further revisions can be made if people would like different/more consistent examples - but as of now at least all examples for this pr have been created) - [x] follow on issue for [creating more examples/techniques](#4236) [The latest updates will be visible via this preview link of the understanding doc](https://deploy-preview-4055--wcag2.netlify.app/understanding/reflow) Closes #3121 --------- Co-authored-by: Dan Bjorge <[email protected]> Co-authored-by: Francis Storr <[email protected]> Co-authored-by: Giacomo Petri <[email protected]> Co-authored-by: Patrick H. Lauke <[email protected]> Co-authored-by: Mike Gower <[email protected]> Co-authored-by: Alastair Campbell <[email protected]> Co-authored-by: Mike Gower <[email protected]> Co-authored-by: Adam Page <[email protected]> Co-authored-by: Kenneth G. Franqueiro <[email protected]>
1 parent ba16a3c commit 1736b7b

27 files changed

+1130
-46
lines changed

techniques/general/G224.html

+189
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
<!DOCTYPE html>
2+
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
3+
<head>
4+
<title>Accounting for meaningful text indentation and Reflow</title>
5+
<link rel="stylesheet" href="../../css/sources.css" class="remove"/>
6+
</head>
7+
<body>
8+
<h1>Accounting for meaningful text indentation and Reflow</h1>
9+
<section class="meta"><p class="id">ID: G224</p><p class="technology">Technology: general</p><p class="type">Type: Technique</p></section>
10+
<section id="applicability">
11+
<h2>When to Use</h2>
12+
<p>All technologies that support style switching</p>
13+
</section>
14+
15+
<section id="description">
16+
<h2>Description</h2>
17+
<p>There can be instances where indentation of text is considered important to the presentation and understandability of the text content. If the indentations were to be removed, then meaning or functionality could suffer. For instance, the nesting of unordered lists can be harder to notice if indentations are removed. Additionally, maintaining indentations can be important to help understand code patterns, if not even necessary for the code to function.</p>
18+
<p>Since maintaining indentation is important for these instances of text, two-dimensional scrolling of these distinct sections of content could be necessary. However, there are still styling modifications that could be made to help ensure the indentation was maintained, but as much text was made visible within the viewport as possible. Making such adjustments could limit, if not mitigate any two-dimensional scrolling from occurring, making the content easier for people to read.</p>
19+
</div>
20+
</section>
21+
22+
<section id="examples">
23+
<h2>Examples</h2>
24+
<section class="example">
25+
<p>A website conveys information in a nested list format. The understandability of the list hierarchy is supported by the indentation of the list content. While it is important for the individual list item text to reflow, the list hierarchy would suffer if flattened so that all content would fit within a 320 CSS pixel wide viewport.</p>
26+
<p>The following example list contains additional nested lists to provide more context for each of the parent list item's text. To maintain the visual hierarchy, the indentation of each list level remains present, but modified once an author defined CSS breakpoint is met. Additional styles are set for different breakpoints to mitigate against the potential for content to extend beyond a 320px wide viewport, while accounting for visual spacing against the borders of the viewport, to attempt to make the content not feel cramped. At the smallest breakpoint, the content of list items receive a minimum width to mitigate against potentially "squished" content lists with many nested levels. At this breakpoint, each nested list level can be horizontally scrolled into view, and once a nested list is visible within the viewport, only vertical scrolling will be necessary to read the content of the nested list's items.</p>
27+
<pre>
28+
&lt;div class="example">
29+
&lt;ul>
30+
&lt;li>
31+
&lt;p>Make a list using one of the HTML list elements, or even an ARIA &lt;code>role=list&lt;/code> container.&lt;/p>
32+
&lt;ul>
33+
&lt;li>
34+
&lt;p>There are three types of lists in HTML which can contain list items (&lt;code>li&lt;/code> elements.&lt;/p>
35+
&lt;ul>
36+
&lt;li>&lt;p>the &lt;code>ul&lt;/code> element&lt;/li>
37+
&lt;li>&lt;p>the &lt;code>ol&lt;/code> element&lt;/li>
38+
&lt;li>&lt;p>the &lt;code>menu&lt;/code> element&lt;/li>
39+
&lt;/ul>
40+
&lt;/li>
41+
&lt;li>
42+
&lt;p>Another type of list, description lists, exist as well - but they do not contain list items (&lt;code>li&lt;/code> elements).&lt;/p>
43+
&lt;/li>
44+
...
45+
&lt;/ul>
46+
&lt;/li>
47+
&lt;li>
48+
&lt;p>Neither the start or end tags of any of the HTML list elements are omissible.&lt;/p>
49+
&lt;ul>
50+
&lt;li>&lt;p>The end tags of &lt;code>li&lt;/code> elements can be omitted if the &lt;code>li&lt;/code> element is immeditely followed by another &lt;code>li&lt;/code> element or there is no more content in the parent list element.&lt;/p>
51+
&lt;/li>
52+
...
53+
&lt;/ul>
54+
&lt;/li>
55+
...
56+
&lt;/ul>
57+
&lt;/div>
58+
</pre>
59+
<pre>
60+
*, *::before, *::after {
61+
box-sizing: border-box;
62+
}
63+
body, html {
64+
font-family: arial;
65+
}
66+
@media screen and ( max-width: 640px ) {
67+
.example {
68+
overflow: auto;
69+
max-width: 640px;
70+
}
71+
ul {
72+
padding-inline-start: 1.25em;
73+
}
74+
li p {
75+
padding: .25em;
76+
margin: .5em 0 .5em -.25em;
77+
max-width: 300px; /* saftey net for max-width */
78+
}
79+
}
80+
@media screen and ( max-width: 400px ) {
81+
ul { padding-inline-start: 1em; }
82+
li p { min-width: 300px } {
83+
min-width: 300px;
84+
}
85+
}
86+
</pre>
87+
<p>A working example of <a href="../../working-examples/reflow-nested-lists">a list where nested levels can be read within a 320px wide viewport</a>.</p>
88+
</section>
89+
90+
<section class="example">
91+
<p>A website providing code snippets needs to maintain line indentations, as the indentations are meaningful not only to the structure of the code, but in some languages - such as with Python, are requirements when defining blocks of code.</p>
92+
<p>As a user zooms in the web page, the CSS of the indentation can be adjusted to maintain this necessary structure, while also allowing more text to be visible on a single line.</p>
93+
94+
<p>The following represents a Python code example. The indentation of each line of text is necessary to create a group of statements that are executed as a block.</p>
95+
<pre>
96+
def complex_function(x):
97+
if x > 0:
98+
for i in range(x):
99+
if i % 2 == 0:
100+
print(f"{i} is even")
101+
for a in range(i):
102+
if a % 5 == 0:
103+
print(f" {a} can be divided by 5")
104+
else:
105+
print(f" {a} cannot be divided by 5")
106+
else:
107+
print(f"{i} is odd")
108+
for a in range(i):
109+
if a % 2 == 0:
110+
print(f" {a} is even")
111+
else:
112+
print(f" {a} is odd")
113+
else:
114+
print("x is not a positive number")
115+
</pre>
116+
<p>The following code example demonstrates the use of indentation to convey the nesting of elements in an HTML document:</p>
117+
<pre>
118+
&lt;html lang=en>
119+
&lt;head>...&lt;/head>
120+
&lt;body>
121+
&lt;div>
122+
&lt;!-- ... keep indenting as necessary -->
123+
&lt;/div>
124+
&lt;/body>
125+
&lt;/html>
126+
</pre>
127+
<p>The indentation of code blocks like these could be adjusted at different viewport sizies, via a CSS Media Query.</p>
128+
<pre>
129+
@media screen and ( min-width: 320px ) {
130+
pre {
131+
tab-size: 8px;
132+
}
133+
}
134+
135+
@media screen and ( min-width: 640px ) {
136+
pre {
137+
tab-size: 16px;
138+
}
139+
}
140+
141+
@media screen and ( min-width: 1280px ) {
142+
pre {
143+
tab-size: 32px;
144+
}
145+
}
146+
</pre>
147+
<p>A working example of <a href="../../working-examples/reflow-indenting.html">code snippets using CSS to modigy indentation width at different breakpoints</a>.
148+
</section>
149+
</section>
150+
151+
<section id="tests">
152+
<h2>Tests</h2>
153+
<section class="procedure"><h3>Procedure for list example</h3>
154+
<ol>
155+
<li>Display the web page in a user agent where the page can be zoomed, or the user agent can be resized.</li>
156+
<li>Zoom in or resize the browser window so that the viewport is equivallent to 320 CSS pixels wide.</li>
157+
<li>The list content fits within the width so that it is only necessary so scroll vertically to read the list.</li>
158+
<li>Or, each nested list can be horizontally scrolled into view. Only vertical scrolling is necessary to read the content of list items within each specific nested list level.</li>
159+
</ol>
160+
</section>
161+
<section class="results"><h3>Expected Results</h3>
162+
<ul>
163+
<li>Checks 3 or 4 are true.</li>
164+
</ul>
165+
</section>
166+
167+
<section class="procedure"><h3>Procedure for code snippets</h3>
168+
<ol>
169+
<li>Display the web page in a user agent where the page can be zoomed, or the user agent can be resized.</li>
170+
<li>Zoom in or resize the browser window so that the viewport is equivallent to 320 CSS pixels wide.</li>
171+
<li>The code snippets fits within the width so that it is only necessary so scroll vertically to read each line of code.</li>
172+
<li>Or, for code where non-wrapping lines are not essential, the code wraps or a mechanism is provided to allow line wrapping.</li>
173+
<li>Or, the indentation and linebreaks are meaningful to the code language.
174+
</ol>
175+
</section>
176+
<section class="results"><h3>Expected Results</h3>
177+
<ul>
178+
<li>Checks #3, #4 or #5 are true.</li>
179+
</ul>
180+
</section>
181+
</section>
182+
<section id="related">
183+
<h2>Related Techniques</h2>
184+
<ul>
185+
<li><a href="../css/C20">C20</a></li>
186+
</ul>
187+
</section>
188+
</body>
189+
</html>

techniques/general/G225.html

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<!DOCTYPE html>
2+
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
3+
<head>
4+
<title>Section panels that scroll horizontally are designed to fit within a width of 320 CSS pixels on a vertically scrolling page</title>
5+
<link rel="stylesheet" type="text/css" href="../../css/sources.css" class="remove"/>
6+
</head>
7+
<body>
8+
<h1>Section panels that scroll horizontally are designed to fit within a width of 320 CSS pixels on a vertically scrolling page</h1>
9+
<section class="meta">
10+
<p class="id">ID: G225</p>
11+
<p class="technology">Technology: general</p>
12+
<p class="type">Type: Technique</p>
13+
</section>
14+
<section id="applicability">
15+
<h2>When to Use</h2>
16+
<p>All technologies.</p>
17+
</section>
18+
<section id="description">
19+
<h2>Description</h2>
20+
<p>The objective of this technique is to ensure that users can zoom in on text within a horizontally scrolling section, while not requiring horizontal scrolling to read the content of each individual panel. Although the entire section requires horizontal scrolling to navigate between panels, each panel is designed to fit within a fixed width of 320 CSS pixels. This ensures that when a 320 CSS pixel wide viewport is used, and the card is in the viewport, each card will remain fully visible without the need for additional horizontal scrolling to read its content.</p>
21+
</section>
22+
<section id="examples">
23+
<h2>Examples</h2>
24+
<section class="example">
25+
<h3>A product carousel</h3>
26+
<p>The homepage of an online retail website includes several informational sections, some of which feature carousels showcasing highlighted products. These carousels require horizontal scrolling and have a computed height greater than 256 CSS pixels. Each panel is 320 CSS pixels wide, allowing users to see the full width of the card without horizontal scrolling. Consequently, users only need to scroll vertically to view the entire card, ensuring compliance with success criterion 1.4.10 Reflow for that section.</p>
27+
<p>Working example: <a href="../../working-examples/reflow-carousel-panel-horizontal-scroll/">Carousel panels that scroll horizontally are designed to fit within a width of 320 CSS pixels on a vertically scrolling page</a>.
28+
</section>
29+
</section>
30+
<section id="tests">
31+
<h2>Tests</h2>
32+
<section class="procedure">
33+
<h3>Procedure</h3>
34+
<ol>
35+
<li>Check that the layout includes sections of content that scroll horizontally within a vertically scrolling page.</li>
36+
<li>Check that each horizontally scrolling section is divided into distinct panels.</li>
37+
<li>Open the webpage in a user agent that supports 400% zoom, setting the viewport dimensions to 1280 CSS pixels in width.</li>
38+
<li>Activate the zoom function to enlarge the view by 400%.</li>
39+
<li>Check that the content of each individual panel within the horizontally scrolling sections is fully readable without the need for additional horizontal scrolling.</li>
40+
</ol>
41+
<div class="note">
42+
<p class="note-title marker">Note</p>
43+
<div>
44+
<p>The native browser scrollbar is not included in the viewport dimensions. Therefore, when setting the view to 1280 CSS pixels wide for a vertically scrolling page, make sure to exclude the scrollbar width.</p>
45+
</div>
46+
</div>
47+
</section>
48+
<section class="results">
49+
<h3>Expected Results</h3>
50+
<ul>
51+
<li>All checks above are true.</li>
52+
</ul>
53+
</section>
54+
</section>
55+
<section id="related">
56+
<h2>Related Techniques</h2>
57+
<ul>
58+
<li><a href="../general/G206">G206</a></li>
59+
<li><a href="../client-side-script/SCR34">SCR34</a></li>
60+
</ul>
61+
</section>
62+
</body>
63+
</html>
9.02 MB
Binary file not shown.
177 KB
Loading

understanding/21/img/code-diff.gif

4.21 MB
Loading
11.4 MB
Binary file not shown.
Loading
69.1 KB
Loading
374 KB
Loading

understanding/21/img/news-reflow.png

105 KB
Loading
39 KB
Loading
Loading
2.51 MB
Binary file not shown.
128 KB
Loading
415 KB
Loading
Loading
1.98 MB
Binary file not shown.

understanding/21/img/reflow.png

9.92 KB
Loading
Loading
6.4 KB
Loading
175 KB
Loading
Loading

0 commit comments

Comments
 (0)