diff --git a/cssom-view-1/Overview.bs b/cssom-view-1/Overview.bs index cd1d9b4b310a..d9d19eb8b85a 100644 --- a/cssom-view-1/Overview.bs +++ b/cssom-view-1/Overview.bs @@ -86,6 +86,7 @@ urlPrefix: http://heycam.github.io/webidl/ type: dfn; text: converted to an IDL value; url: dfn-convert-ecmascript-to-idl-value url: https://www.w3.org/TR/DOM-Level-3-Events/#interface-MouseEvent; type: interface; text: MouseEvent url: https://drafts.csswg.org/mediaqueries-4/#mf-colors; type: dfn; text: color media query +url: https://drafts.csswg.org/css-overscroll/#scroll-boundary; type: dfn; text: scroll boundary
@@ -381,13 +382,17 @@ the following steps must be run:
Otherwise, perform an instant scroll of box to position.
+The scroll is considered completed when there is no further changes needed for the scroll position for the
+current scroll.
+
When a user agent is to perform a smooth scroll of a scrolling box box to position,
it must update the scroll position of box in a user-agent-defined fashion over a user-agent-defined amount of time. When the scroll is
-completed, the scroll position of box must be position. The scroll can also
+completed, the scroll position of box must be position. The scroll can also
be aborted, either by an algorithm or by the user.
When a user agent is to perform an instant scroll of a scrolling box box to
-position, it must update the scroll position of box to position.
+position, it must update the scroll position of box to position and then the scroll is considered
+completed.
To scroll to the beginning of the document for a document document, follow these steps:
@@ -1564,6 +1569,22 @@ The offsetY attribute must follow these step
1. If the event's dispatch flag is set, return the y-coordinate of the position where the event occurred relative to the origin of the padding edge of the target node, ignoring the transforms that apply to the element and its ancestors, and terminate these steps.
1. Return the value of the event's {{MouseEvent/pageY}} attribute.
+Overscroll Event Interface
+
+
+dictionary OverscrollEventInit : EventInit {
+ double deltaX = 0.0;
+ double deltaY = 0.0;
+};
+interface OverscrollEvent : Event {
+ readonly attribute double deltaX;
+ readonly attribute double deltaY;
+};
+
+
+The deltaX attribute must return the overscroll amount in the horizontal direction.
+
+The deltaY attribute must return the overscroll amount in the vertical direction.
Geometry
@@ -1660,28 +1681,48 @@ When asked to run the resize steps for a {{Document}} doc,
This section integrates with the event loop defined in HTML. [[!HTML]]
-Each {{Document}} has an associated list of pending scroll event targets, initially empty.
+Each {{Document}} has an associated list of pending scroll event targets and an associated list of
+pending scrollend event targets, initially empty.
-Whenever a viewport gets scrolled (whether in response to user interaction or by an API), the user agent must run these steps:
+Whenever a viewport or an element gets scrolled (whether in response to user interaction or by an API), the user agent must run these steps:
-1. Let doc be the viewport’s associated {{Document}}.
-1. If doc is already in doc's pending scroll event targets, abort these steps.
-1. Append doc to doc's pending scroll event targets.
+1. If a viewport is getting scrolled, let doc be the viewport’s associated {{Document}} and target be the viewport.
+Otherwise, an element is gettings scolled and let doc be the element's node document and target be the element.
+1. If the target is at its scroll boundary and does not overflow in the direction of scroll, let type be "overscroll"
+and deltaX and deltaY be the scroll position difference if the target were to overflow in the direction of scroll hypothetically
+(e.g. deltaX = new hypothetical scroll position in X direction - real scroll position in X direction).
+Otherwise, let type be "scroll" and deltaX and deltaY be zero.
+1. Let scroll event target be (target, type, deltaX, deltaY).
+1. If a struct with target is already in doc's pending scroll event targets, then replace that item with scroll event target.
+Otherwise, append scroll event target to doc's pending scroll event targets.
-Whenever an element gets scrolled (whether in response to user interaction or by an API), the user agent must run these steps:
+Whenever a scrolling is completed, the user agent must run these steps:
-1. Let doc be the element's node document.
-1. If the element is already in doc's pending scroll event targets, abort these steps.
-1. Append the element to doc's pending scroll event targets.
+1. If scrolling was done on a viewport, let doc be the viewport’s associated {{Document}} and target be the viewport.
+Otherwise, scrolling is done on an element and let doc be the element's node document and target be the element.
+1. If target is already in doc's pending scrollend event targets, abort these steps.
+1. Append target to doc's pending scrollend event targets.
When asked to run the scroll steps for a {{Document}} doc, run these steps:
-1. For each item target in doc's pending scroll event targets,
+1. For each item (target, type, deltaX, deltaY) in doc's pending scroll event targets,
in the order they were added to the list, run these substeps:
- 1. If target is a {{Document}}, fire an event named scroll that bubbles at target.
- 1. Otherwise, fire an event named scroll at target.
+ 1. If type is "scroll", run these steps:
+ 1. If target is a {{Document}}, fire an event named scroll that bubbles at target.
+ 1. Otherwise, fire an event named scroll at target.
+ 1. If type is "overscroll", run these step:
+ 1. If target is a {{Document}}, fire an event named overscroll that bubbles at target
+ with attributes initalized to deltaX and deltaY.
+ 1. Otherwise, fire an event named scroll at target
+ with attributes initalized to deltaX and deltaY.
1. Empty doc's pending scroll event targets.
+1. For each item target in doc's pending scrollend event targets,
+ in the order they were added to the list, run these substeps:
+
+ 1. If target is a {{Document}}, fire an event named scrollend that bubbles at target.
+ 1. Otherwise, fire an event named scrollend at target.
+1. Empty doc's pending scrollend event targets.
Event summary
@@ -1694,18 +1735,38 @@ When asked to run the scroll steps for a {{Document}} doc,
Event
Interface
Interesting targets
+ Bubbles
+ Cancelable
Description
resize
{{Event}}
{{Window}}
+ No
+ No
Fired at the {{Window}} when the viewport is resized.
scroll
{{Event}}
{{Document}}, elements
+ Yes only if the target is {{Document}}
+ No
Fired at the {{Document}} or element when the viewport or element is scrolled, respectively.
+
+ overscroll
+ {{OverscrollEvent}}
+ {{Document}}, elements
+ Yes only if the target is {{Document}}
+ No
+ Fired at the {{Document}} or element when the viewport or element is overscrolled, respectively.
+
+ scrollend
+ {{Event}}
+ {{Document}}, elements
+ Yes only if the target is {{Document}}
+ No
+ Fired at the {{Document}} or element when the viewport or element scrolling is finished, respectively.
CSS properties