Skip to content

Commit 747f87c

Browse files
committed
[css-overflow] move overscroll behaviors to overflow-4
1 parent dc08503 commit 747f87c

File tree

1 file changed

+186
-0
lines changed

1 file changed

+186
-0
lines changed

css-overflow-4/Overview.bs

Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ spec:css-pseudo-4; type:selector; text:::first-letter
2323
spec:css-pseudo-4; type:selector; text:::first-line
2424
spec:css-writing-modes-4; type:dfn; text:start
2525
spec:css-writing-modes-4; type:dfn; text:end
26+
spec:css2; type:dfn; text:viewport
2627
</pre>
2728
<pre class="anchors">
2829
url: https://drafts.csswg.org/selectors-3/#subject; type: dfn; text: subject;
@@ -1244,6 +1245,191 @@ Fragmentation of Overflow: the 'continue' property</h3>
12441245
This is regardless of whether this would cause any content after the [=clamp point=]
12451246
to be within the container's bounds.
12461247

1248+
<h2 id=overscroll-behaviors>
1249+
Overscroll Behaviors</h2>
1250+
1251+
<h3 id=scroll-chaining-and-boundary-default-actions>
1252+
Scroll chaining and boundary default actions</h3>
1253+
1254+
<em>Operating Systems have rules for scrolling such as scroll chaining and
1255+
overscroll affordances. This specification does not mandate if and how scroll
1256+
chaining or overscroll affordances be implemented. This specification only
1257+
allows the content author to disable them if any are implemented.</em>
1258+
1259+
<dfn>Scroll chaining</dfn> is when scrolling is propagated from one
1260+
[=scroll container=] to an ancestor [=scroll container=] following the
1261+
[=scroll chain=]. Typically scroll chaining is performed starting at the event
1262+
target recursing up the [=containing block chain=]. When a [=scroll container=]
1263+
in this chain receives a scroll event or gesture it may act on it and/or pass it
1264+
up the chain. Chaining typically occurs when the [=scrollport=] has reached its
1265+
boundary.
1266+
1267+
A <dfn>scroll chain</dfn> is the order in which scrolling is propagated from one
1268+
[=scroll container=] to another. The [=viewport=] participates in
1269+
[=scroll chaining=] as the document's {{Document/scrollingElement}}, both
1270+
regarding placement in the scroll chain as well as adhering to the chaining
1271+
rules applied to it.
1272+
1273+
1274+
<dfn export>Scroll boundary</dfn> refers to when the scroll position of a
1275+
[=scroll container=] reaches the edge of the [=scrollport=]. If a scroll
1276+
container has no potential to scroll, because it does not [=overflow=] in the
1277+
direction of the scroll, the element is always considered to be at the scroll
1278+
boundary.
1279+
1280+
<dfn>Boundary default action</dfn> refers to the user-agent-defined
1281+
default action performed when scrolling against the edge of the [=scrollport=].
1282+
A <dfn>local boundary default action</dfn> is a [=boundary default action=]
1283+
which is performed on the [=scroll container=] without interacting with the
1284+
page, for example displaying a overscroll UI affordance. Conversely, a
1285+
<dfn>non-local boundary default action</dfn> interacts with the page, for
1286+
example scroll chaining or a navigation action.
1287+
1288+
1289+
<h3 id=overscroll-behavior-properties>
1290+
Overscroll Behavior Properties</h3>
1291+
1292+
The <dfn>overscroll behavior</dfn> controls the permitted
1293+
[=boundary default action=] for a [=scroll container=] element when its
1294+
[=scrollport=] reaches the boundary of its scroll box.
1295+
1296+
The 'overscroll-behavior' property specifies the [=overscroll behavior=] for a
1297+
[=scroll container=] element. It allows the content author to specify that a
1298+
[=scroll container=] element must prevent scroll chaining and/or overscroll
1299+
affordances.
1300+
1301+
An element that is not [=scroll container=] must accept but ignore the values of
1302+
this property. This property must be applied to all scrolling methods supported
1303+
by the user agent.
1304+
1305+
Note: This property should provide guarantees that are, at least, as strong as
1306+
[=preventDefault=] for preventing both scroll chaining and overscroll. Doing
1307+
otherwise would cause content authors to use [=preventDefault=] instead.
1308+
1309+
<pre class=propdef>
1310+
Name: overscroll-behavior
1311+
Value: [ contain | none | auto ]{1,2}
1312+
Initial: auto auto
1313+
Applies to: <a>scroll container</a> elements
1314+
Inherited: no
1315+
Media: visual
1316+
Computed value: see individual properties
1317+
Animation type: discrete
1318+
Canonical order: <abbr title="follows order of property value definition">per grammar</abbr>
1319+
</pre>
1320+
1321+
1322+
The 'overscroll-behavior' property is a shorthand property that sets the
1323+
specified values of 'overscroll-behavior-x' and 'overscroll-behavior-y' in that
1324+
order. If only one value is specified, the second value defaults to the same
1325+
value.
1326+
1327+
Values have the following meanings:
1328+
1329+
<dl dfn-for="overscroll-behavior, overscroll-behavior-x, overscroll-behavior-y, overscroll-behavior-inline, overscroll-behavior-block" dfn-type="value">
1330+
<dt><dfn>contain</dfn>
1331+
<dd>
1332+
This value indicates that the element must not perform <a>non-local boundary default actions</a>
1333+
such as scroll chaining or navigation. The user agent must not perform scroll chaining to any
1334+
ancestors along the <a>scroll chain</a> regardless of whether the scroll originated at this
1335+
element or one of its descendants. This value must not modify the behavior of how <a>local
1336+
boundary default actions</a> should behave, such as showing any overscroll affordances.
1337+
<dt><dfn>none</dfn>
1338+
<dd>
1339+
This value implies the same behavior as <a value for=overscroll-behavior>contain</a> and in
1340+
addition this element must also not perform <a>local boundary default actions</a> such as
1341+
showing any overscroll affordances.
1342+
<dt><dfn>auto</dfn>
1343+
<dd>
1344+
This value indicates that the user agent should perform the usual <a>boundary default action</a>
1345+
with respect to <a>scroll chaining</a>, overscroll and navigation gestures.
1346+
</dl>
1347+
1348+
Note: In the case where a user agent does not implement scroll chaining and
1349+
overscroll affordances, these values will have no side effects for a compliant
1350+
implementation.
1351+
1352+
Note: Programmatic scrolling is clamped and can not trigger any
1353+
[=boundary default actions=].
1354+
1355+
<h3 id=overscroll-positioned>
1356+
Overscroll and Positioned Elements</h3>
1357+
1358+
This specification does not generally dictate what, if any, "overscroll" or
1359+
similar actions might occur as a [=local boundary default action=].
1360+
1361+
However, if a user agent <em>does</em> use "overscroll" behavior (that is,
1362+
allowing a scrollable element to be scrolled slightly "past the end" of its
1363+
scrollable area, usually with a "rubber-banding" effect after the scroll or drag
1364+
is completed), then the following applies:
1365+
1366+
If an element uses [=fixed positioning=] and is positioned relative to the
1367+
[=initial containing block=], or is a [=sticky positioned=] element which is
1368+
currently stuck to the [=viewport=], then when the [=root scroller=] experiences
1369+
"overscroll", that element <em>must not</em> overscroll with the rest of the
1370+
document's content; it must instead remain positioned as if the scroller was at
1371+
its minimum/maximum scroll position, whichever it will return to when the
1372+
overscroll is finished.
1373+
1374+
Even tho this can visually shift the fixed/sticky element relative to other
1375+
elements on the page, it must be treated purely as a visual effect, and not
1376+
reported as an actual layout/position change to APIs such as
1377+
{{Element/getBoundingClientRect()}}.
1378+
1379+
Note: This behavior is because fixpos and viewport-stuck stickypos elements are
1380+
positioned relative to "the viewport", which is conceptually above the
1381+
root scroller in the page hierarchy (effectively, it's the [=scroll container=]
1382+
holding the root scroller). Thus, overscrolling the root scroller shouldn't
1383+
have any effect on them, just like how an abspos that is a child of a scroller
1384+
but whose abspos containing block is <em>above</em> the scroller isn't affected
1385+
by the scroller doing anything at all, including overscroll.
1386+
1387+
1388+
<h3 id=overscroll-behavior-longhands-physical>
1389+
Physical Longhands for 'overscroll-behavior'</h3>
1390+
1391+
<pre class=propdef>
1392+
Name: overscroll-behavior-x, overscroll-behavior-y
1393+
Value: contain | none | auto
1394+
Initial: auto
1395+
Applies to: <a>scroll container</a> elements
1396+
Inherited: no
1397+
Logical property group: overscroll-behavior
1398+
Percentages: N/A
1399+
Media: visual
1400+
Computed value: as specified
1401+
Animation type: discrete
1402+
Canonical order: <abbr title="follows order of property value definition">per grammar</abbr>
1403+
</pre>
1404+
1405+
The 'overscroll-behavior-x' property specifies the <a>overscroll behavior</a> in the horizontal
1406+
axis and the 'overscroll-behavior-y' property specifies the <a>overscroll behavior</a> in the
1407+
vertical axis. When scrolling is performed along both the horizontal and vertical axes at the
1408+
same time, the <a>overscroll behavior</a> of each respective axis should be considered
1409+
independently.
1410+
1411+
1412+
<h3 id=overscroll-behavior-longhands-logical>
1413+
Flow-relative Longhands for 'overscroll-behavior'</h3>
1414+
1415+
<pre class=propdef>
1416+
Name: overscroll-behavior-inline, overscroll-behavior-block
1417+
Value: contain | none | auto
1418+
Initial: auto
1419+
Applies to: <a>scroll container</a> elements
1420+
Inherited: no
1421+
Logical property group: overscroll-behavior
1422+
Percentages: N/A
1423+
Media: visual
1424+
Computed value: as specified
1425+
Animation type: discrete
1426+
Canonical order: <abbr title="follows order of property value definition">per grammar</abbr>
1427+
</pre>
1428+
1429+
These properties correspond to the 'overscroll-behavior-x' and
1430+
'overscroll-behavior-y' properties. The mapping depends on the element's
1431+
'writing-mode'.
1432+
12471433
<h2 id=sbg-ext class=nonum>
12481434
Appendix A: Possible extensions for ''scrollbar-gutter''</h2>
12491435

0 commit comments

Comments
 (0)