Skip to content

Commit 3bb4765

Browse files
committed
[css-overscroll-behavior-1] Add logical longhands #2473
Add logical longhands that map to corresponding physical one. To do this properly introduce dfn for "overscroll behavior". The physical longhands refer to this definition while the shorthand and logical longhands refer to the physical longhands. Other fixes: - Drop unnecessary overview section - Use 'Animation type' instead of animatable - Correct wrapping
1 parent da2b79e commit 3bb4765

File tree

1 file changed

+66
-38
lines changed

1 file changed

+66
-38
lines changed

css-overscroll-behavior-1/Overview.bs

+66-38
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ URL: https://drafts.csswg.org/css-overscroll-behavior-1/
99
Editor: Benoit Girard, Facebook, bgirard@fb.com
1010
Editor: Majid Valipour, Google, majidvp@google.com, w3cid 81464
1111
12-
Abstract: This module defines 'overscroll-behavior' to control the behavior when the scroll position of a <a>scroll container</a> reaches the edge of the <a>scrollport</a>.
12+
Abstract: This module defines 'overscroll-behavior' to control the behavior when the scroll position
13+
Abstract: of a <a>scroll container</a> reaches the edge of the <a>scrollport</a>.
1314
Abstract: This allows content authors to hint that the <a>boundary default actions</a>,
1415
Abstract: such as scroll chaining and overscroll, should not be triggered.
1516
</pre>
@@ -61,7 +62,7 @@ shortcoming.
6162

6263

