Skip to content

Commit 9c4db03

Browse files
committed
Change notIfViewed to scroll:"always"/"if-needed"
1 parent 4dcee05 commit 9c4db03

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

cssom-view/Overview.bs

+8-7
Original file line numberDiff line numberDiff line change
@@ -1073,14 +1073,15 @@ Note: This {{DOMRect}} object is not <a spec=html>live</a>.
10731073
<h2 id=extension-to-the-element-interface>Extensions to the {{Element}} Interface</h2>
10741074

10751075
<pre class=idl>
1076+
enum ScrollIntoViewMode { "always", "if-needed" };
10761077
enum ScrollLogicalPosition { "start", "center", "end", "nearest" };
10771078
dictionary ScrollIntoViewOptions : ScrollOptions {
1078-
boolean notIfViewed = false;
1079+
ScrollIntoViewMode scroll = "always";
10791080
ScrollLogicalPosition block = "start";
10801081
ScrollLogicalPosition inline = "nearest";
10811082
};
10821083
dictionary FocusScrollOptions : ScrollOptions {
1083-
boolean notIfViewed = true;
1084+
ScrollIntoViewMode scroll = "if-needed";
10841085
ScrollLogicalPosition block;
10851086
ScrollLogicalPosition inline;
10861087
};
@@ -1153,16 +1154,16 @@ The <dfn method for=Element caniuse=scrollintoview>scrollIntoView(<var>arg</var>
11531154
1. Let <var>behavior</var> be "<code>auto</code>".
11541155
1. Let <var>block</var> be "<code>start</code>".
11551156
1. Let <var>inline</var> be "<code>nearest</code>".
1156-
1. Let <var>notIfViewed</var> be false.
1157+
1. Let <var>scrollMode</var> be "<code>always</code>".
11571158
1. If <var>arg</var> is a {{ScrollIntoViewOptions}} dictionary, then:
11581159
1. Set <var>behavior</var> to the {{ScrollOptions/behavior}} dictionary member of <var>options</var>.
11591160
1. Set <var>block</var> to the {{ScrollIntoViewOptions/block}} dictionary member of <var>options</var>.
11601161
1. Set <var>inline</var> to the {{ScrollIntoViewOptions/inline}} dictionary member of <var>options</var>.
1161-
1. Set <var>notIfViewed</var> to the {{ScrollIntoViewOptions/notIfViewed}} dictionary member of <var>options</var>.
1162+
1. Set <var>scrollMode</var> to the {{ScrollIntoViewOptions/scroll}} dictionary member of <var>options</var>.
11621163
1. Otherwise, if <var>arg</var> is false, then set <var>block</var> to "<code>end</code>".
11631164
1. If the element does not have any associated <a>layout box</a>, then return.
11641165
1. <a lt='scroll an element into view'>Scroll the element into view</a>
1165-
with <var>behavior</var>, <var>block</var>, <var>inline</var>, and <var>notIfViewed</var>.
1166+
with <var>behavior</var>, <var>block</var>, <var>inline</var>, and <var>scrollMode</var>.
11661167
1. Optionally perform some other action that brings the element to the user's attention.
11671168

11681169
The <dfn method for=Element lt="scroll(options)|scroll(x, y)">scroll()</dfn> method must run these steps:
@@ -1315,7 +1316,7 @@ The <dfn attribute for=Element>clientHeight</dfn> attribute must run these steps
13151316

13161317
To <dfn>scroll an element into view</dfn> <var>element</var>,
13171318
with a scroll behavior <var>behavior</var>,
1318-
a boolean indicating to not scroll if the element is already in view <var>notIfViewed</var>,
1319+
a mode indicating whether to scroll if the element is already in view <var>scrollMode</var>,
13191320
optionally a block flow direction position <var>block</var> (undefined if not given),
13201321
and optionally an inline base direction position <var>inline</var> (undefined if not given),
13211322
means to run these steps for each ancestor element or <a>viewport</a> that establishes
@@ -1329,7 +1330,7 @@ a <a>scrolling box</a> <var>scrolling box</var>, in order of innermost to outerm
13291330
1. Let <var>scrolling box edge D</var> be the <a>ending edge</a> in the <a>inline base direction</a> of <var>scrolling box</var>, and let <var>element edge D</var> be <var>element bounding border box</var>'s edge on the same physical side as that of <var>scrolling box edge D</var>.
13301331
1. Let <var>element width</var> be the distance between <var>element edge C</var> and <var>element edge D</var>.
13311332
1. Let <var>scrolling box width</var> be the distance between <var>scrolling box edge C</var> and <var>scrolling box edge D</var>.
1332-
1. If <var>notIfViewed</var> is true, and <var>element</var> is entirely in view already, then return.
1333+
1. If <var>scrollMode</var> is "<code>if-needed</code>", and <var>element</var> is entirely in view already, then return.
13331334

13341335
ISSUE: Define "entirely in view".
13351336

0 commit comments

Comments
 (0)