Skip to content

Commit 7121795

Browse files
committed
[css-align-3] Rewrite the scroll-container alignment section again, for both correctness and understandability. w3c#1425.
1 parent f6909a1 commit 7121795

1 file changed

Lines changed: 32 additions & 9 deletions

File tree

css-align-3/Overview.bs

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,23 +1104,46 @@ Content-Distribution Shorthand: the 'place-content' property</h3>
11041104
<h3 id="overflow-scroll-position">
11051105
Overflow and Scroll Positions</h3>
11061106

1107-
Content that overflows a <a>scroll container</a>
1108-
is aligned exactly like content in a non-scrollable container.
1109-
However, to prevent content from being shifted into the unscrollable region,
1110-
when the <a>content-distribution properties</a> are set on a <a>scroll container</a>,
1111-
the zero coordinate of its <a>scrollable overflow region</a>
1112-
(that is, the point beyond which content is unreachable)
1113-
is set to the top left corner of the <a>alignment subject</a>,
1114-
effectively changing the <a>initial scroll position</a>.
1107+
When the <a>content-distribution properties</a> are set
1108+
on a <a>scroll container</a> with overflowing content,
1109+
rather than shifting the position of its content,
1110+
they instead change its <a>initial scroll position</a>
1111+
so that the initially-visible content
1112+
of the <a>scroll container</a>
1113+
is the same as it would be if it were not a <a>scroll container</a>.
1114+
This does not change how scroll coordinates are assigned:
1115+
the origin is still where it would be in a ''align-content/start''-aligned container,
1116+
it just might be initially positioned outside the <a>scrollport</a>.
11151117

11161118
<div class='example'>
11171119
For example,
11181120
if a scrollable flex container is set to ''justify-content: flex-end''
11191121
(or ''justify-content: flex-start'' with ''flex-flow: row-reverse''),
1120-
it will be initially displayed scrolled all the way to the main-end edge of the scrollable area,
1122+
it will be initially displayed scrolled all the way to the main-end edge of its content,
11211123
and its content will appear to overflow its main-start edge.
11221124
</div>
11231125

1126+
Since performing such alignment can require that the <a>scrollable overflow region</a>
1127+
be extended by the amount of padding specified
1128+
on the end edges of the <a>scroll container</a>,
1129+
any non-''align-content/normal'' value of 'align-content' or 'justify-content'
1130+
will cause the <a>scrollable overflow region</a> to be extended
1131+
as would be required for ''align-content/end'' alignment
1132+
in the relevant axis.
1133+
(In general, this means that the <a>scroll container</a>’s padding
1134+
is added to the bounding rectangle of its in-flow children.
1135+
See [[css-overflow-3]] for details.)
1136+
1137+
ISSUE: Coordinate wording with css-overflow once it's less of a mess.
1138+
1139+
Note: The <a>alignment subject</a> is not necessarily
1140+
identical to the <a>scrollable overflow region</a>:
1141+
content overflowing the <a>alignment subject</a>,
1142+
such as an absolutely-positioned or out-of-flow element,
1143+
grows the <a>scrollable overflow region</a> but not the <a>alignment subject</a>,
1144+
thus an ''align-content/end''-aligned <a>scroll container</a>
1145+
might not be initially scrolled all the way to the bottom.
1146+
11241147
<h3 id="baseline-align-content">
11251148
Baseline Content-Alignment</h3>
11261149

0 commit comments

Comments
 (0)