Skip to content

Commit cae9002

Browse files
committed
[css-values-4] Make unconditional scrollbars on the root finally affect viewport unit sizes. #6026
1 parent 1be2f94 commit cae9002

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

css-values-4/Overview.bs

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2234,14 +2234,21 @@ The Large, Small, and Dynamic Viewport Sizes</h5>
22342234
and therefore have no effect on any of the [=viewport-percentage lengths=].
22352235
(Typically on-screen keyboards will fit into this category.)
22362236

2237-
In all cases, scrollbars are assumed not to exist.
2238-
<span class='note'>Note however that the [=initial containing block=]'s size
2239-
<em>is</em> affected by the presence of scrollbars on the viewport.</span>
2240-
2241-
ISSUE: <a href="https://www.w3.org/TR/css-values-3/#viewport-relative-lengths">Level 3 assumes scrollbars never exist</a> because it was hard to implement
2242-
and only Firefox bothered to do so.
2243-
This is <a href="https://github.com/w3c/csswg-drafts/issues/1766#issuecomment-460470368">making authors unhappy</a>.
2244-
Can we improve here?
2237+
In all cases,
2238+
if the value of 'overflow' or 'scrollbar-gutter' on the [=root element=] in either axis
2239+
would cause scrollbars to appear (or space to be reserved for them) unconditionally
2240+
(for example, ''overflow: scroll'', but not ''overflow: auto''),
2241+
the [=computed values=] of the [=viewport-percentage lengths=] in that axis
2242+
are reduced in accordance with the [=initial containing block=].
2243+
Otherwise,
2244+
and always in the case of [=media queries=],
2245+
the [=viewport-percentage lengths=] are sized
2246+
assuming that scrollbars do not exist
2247+
(even if this diverges from the [=initial containing block=]).
2248+
2249+
Note: The value of 'overflow' on [=the body element=]
2250+
can sometimes affect the presence of scrollbars on the [=root element=].
2251+
This <em>does not</em> affect the size of viewport units, however.
22452252

22462253
<h5 id="viewport-relative-units" class="no-toc">
22472254
The Various Viewport-relative Units</h5>
@@ -5520,6 +5527,10 @@ Recent Changes</h3>
55205527
(<a href="https://github.com/w3c/csswg-drafts/issues/9713">Issue 9713</a>)
55215528
* Generally fixed how type inference handles percentages.
55225529
(<a href="https://github.com/w3c/csswg-drafts/issues/10017">Issue 10017</a>)
5530+
* Restored dependency of [=viewport-percentage lengths=] on ''overflow: scroll''
5531+
and added one on 'scrollbar-gutter'
5532+
to make it possible for 100 of these units to actually match the [=initial containing block=].
5533+
(<a href="https://github.com/w3c/csswg-drafts/issues/6026">Issue 6026</a>)
55235534

55245535
Substantial changes since <a href="https://www.w3.org/TR/2023/WD-css-values-4-20231027/">27 October 2023 WD</a>:
55255536

0 commit comments

Comments
 (0)