Skip to content

Commit e349ced

Browse files
committed
Issue w3c#4: Use 'scroll container' instead of 'scrollable element'
Also make some small grammar fixes.
1 parent 68a6a99 commit e349ced

File tree

2 files changed

+33
-40
lines changed

2 files changed

+33
-40
lines changed

index.bs

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,35 @@ Work Status: Exploring
77
Group: WICG
88
URL: https://wicg.github.io/scroll-boundary-behavior/
99
Editor: Benoit Girard, Facebook, bgirard@fb.com
10-
Abstract: This module defines 'scroll-boundary-behavior' to control the behavior when a scroll position of a <a>potentially scrollable</a> element reaches the edge of the <a>scrollport</a>.
10+
Abstract: This module defines 'scroll-boundary-behavior' to control the behavior when the scroll position of a <a>scroll container</a> reaches the edge of the <a>scrollport</a>.
1111
Abstract: This allows content authors to hint that the <a>boundary default actions</a>,
1212
Abstract: such as scroll chaining and overscroll, should not be triggered.
1313
</pre>
1414

1515
<pre class='anchors'>
1616
urlPrefix: https://www.w3.org/TR/css-display-3/
1717
type: dfn; text: containing block chain
18-
urlPrefix: https://www.w3.org/TR/cssom-view-1/
19-
type: dfn; text: potentially scrollable
20-
urlPrefix: https://www.w3.org/TR/uievents/
18+
url: https://drafts.csswg.org/css-overflow-3/#scroll-container
19+
type: dfn; text: scroll container
20+
type: dfn; text: scroll containers
21+
url: https://www.w3.org/TR/uievents/#default-action
2122
type: dfn; text: default action
2223
type: dfn; text: default actions
2324
url: https://dom.spec.whatwg.org/#dom-event-preventdefault
2425
type: dfn; text: preventDefault
26+
url: https://dom.spec.whatwg.org/#dom-eventtarget-addeventlistener
27+
type: dfn; text: passive flag
2528
</pre>
2629