6364
Motivating Examples {#motivating-examples}
64-
=================
65+
==========================================
6566

6667

6768
<div class=example>
@@ -110,7 +111,7 @@ scroller to prevent both scroll chaining and overscroll affordance.
110111
</div>
111112

112113
Scroll chaining and boundary default actions {#scroll-chaining-and-boundary-default-actions}
113-
==========================
114+
============================================================================================
114115

115116
<em>Operating Systems have rules for scrolling such as scroll chaining and overscroll affordances.
116117
This specification does not mandate if and how scroll chaining or overscroll affordances be
@@ -138,43 +139,25 @@ interacting with the page, for example displaying a overscroll UI affordance. Co
138139
>non-local boundary default action</dfn> interacts with the page, for example scroll chaining or a
139140
navigation action.
140141

141-
Overview {#overview}
142-
==========================
143-
144-
This module introduces control over the behavior of a <a>scroll container</a> element when its
145-
<a>scrollport</a> reaches the boundary of its scroll box. It allows the content author to specify
146-
that a <a>scroll container</a> element must prevent scroll chaining and/or overscroll affordances.
147142

148143
Overscroll Behavior Properties {#overscroll-behavior-properties}
149-
==========================
144+
================================================================
145+
146+
The <dfn>overscroll behavior</dfn> controls the permitted <a>boundary default action</a> for a
147+
<a>scroll container</a> element when its <a>scrollport</a> reaches the boundary of its scroll box.
148+
150149

151-
These properties specify how a <a>scroll container</a> element must behave when scrolling. A element
152-
that is not <a>scroll container</a> must accept but ignore the values of this property. This
153-
property must be applied to all input methods supported by the user agent.
150+
The 'overscroll-behavior' property specifies the <a>overscroll behavior</a> for a <a>scroll
151+
container</a> element. It allows the content author to specify that a <a>scroll container</a>
152+
element must prevent scroll chaining and/or overscroll affordances.
153+
154+
An element that is not <a>scroll container</a> must accept but ignore the values of this property.
155+
This property must be applied to all scrolling methods supported by the user agent.
154156

155157
Note: This property should provide guarantees that are, at least, as strong as <a>preventDefault</a>
156158
for preventing both scroll chaining and overscroll. Doing otherwise would cause content authors to
157159
use <a>preventDefault</a> instead.
158160

159-
<pre class=propdef>
160-
Name: overscroll-behavior-x, overscroll-behavior-y
161-
Value: contain | none | auto
162-
Initial: auto
163-
Applies to: <a>scroll container</a> elements
164-
Inherited: no
165-
Percentages: N/A
166-
Media: visual
167-
Computed value: as specified
168-
Animatable: no
169-
Canonical order: <abbr title="follows order of property value definition">per grammar</abbr>
170-
</pre>
171-
172-
The 'overscroll-behavior-x' property specifies the behavior of the 'overscroll-behavior'
173-
in the horizontal direction and the 'overscroll-behavior-y' property specifies the handling of
174-
the 'overscroll-behavior' in the vertical direction. When scrolling is performed along both the
175-
horizontal and vertical axes at the same time, the 'overscroll-behavior' of each respective
176-
axis should be considered independently.
177-
178161
<pre class=propdef>
179162
Name: overscroll-behavior
180163
Value: [ contain | none | auto ]{1,2}
@@ -183,22 +166,25 @@ Applies to: <a>scroll container</a> elements
183166
Inherited: no
184167
Media: visual
185168
Computed value: see individual properties
186-
Animatable: no
169+
Animation type:: discrete
187170
Canonical order: <abbr title="follows order of property value definition">per grammar</abbr>
188171
</pre>
189172

190-
The two values specify the behavior in the horizontal and vertical direction, respectively. If only one value is specified, the second value defaults to the same value.
173+
174+
The 'overscroll-behavior' property is a shorthand property that sets the specified values of
175+
'overscroll-behavior-x' and 'overscroll-behavior-y' in that order. If only one value is specified,
176+
the second value defaults to the same value.
191177

192178
Values have the following meanings:
193179

194-
<dl dfn-for="overscroll-behavior, overscroll-behavior-x, overscroll-behavior-y" dfn-type="value">
180+
<dl dfn-for="overscroll-behavior, overscroll-behavior-x, overscroll-behavior-y, overscroll-behavior-inline, overscroll-behavior-block" dfn-type="value">
195181
<dt><dfn>contain</dfn>
196182
<dd>
197-
This value indicates that the element must not perform <a>non-local boundary default actions</a>
183+
This value indicates that the element must not perform non-<a>local boundary default actions</a>
198184
such as scroll chaining or navigation. The user agent must not perform scroll chaining to any
199185
ancestors along the <a>scroll chain</a> regardless of whether the scroll originated at this
200186
element or one of its descendants. This value must not modify the behavior of how <a>local
201-
boundary default actions</a> should behave, such as overscroll behavior.
187+
boundary default actions</a> should behave, such as showing any overscroll affordances.
202188
<dt><dfn>none</dfn>
203189
<dd>
204190
This value implies the same behavior as <a value for=overscroll-behavior>contain</a> and in
@@ -216,9 +202,51 @@ these values will have no side effects for a compliant implementation.
216202
Note: Programmatic scrolling is clamped and can not trigger any <a>boundary default actions</a>.
217203

218204

205+
Physical Longhands for 'overscroll-behavior' {#overscroll-behavior-longhands-physical}
206+
---------------------------------------------------------------------------------------
207+
208+
<pre class=propdef>
209+
Name: overscroll-behavior-x, overscroll-behavior-y
210+
Value: contain | none | auto
211+
Initial: auto
212+
Applies to: <a>scroll container</a> elements
213+
Inherited: no
214+
Percentages: N/A
215+
Media: visual
216+
Computed value: as specified
217+
Animation type:: discrete
218+
Canonical order: <abbr title="follows order of property value definition">per grammar</abbr>
219+
</pre>
220+
221+
The 'overscroll-behavior-x' property specifies the <a>overscroll behavior</a> in the horizontal
222+
axis and the 'overscroll-behavior-y' property specifies the <a>overscroll behavior</a> in the
223+
vertical axis. When scrolling is performed along both the horizontal and vertical axes at the
224+
same time, the <a>overscroll behavior</a> of each respective axis should be considered
225+
independently.
226+
227+
228+
Flow-relative Longhands for 'overscroll-behavior' {#overscroll-behavior-longhands-logical}
229+
-------------------------------------------------------------------------------------------
230+
231+
<pre class=propdef>
232+
Name: overscroll-behavior-inline, overscroll-behavior-block
233+
Value: contain | none | auto
234+
Initial: auto
235+
Applies to: <a>scroll container</a> elements
236+
Inherited: no
237+
Percentages: N/A
238+
Media: visual
239+
Computed value: as specified
240+
Animation type:: discrete
241+
Canonical order: <abbr title="follows order of property value definition">per grammar</abbr>
242+
</pre>
243+
244+
These properties correspond to the 'overscroll-behavior-x' and 'overscroll-behavior-y' properties.
245+
The mapping depends on the element's 'writing-mode'.
246+
219247

220248
Security and Privacy Considerations {#security-and-privacy}
221-
===================================
249+
===========================================================
222250
There are no known security or privacy impacts of this feature. The feature may be used to prevent
223251
certain native UI features such as overscroll affordances and overscroll navigations (e.g., pull-
224252
to-refresh, swipe navigations). However, this does not expose any additional abilities beyond what

0 commit comments

Comments
 (0)