@@ -729,6 +729,173 @@ Smooth Scrolling: The 'scroll-behavior' Property</h3>
729
729
730
730
User agents may ignore this property. <!--fingerprint-->
731
731
732
+ <h2 id="scrollbar-gutter-property">
733
+ Reserving space for the scrollbar: the 'scrollbar-gutter' property</h2>
734
+
735
+ The space between the inner border edge and the outer padding edge
736
+ which user agents may reserve to display the scrollbar
737
+ is called the <dfn>scrollbar gutter</dfn> .
738
+
739
+ The 'scrollbar-gutter' property gives control to the author
740
+ over the presence of <a>scrollbar gutters</a>
741
+ separately from the ability to control the presence of scrollbars
742
+ provided by the 'overflow' property.
743
+
744
+ <pre class="propdef">
745
+ Name : scrollbar-gutter
746
+ Value : auto | stable && both-edges?
747
+ Initial : auto
748
+ Applies to : [=scroll containers=]
749
+ Inherited : no
750
+ Computed value : specified keyword(s)
751
+ Animation type : discrete
752
+ </pre>
753
+
754
+ This property affects the presence of <a>scrollbar gutters</a>
755
+ placed at the <a>inline start</a> edge or <a>inline end</a> edge of the box.
756
+
757
+ The presence of a <a>scrollbar gutter</a>
758
+ at the <a>block start</a> edge and <a>block end</a> edge of the box
759
+ cannot be controlled in this level,
760
+ and is determined the same way as the presence of <a>scrollbar gutters</a>
761
+ placed at the <a>inline start</a> edge or <a>inline end</a> edge of the box
762
+ when 'scrollbar-gutter' is ''scrollbar-gutter/auto'' .
763
+
764
+ Scrollbars which by default are placed over the content box
765
+ and do not cause <a>scrollbar gutters</a> to be created
766
+ are called <dfn>overlay scrollbars</dfn> .
767
+ Such scrollbars are usually partially transparent, revealing the content behind them if any.
768
+ Their appearance and size may vary
769
+ based on whether and how the user is interacting with them.
770
+
771
+ Scrollbars which are always placed in a <a>scrollbar gutter</a> ,
772
+ consuming space when present,
773
+ are called <dfn>classic scrollbars</dfn> .
774
+ Such scrollbars are usually opaque.
775
+
776
+ Whether <a>classic scrollbars</a> or <a>overlay scrollbars</a> are used,
777
+ the appearance and size of the scrollbar,
778
+ and whether scrollbars appear on the start or end edge of the box,
779
+ is UA defined.
780
+
781
+ Note: Which side a scrollbar appears on may depend on
782
+ operating system conventions,
783
+ [=bidirectionality=] ,
784
+ or other ergonomic considerations.
785
+
786
+ In the case of <a>classic scrollbars</a> ,
787
+ the width of the <a>scrollbar gutter</a> ,
788
+ if present (see below),
789
+ is the same as the width of the scrollbar.
790
+ In the case of <a>overlay scrollbars</a> ,
791
+ no <a>scrollbar gutter</a> is present.
792
+
793
+ Note: There are known use cases that could be addressed
794
+ by enabling <a>scrollbar gutters</a>
795
+ for <a>overlay scrollbars</a> ,
796
+ but no satisfactory design has been agreed to so far.
797
+ This could be addressed by future extensions of this property.
798
+ See [[css-overflow-4#sbg-ext]] .
799
+
800
+ The values of this property have the following meaning:
801
+
802
+ <dl dfn-for="scrollbar-gutter" dfn-type=value>
803
+ <dt> <dfn>auto</dfn>
804
+ <dd> <a>Classic scrollbars</a> consume space by creating a <a>scrollbar gutter</a>
805
+ when 'overflow' is ''overflow/scroll'' ,
806
+ or when 'overflow' is ''overflow/auto'' and the box is overflowing.
807
+ <a>Overlay scrollbars</a> do not consume space.
808
+
809
+ <dt> <dfn>stable</dfn>
810
+ <dd> The <a>scrollbar gutter</a> is present
811
+ for <a>classic scrollbars</a>
812
+ when 'overflow' is ''overflow/hidden'' , ''overflow/scroll'' , or ''overflow/auto'' ,
813
+ regardless of whether the box is actually overflowing.
814
+ <a>Overlay scrollbars</a> do not consume space.
815
+
816
+ Note: This does not change whether the scrollbar itself is visible,
817
+ only the presence of a gutter is affected.
818
+
819
+ <dt> <dfn>both-edges</dfn>
820
+ <dd> If a <a>scrollbar gutter</a> would be present
821
+ on one of the inline start edge or the inline end edge of the box,
822
+ another <a>scrollbar gutter</a> must be present on the opposite edge as well.
823
+ </dl>
824
+
825
+ When the <a>scrollbar gutter</a> is present but the scrollbar is not,
826
+ or the scrollbar is transparent or otherwise does not fully obscure the <a>scrollbar gutter</a> ,
827
+ the background of the <a>scrollbar gutter</a> must be painted as an extension of the padding.
828
+
829
+ As for the 'overflow' property,
830
+ when 'scrollbar-gutter' is set on the root element,
831
+ the user agent must apply it to the viewport instead,
832
+ and the used value on the root element itself is ''scrollbar-gutter: auto'' .
833
+ However, unlike the 'overflow' property,
834
+ the user agent must not propagate 'scrollbar-gutter' from the HTML <{body}> element.
835
+
836
+ <div class=note>
837
+ Note: The following table summarizes the interaction of 'overflow' and 'scrollbar-gutter'
838
+ showing in which case space is reserved for a <a>classic scrollbar</a> 's <a>scrollbar gutter</a> .
839
+
840
+ <style>
841
+ .data.complex tbody th:last-of-type {
842
+ border-right: solid black 2px;
843
+ }
844
+ .data.complex tbody tr:nth-of-type(2n) td,
845
+ .data.complex tbody tr:nth-of-type(2n) th:not([rowspan] ) {
846
+ background: rgba(127, 127, 127, 0.25);
847
+ }
848
+ </style>
849
+
850
+ <table class="data complex">
851
+ <caption>
852
+ Should a <a>classic scrollbar</a> 's <a>scrollbar gutter</a> be present?</caption>
853
+ <thead>
854
+ <tr>
855
+ <th> 'overflow'
856
+ <th> 'scrollbar-gutter'
857
+ <th> Overflowing
858
+ <th> Not overflowing
859
+ </thead>
860
+ <tr>
861
+ <th rowspan=2> ''overflow/scroll''
862
+ <th> ''scrollbar-gutter/auto''
863
+ <td> yes
864
+ <td> yes
865
+ <tr>
866
+ <th> ''scrollbar-gutter/stable''
867
+ <td> yes
868
+ <td> yes
869
+ <tr>
870
+ <th rowspan=2> ''overflow/auto''
871
+ <th> ''scrollbar-gutter/auto''
872
+ <td> yes
873
+ <td>
874
+ <tr>
875
+ <th> ''scrollbar-gutter/stable''
876
+ <td> yes
877
+ <td> yes
878
+ <tr>
879
+ <th rowspan=2> ''overflow/hidden''
880
+ <th> ''scrollbar-gutter/auto''
881
+ <td>
882
+ <td>
883
+ <tr>
884
+ <th> ''scrollbar-gutter/stable''
885
+ <td> yes
886
+ <td> yes
887
+ <tr>
888
+ <th rowspan=2> ''overflow/visible'' , ''overflow/clip''
889
+ <th> ''scrollbar-gutter/auto''
890
+ <td>
891
+ <td>
892
+ <tr>
893
+ <th> ''scrollbar-gutter/stable''
894
+ <td>
895
+ <td>
896
+ </table>
897
+ </div>
898
+
732
899
<h2 id="auto-ellipsis">
733
900
Automatic Ellipses</h2>
734
901
@@ -1492,6 +1659,7 @@ Fragmentation of Overflow: the 'continue' property</h3>
1492
1659
Changes from the <a href="https://www.w3.org/TR/2020/WD-css-overflow-3-20200603/">2020-06-03 Working Draft</a></h3>
1493
1660
1494
1661
* Moved the 'scroll-behavior' property from [[CSSOM-VIEW]] to this specification.
1662
+ * Adopt the 'scrollbar-gutter' property, previously defined in [[CSS-OVERFLOW-4]] .
1495
1663
<!-- This list is not complete -->
1496
1664
1497
1665
<h3 id="changes-since-2018-07-31">
0 commit comments