2730
Introduction {#intro}
2831
=====================
2932

3033
<em>This section is not normative.</em>
3134

32-
A content author does not necessarily want <a>scroll chaining</a> to occur for all scrollable containers. Some scroll containers may be part of a <a>containing block chain</a> but may serve a different logical purpose in the document and may want to prevent scrolling from continuing up the <a>scroll chain</a>. To achieve this, a content author will install event listeners without the passive flag set and will use <a>preventDefault</a> when there is a risk that scroll chaining will occur. This is detrimental for the following reasons:
35+
A content author does not necessarily want <a>scroll chaining</a> to occur for all <a>scroll containers</a>. Some <a>scroll containers</a> may be part of a <a>containing block chain</a> but may serve a different logical purpose in the document and may want to prevent scrolling from continuing up the <a>scroll chain</a>. To achieve this, a content author will install event listeners without the <a>passive flag</a> set and will use <a>preventDefault</a> when there is a risk that scroll chaining will occur. This is detrimental for the following reasons:
3336
* The user agent may in the future introduce new input methods for scrolling that are not supported by the content author's event listeners.
3437
* A non passive event listener will delay scrolling because the user agent will have to wait for the result of the event listener to determine if <a>preventDefault</a> was called causing increased scroll latency.
35-
* When scrolling is performed near the edge of the <a>scroll boundary<a> the <a>default action</a> may cause both scrolling to the edge of the scrollable container and a <a>boundary default action</a>. Calling <a>preventDefault</a> will not only cancel the <a>boundary default action</a> but also the scroll to the edge of the <a>scrollport</a>.
38+
* When scrolling is performed near the edge of the <a>scroll boundary<a>, the <a>default action</a> may cause both scrolling to the edge of the <a>scroll container</a> and a <a>boundary default action</a>. Calling <a>preventDefault</a> will not only cancel the <a>boundary default action</a> but also the scroll to the edge of the <a>scrollport</a>.
3639
* The <a>default action</a> for the event may also provide additional behavior that the author does not want to cancel such as an overscroll affordance. <a>preventDefault</a> doesn't allow the content author to cancel only some of the <a>default actions</a> such as scroll chaining.
3740

3841
Thus, it is not possible for a content author to control <a>scroll chaining</a> and overscroll in a robust, performant and forward compatible way. The <a>scroll-boundary-behavior</a> property fixes this shortcoming.
@@ -47,33 +50,31 @@ Scroll chaining and boundary default actions {#scroll-chaining-and-boundary-defa
4750

4851
<em>Operating Systems have rules for scrolling such as scroll chaining and overscroll affordances. This specification does not mandate if and how scroll chaining or overscroll affordances be implemented. This specification only allows the content author to disable them if any are implemented.</em>
4952

50-
<dfn>Scroll chaining</dfn> is when scrolling is propagated from one scrollable container to an ancestor scrollable container following the <a>scroll chain</a>. Typically scroll chaining is performed starting at the event target recursing up the <a>containing block chain</a>. When a <a>potentially scrollable</a> element in this chain receives a scrollable event or gesture it may act on it and/or pass it up the chain. Chaining typically occurs when the <a>scrollport</a> has reached its boundary.
53+
<dfn>Scroll chaining</dfn> is when scrolling is propagated from one <a>scroll container</a> to an ancestor <a>scroll container</a> following the <a>scroll chain</a>. Typically scroll chaining is performed starting at the event target recursing up the <a>containing block chain</a>. When a <a>scroll container</a> in this chain receives a scroll event or gesture it may act on it and/or pass it up the chain. Chaining typically occurs when the <a>scrollport</a> has reached its boundary.
5154

52-
A <dfn>scroll chain</dfn> is the order in which scrolling is propagated from one scrollable container to another.
55+
A <dfn>scroll chain</dfn> is the order in which scrolling is propagated from one <a>scroll container</a> to another.
5356

54-
<dfn>Scroll boundary</dfn> refers to when the scroll position of a <a>potentially scrollable</a> element reaches the edge of the <a>scrollport<a>. In the non-scrollable case the element is always considered to be at the scroll boundary.
57+
<dfn>Scroll boundary</dfn> refers to when the scroll position of a <a>scroll container</a> reaches the edge of the <a>scrollport<a>. If a scroll container has no potential to scroll, because it does not <a>overflow</a> in the direction of the scroll, the element is always considered to be at the scroll boundary.
5558

5659
<dfn>Boundary default action</dfn> refers to the user-agent-defined <a>default action</a> performed when scrolling against the edge of the <a>scrollport</a>. This may be scroll chaining, showing an overscroll affordance and/or performing a navigation action.
5760

58-
Issue(WICG/scroll-boundary-behavior#4): Should this specification apply to a scrollable element, potentially scrollable element or any element.
59-
6061
Overview {#overview}
6162
==========================
6263

63-
This module introduces control over the behavior of a <a>potentially scrollable</a> element when its <a>scrollport</a> reaches the boundary of its scroll box. It allows the content author to specify that a <a>potentially scrollable</a> element must prevent scroll chaining and/or overscroll affordances.
64+
This module introduces control over the behavior of a <a>scroll container</a> element when its <a>scrollport</a> reaches the boundary of its scroll box. It allows the content author to specify that a <a>scroll container</a> element must prevent scroll chaining and/or overscroll affordances.
6465

6566
Scroll Boundary Behavior Properties {#scroll-boundary-behavior-properties}
6667
==========================
6768

68-
These properties specify how a <a>potentially scrollable</a> element must behave when scrolling. A element that is not <a>potentially scrollable</a> must accept but ignore the values of this property. This property must be applied to all input methods supported by the user agent.
69+
These properties specify how a <a>scroll container</a> element must behave when scrolling. A element that is not <a>scroll container</a> must accept but ignore the values of this property. This property must be applied to all input methods supported by the user agent.
6970

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

7273
<pre class=propdef>
7374
Name: scroll-boundary-behavior-x, scroll-boundary-behavior-y
7475
Value: ''contain'' | ''none'' | ''auto''
7576
Initial: ''auto''
76-
Applies to: <a>potentially scrollable</a> elements
77+
Applies to: <a>scroll container</a> elements
7778
Inherited: no
7879
Percentages: N/A
7980
Media: visual
@@ -88,7 +89,7 @@ The 'scroll-boundary-behavior-x' property specifies the behavior of the 'scroll-
8889
Name: scroll-boundary-behavior
8990
Value: ''contain'' | ''none'' | ''auto''
9091
Initial: ''auto''
91-
Applies to: <a>potentially scrollable</a> elements
92+
Applies to: <a>scroll container</a> elements
9293
Inherited: no
9394
Media: visual
9495
Computed value: see individual properties

0 commit comments

Comments
 (0)