Skip to content

Commit

Permalink
[css-position-4] Define the 'scrollable containing block'. #10861
Browse files Browse the repository at this point in the history
  • Loading branch information
tabatkins committed Oct 15, 2024
1 parent 45fc958 commit dd13427
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions css-position-4/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,48 @@ It is recommended that UAs use [=out-of-band outlines=],
as making outlines easily visible
is an important accessibility feature.


Scrollable Containing Block {#scrollable-cb}
===========================

When an element
generates an [=absolute positioning containing block=]
for its descendants,
that [=containing block=] is generated from the element's [=padding box=] edges.
If that element is a [=scroll container=],
this corresponds to the dimensions of the [=scrollport=],
and does not shift as the scroll container is scrolled.
In other words,
it's "outside of" the scrollable area.

Sometimes, however, you instead want a [=containing block=]
based on the "inside" of the scroll container,
sized according to the scrollable contents
and shifting as the container is scrolled.

Whenever a [=scroll container=] generates an [=absolute positioning containing block=],
it addition to the normal [=containing block=] it generates,
it also generates a <dfn export>scrollable containing block</dfn>.
This is sized to match the [=padding box=] edges
of the scrollable area,
and is treated as being "inside" the scrollable area,
so it moves as the [=scroll container=] is scrolled.

Note: This is not <em>quite</em> the [=scrollable overflow rectangle=];
in particular, it doesn't include the effects of transformed elements
or absolutely positioned elements.

In [=containing block chains=],
the [=scrollable containing block=] generated by an element
is considered a child of the element's normal [=containing block=],
and a parent of any containing blocks generated by its descendants.

The [=scrollable containing block=] is not used by default,
but certain CSS features
(such as 'position-area')
can specify that they use it instead of an element's normal [=containing block=].


<!--
████████ ███████ ████████
██ ██ ██ ██ ██
Expand Down

0 comments on commit dd13427

Please sign in to comment.