diff --git a/index.html b/index.html index 1136d210..d611779e 100644 --- a/index.html +++ b/index.html @@ -4496,27 +4496,45 @@
To scroll into view
- an element
- perform the following steps
- only if the element is not already in view:
+ a node
+ given optional arguments onlyIfNecessary (default true),
+ behavior (default "instant"),
+ block (default "end")
+ and inline (default "nearest"):
Let options be
- the following ScrollIntoViewOptions:
+
Let target be determined as follows: -
behavior"
- instant"
+ Let target be node. + +
If onlyIfNecessary is true + and target is in view, return. +
block"
- end"
+ Let target be a new {{Range}} obtained by calling + {{Document/createRange()}} on node's [=Node/node document=] + and then invoking {{Range/selectNodeContents()}} on it with node + as argument. -
inline"
- nearest"
+ If onlyIfNecessary is true + and the target range is in view, return. +
Run Function.[[\Call]](scrollIntoView, options) - with element as the this value. +
Let promise be the result of scroll into view target + with scroll behavior behavior, + block flow direction position block, + and inline base direction position inline. + +
Return promise.
Editable elements @@ -4716,6 +4734,46 @@
Return the elements from point given the coordinates center point. + +
A {{Range}} is in view + if the first {{DOMRect}} + returned by calling {{Range/getClientRects()}} on it + overlaps the viewport. + It can be checked this way: + +
Let rectangles be + the {{DOMRect}} sequence + returned by calling {{Range/getClientRects()}} on the {{Range}}. + +
If rectangles has the length of 0, return false. + +
Let rectangle be the first object in rectangles. + +
Return true if all of the following conditions are true, + and false otherwise: +
min(rectangle's x coordinate, + rectangle's x coordinate + + rectangle's width dimension) + is less than innerWidth. + +
max(rectangle's x coordinate, + rectangle's x coordinate + + rectangle's width dimension) + is greater than 0. + +
min(rectangle's y coordinate, + rectangle's y coordinate + + rectangle's height dimension) + is less than innerHeight. + +
max(rectangle's y coordinate, + rectangle's y coordinate + + rectangle's height dimension) + is greater than 0. +
To create a null input source, return a new null input
@@ -8507,8 +8569,8 @@ If type is "Processing actions
none"
let action be the result of trying to process
- a null action with parameters id, and
- action item.
+ a null action
Otherwise, if type is "
To process a null action given
-id and action item:
+id, action item, and actions options:
@@ -8591,7 +8653,9 @@
-If subtype is not "
@@ -8601,12 +8665,15 @@
-Let result be the result
-of trying to process a pause action
+If subtype is "
-Return result.
+If subtype is "
@@ -8833,6 +8900,76 @@ Return success with data action.
+ To process a scrollIntoView action given action item,
+action, and actions options: Let node be the result of getting the property
+ " If actions options' is element origin steps
+ given node return false, return error with
+ error code invalid argument.
+
+ Set the Let onlyIfNecessary be the result of getting the
+ property " If onlyIfNecessary is undefined, let
+ onlyIfNecessary be true.
+
+ If onlyIfNecessary is not a boolean, return
+ error with error code invalid argument.
+
+ Set the Let behavior be the result of getting the property
+ " If behavior is undefined, let
+ behavior be " If behavior is not one of the values
+ " Set the Let block be the result of getting the property
+ " If block is undefined, let
+ block be " If block is not one of the values
+ " Set the Let inline be the result of getting the property
+ " If inline is undefined, let
+ inline be " If inline is not one of the values
+ " Set the Return success with data action.
+ To process a pointer up or pointer down action
given action item, and action: To dispatch a scrollIntoView action given action
+object, source, global key state,
+tick duration, browsing context,
+and actions options:
+
+ Let node be the result of trying to run
+ actions options' get element origin steps with
+ the If node is null, return error with
+ error code no such element.
+
+ Let onlyIfNecessary be the Let behavior be the Let block be the Let inline be the Let promise be the result of scroll into view node with
+ onlyIfNecessary, behavior, block,
+ and inline.
+
+ Asynchronously wait for promise to resolve.
+
+ key"
let action be the result of trying to process
@@ -8583,7 +8645,7 @@ Processing actions
Processing actions
named "type" from action item.
pause",
+If subtype is not one of the values
+"pause"
+or "scrollIntoView",
return error with error code invalid argument.
Processing actions
and subtype.
pause",
+return the result of trying to process a pause action
with arguments action item and action.
scrollIntoView",
+return the result of trying to process a scrollIntoView action
+with arguments action item, action,
+and actions options.
Processing actions
+
+
node" from action item.
+
+ node property of action
+ to node.
+
+ onlyIfNecessary" from action item.
+
+ onlyIfNecessary property of action
+ to onlyIfNecessary.
+
+ behavior" from action item.
+
+ instant".
+
+ auto", "instant" or "smooth", return error
+ with error code invalid argument.
+
+ behavior property of action
+ to behavior.
+
+ block" from action item.
+
+ end".
+
+ start", "center", "end",
+ or "nearest", return error with
+ error code invalid argument.
+
+ block property of action
+ to block.
+
+ inline" from action item.
+
+ nearest".
+
+ start", "center", "end",
+ or "nearest", return error with
+ error code invalid argument.
+
+ inline property of action
+ to inline.
+
+ Dispatching actions
source type subtype Dispatch action algorithm
" none" " pause" Dispatch a pause action
+ " none" " scrollIntoView" Dispatch a scrollIntoView action
" key" " pause" Dispatch a pause action
" key" " keyDown" Dispatch a keyDown action
" key" " keyUp" Dispatch a keyUp action
@@ -9330,6 +9468,41 @@ General actions
+
+
+
@@ -11932,10 +12105,11 @@ node property of action object
+ and browsing context.
+
+ onlyIfNecessary
+ property of action object.
+
+ behavior
+ property of action object.
+
+ block
+ property of action object.
+
+ inline
+ property of action object.
+
+ Index
sometimes here referred to as the viewport.
- Index
ScrollIntoViewOptions
- block"
- inline"
+