Skip to content

Commit 14df329

Browse files
committed
Change notIfViewed to scroll:"always"/"if-needed"
1 parent 6f309eb commit 14df329

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

cssom-view-1/Overview.bs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,14 +1078,15 @@ Note: This {{DOMRect}} object is not <a spec=html>live</a>.
10781078
<h2 id=extension-to-the-element-interface>Extensions to the {{Element}} Interface</h2>
10791079

10801080
<pre class=idl>
1081+
enum ScrollIntoViewMode { "always", "if-needed" };
10811082
enum ScrollLogicalPosition { "start", "center", "end", "nearest" };
10821083
dictionary ScrollIntoViewOptions : ScrollOptions {
1083-
boolean notIfViewed = false;
1084+
ScrollIntoViewMode scroll = "always";
10841085
ScrollLogicalPosition block = "start";
10851086
ScrollLogicalPosition inline = "nearest";
10861087
};
10871088
dictionary FocusScrollOptions : ScrollOptions {
1088-
boolean notIfViewed = true;
1089+
ScrollIntoViewMode scroll = "if-needed";
10891090
ScrollLogicalPosition block;
10901091
ScrollLogicalPosition inline;
10911092
};
@@ -1158,16 +1159,16 @@ The <dfn method for=Element caniuse=scrollintoview>scrollIntoView(<var>arg</var>
11581159
1. Let <var>behavior</var> be "<code>auto</code>".
11591160
1. Let <var>block</var> be "<code>start</code>".
11601161
1. Let <var>inline</var> be "<code>nearest</code>".
1161-
1. Let <var>notIfViewed</var> be false.
1162+
1. Let <var>scrollMode</var> be "<code>always</code>".
11621163
1. If <var>arg</var> is a {{ScrollIntoViewOptions}} dictionary, then:
11631164
1. Set <var>behavior</var> to the {{ScrollOptions/behavior}} dictionary member of <var>options</var>.
11641165
1. Set <var>block</var> to the {{ScrollIntoViewOptions/block}} dictionary member of <var>options</var>.
11651166
1. Set <var>inline</var> to the {{ScrollIntoViewOptions/inline}} dictionary member of <var>options</var>.
1166-
1. Set <var>notIfViewed</var> to the {{ScrollIntoViewOptions/notIfViewed}} dictionary member of <var>options</var>.
1167+
1. Set <var>scrollMode</var> to the {{ScrollIntoViewOptions/scroll}} dictionary member of <var>options</var>.
11671168
1. Otherwise, if <var>arg</var> is false, then set <var>block</var> to "<code>end</code>".
11681169
1. If the element does not have any associated <a>layout box</a>, then return.
11691170
1. <a lt='scroll an element into view'>Scroll the element into view</a>
1170-
with <var>behavior</var>, <var>block</var>, <var>inline</var>, and <var>notIfViewed</var>.
1171+
with <var>behavior</var>, <var>block</var>, <var>inline</var>, and <var>scrollMode</var>.
11711172
1. Optionally perform some other action that brings the element to the user's attention.
11721173

11731174
The <dfn method for=Element lt="scroll(options)|scroll(x, y)">scroll()</dfn> method must run these steps:
@@ -1320,7 +1321,7 @@ The <dfn attribute for=Element>clientHeight</dfn> attribute must run these steps
13201321

13211322
To <dfn>scroll an element into view</dfn> <var>element</var>,
13221323
with a scroll behavior <var>behavior</var>,
1323-
a boolean indicating to not scroll if the element is already in view <var>notIfViewed</var>,
1324+
a mode indicating whether to scroll if the element is already in view <var>scrollMode</var>,
13241325
optionally a block flow direction position <var>block</var> (undefined if not given),
13251326
and optionally an inline base direction position <var>inline</var> (undefined if not given),
13261327
means to run these steps for each ancestor element or <a>viewport</a> that establishes
@@ -1334,7 +1335,7 @@ a <a>scrolling box</a> <var>scrolling box</var>, in order of innermost to outerm
13341335
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>.
13351336
1. Let <var>element width</var> be the distance between <var>element edge C</var> and <var>element edge D</var>.
13361337
1. Let <var>scrolling box width</var> be the distance between <var>scrolling box edge C</var> and <var>scrolling box edge D</var>.
1337-
1. If <var>notIfViewed</var> is true, and <var>element</var> is entirely in view already, then return.
1338+
1. If <var>scrollMode</var> is "<code>if-needed</code>", and <var>element</var> is entirely in view already, then return.
13381339

13391340
ISSUE: Define "entirely in view".
13401341

0 commit comments

Comments
 (0)