You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Zoomed text node is not clipped with CSS overflow" [59br37]: split horizontal and vertical checks (#1823)
* Split definition of clipped by overflow
* Split horizontal and vertical clipping
Co-authored-by: Carlos Duarte <carlosapaduarte@gmail.com>
Co-authored-by: Trevor R. Bostic <32486143+tbostic32@users.noreply.github.com>
Copy file name to clipboardExpand all lines: _rules/zoom-text-no-overflow-clipping-59br37.md
+54-20Lines changed: 54 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,21 +33,21 @@ This rule applies to any [text node][] for which all of the following is true wh
33
33
34
34
**Note**: A [viewport size][] of 640 by 512 is equivalent to a [viewport size][] of 1280 by 1024 zoomed 200%.
35
35
36
-
## Expectation
36
+
## Expectation 1
37
37
38
-
Each test target is not [clipped by overflow][clipped] of an [ancestor][] in the [flat tree][] when in a [viewport size][] of 640 by 512, except if the [clipping][clipped][ancestor][] has at least one of the following:
38
+
Each test target is not [horizontally clipped by overflow][horizontally clipped] of an [ancestor][] in the [flat tree][] when in a [viewport size][] of 640 by 512, except if the [clipping][horizontally clipped][ancestor][] has a [computed][][white-space][] of `nowrap`, and a [computed][][text-overflow][] that is not `clip`
39
39
40
-
-**text-overflow**: A [computed][][white-space][] of `nowrap`, and a [computed][][text-overflow][] that is not `clip`; or
40
+
## Expectation 2
41
41
42
-
-**line wrapping**: A [used][][line-height][] equal to or greater than the height of its [bounding box][], or in case of a [computed][][overflow][] of `clip`, its [content box][].
42
+
Each test target is not [vertically clipped by overflow][vertically clipped] of an [ancestor][] in the [flat tree][] when in a [viewport size][] of 640 by 512, except if the [clipping][vertically clipped][ancestor][] has a [used][][line-height][] equal to or greater than the height of its [bounding box][], or in case of a [computed][][overflow-y][overflow] of `clip`, its [content box][].
43
43
44
44
## Assumptions
45
45
46
46
If any of the following assumptions is true, failing this rule may not result in a failure of [success criterion 1.4.4 Resize text](https://www.w3.org/TR/WCAG21/#resize-text):
47
47
48
48
- There is no other mechanism for resizing text available on the page, that can be used to resize text to 200% without loss of information or functionality. This includes font resizing in the browser, or a javascript mechanism of resizing in the page.
49
49
50
-
-[Text nodes][text node] can not be [clippedby overflow][clipped] without loss of information, except for [text nodes][text node] with an [ancestor][] with `aria-hidden` set to `true`, or when specific styles have been applied to ensure text is clipped cleanly (text-overflow, line wrapping or hidden text).
50
+
-[Text nodes][text node] can not be [horizontally][horizontally clipped] or [vertically clipped by overflow][vertically clipped] without loss of information, except for [text nodes][text node] with an [ancestor][] with `aria-hidden` set to `true`, or when specific styles have been applied to ensure text is clipped cleanly (text-overflow, line wrapping or hidden text).
51
51
52
52
- While [success criterion 1.4.4 Resize text](https://www.w3.org/TR/WCAG21/#resize-text) does not explicitly mention which viewport size has to be resized up to 200%, it is assumed that a [viewport size][] of 1280 by 1024 is applicable. A 1280 by 1024 [viewport size][] is explicitly mentioned under [success criterion 1.4.10 Reflow](https://www.w3.org/TR/WCAG21/#reflow).
53
53
@@ -85,7 +85,7 @@ This [text node][] is fully [visible][] at a [viewport size][] of 640 by 512.
85
85
86
86
#### Passed Example 2
87
87
88
-
This [text node][] is [clipped][] using `text-overflow: ellipsis` at a [viewport size][] of 640 by 512. A link to a full version of the poem is also provided.
88
+
This [text node][] is [horizontally clipped][] using `text-overflow: ellipsis` at a [viewport size][] of 640 by 512. A link to a full version of the poem is also provided.
@@ -118,7 +118,7 @@ This [text node][] is restricted to a single line, by setting a `line-height` th
118
118
119
119
#### Passed Example 4
120
120
121
-
This [text node][] is not [clipped][] with `overflow: hidden` because it has a parent with `overflow: auto` at a [viewport size][] of 640 by 512.
121
+
This [text node][] is not [vertically clipped][] with `overflow: hidden` because it has a parent with `overflow: auto` at a [viewport size][] of 640 by 512.
@@ -144,7 +144,7 @@ This [text node][] is [clipped][] because it has a fixed height that does not le
144
144
145
145
#### Failed Example 2
146
146
147
-
This [text node][] is [clipped][] because its height is relative to the viewport height, leaving insufficient space for the page to be zoomed to 200% at a [viewport size][] of 1280 by 1024.
147
+
This [text node][] is [vertically clipped][] because its height is relative to the viewport height, leaving insufficient space for the page to be zoomed to 200% at a [viewport size][] of 1280 by 1024.
A [node][] is <dfn>Horizontally Clipped by Overflow</dfn> if it has an [ancestor][] in the [flat tree][] with a [computed][][overflow-x][] of `hidden` or `clip`, where changing the [overflow-x][] of all such [ancestors][ancestor] to `visible` would cause more of the [node][] to become [visible][].
9
+
10
+
#### Example of Horizontally Clipped by Overflow
11
+
12
+
This `img` element has an [ancestor][]`div` element with an `overflow-x` of `hidden`. The width of the `img` is greater than that of the [ancestor][]`div`, and so is clipped by the `overflow-x` property of the `div`.
A [node][] is <dfn>Vertically Clipped by Overflow</dfn> if it has an [ancestor][] in the [flat tree][] with a [computed][][overflow-y][] of `hidden` or `clip`, where changing the [overflow-y][] of all such [ancestors][ancestor] to `visible` would cause more of the [node][] to become [visible][].
9
+
10
+
#### Example of Vertically Clipped by Overflow
11
+
12
+
This `img` element has an [ancestor][]`div` element with an `overflow-y` of `hidden`. The height of the `img` is greater than that of the [ancestor][]`div`, and so is clipped by the `overflow-y` property of the `div`.
0 commit comments