Skip to content

Commit 1d1b7ff

Browse files
committed
merge
2 parents 23e998e + 4dd6811 commit 1d1b7ff

1 file changed

Lines changed: 34 additions & 12 deletions

File tree

cssom-view/Overview.bs

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ url: http://www.w3.org/TR/DOM-Level-3-Events/#interface-MouseEvent; type: interf
8484
spec:dom-ls; type:method; text:addEventListener()
8585
spec:css-display-3; type:value; for:display; text:table
8686
spec:css-position-3; type:property; text:position
87+
spec:dom-ls; type:interface; text:Document
8788
</pre>
8889

8990
<script src=https://resources.whatwg.org/file-bug.js async></script>
@@ -990,9 +991,10 @@ Extensions to the {{Element}} Interface {#extension-to-the-element-interface}
990991
=============================================================================
991992

992993
<pre class=idl>
993-
enum ScrollLogicalPosition { "start", "end" };
994+
enum ScrollLogicalPosition { "start", "center", "end", "nearest" };
994995
dictionary ScrollIntoViewOptions : ScrollOptions {
995-
ScrollLogicalPosition block = "start";
996+
ScrollLogicalPosition block = "center";
997+
ScrollLogicalPosition inline = "center";
996998
};
997999

9981000
partial interface Element {
@@ -1049,16 +1051,16 @@ algorithm:
10491051

10501052
The <dfn method for=Element>scrollIntoView(<var>arg</var>)</dfn> method must run these steps:
10511053

1052-
<!-- scrollIntoView() means top=true but scrollIntoView(undefined) means top=false, to align with impls. -->
1054+
<!-- scrollIntoView() means arg=true but scrollIntoView(undefined) means arg=false, to align with impls. -->
10531055

10541056
1. Let <var>options</var> be null.
10551057
1. If <var>arg</var> is an object, let <var>options</var> be <var>arg</var>.
10561058
1. <a lt="converted to an IDL value">Convert</a> <var>options</var> to a {{ScrollIntoViewOptions}} dictionary. [[!WEBIDL]]
1057-
1. If <var>arg</var> is false, let the {{ScrollIntoViewOptions/block}} dictionary member of <var>options</var> have the value "<code>end</code>".
1059+
1. If <var>arg</var> is not specified or is true, let the {{ScrollIntoViewOptions/block}} dictionary member of <var>options</var> have the value "<code>start</code>", and let the {{ScrollIntoViewOptions/inline}} dictionary member of <var>options</var> have the value "<code>nearest</code>".
1060+
1. If <var>arg</var> is false, let the {{ScrollIntoViewOptions/block}} dictionary member of <var>options</var> have the value "<code>end</code>", and let the {{ScrollIntoViewOptions/inline}} dictionary member of <var>options</var> have the value "<code>nearest</code>".
10581061
1. If the element does not have any associated <a>layout box</a> terminate these steps.
10591062
1. <a lt='scroll an element into view'>Scroll the element into view</a>
1060-
with the <i>align to top</i> flag set if <var>options</var> {{ScrollIntoViewOptions/block}} dictionary member has the value "<code>start</code>",
1061-
and the scroll behavior being the value of the {{ScrollOptions/behavior}} dictionary member of <var>options</var>.
1063+
with the options <var>options</var>.
10621064
1. Optionally perform some other action that brings the element to the user's attention.
10631065

10641066
The <dfn method for=Element lt="scroll(options)|scroll(x, y)">scroll()</dfn> method must run these steps:
@@ -1218,23 +1220,42 @@ document are not reflected in the objects.
12181220
{{Element}} Scrolling Members {#element-scrolling-members}
12191221
----------------------------------------------------------
12201222

1221-
To <dfn>scroll an element into view</dfn> <var>element</var>, optionally with an <i>align to top flag</i> set, and optionally with a scroll behavior
1222-
<var>behavior</var> (which is <code>"auto"</code> if omitted), means to run these steps for each ancestor element or <a>viewport</a> that establishes
1223+
To <dfn>scroll an element into view</dfn> <var>element</var>,
1224+
with a {{ScrollIntoViewOptions}} dictionary <var>options</var>,
1225+
means to run these steps for each ancestor element or <a>viewport</a> that establishes
12231226
a <a>scrolling box</a> <var>scrolling box</var>, in order of innermost to outermost <a>scrolling box</a>:
12241227

12251228
1. If the {{Document}} associated with <var>element</var> is not <a>same origin</a> with the {{Document}} associated with the element or <a>viewport</a> associated with <var>box</var>, terminate these steps.
12261229
1. Let <var>element bounding border box</var> be the box that the return value of invoking {{Element/getBoundingClientRect()}} on <var>element</var> represents.
12271230
1. Let <var>scrolling box edge A</var> be the <a>beginning edge</a> in the <a>block flow direction</a> of <var>scrolling box</var>, and let <var>element edge A</var> be <var>element bounding border box</var>'s edge on the same physical side as that of <var>scrolling box edge A</var>.
12281231
1. Let <var>scrolling box edge B</var> be the <a>ending edge</a> in the <a>block flow direction</a> of <var>scrolling box</var>, and let <var>element edge B</var> be <var>element bounding border box</var>'s edge on the same physical side as that of <var>scrolling box edge B</var>.
12291232
1. Let <var>scrolling box edge C</var> be the <a>beginning edge</a> in the <a>inline base direction</a> of <var>scrolling box</var>, and let <var>element edge C</var> be <var>element bounding border box</var>'s edge on the same physical side as that of <var>scrolling box edge C</var>.
1230-
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>box edge D</var>.
1233+
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>.
12311234
1. Let <var>element width</var> be the distance between <var>element edge C</var> and <var>element edge D</var>.
12321235
1. Let <var>scrolling box width</var> be the distance between <var>scrolling box edge C</var> and <var>scrolling box edge D</var>.
12331236
1. Let <var>position</var> be the scroll position <var>scrolling box</var> would have by following these steps:
12341237

1235-
1. If the <i>align to top flag</i> is set align <var>element edge A</var> with <var>scrolling box edge A</var>.
1236-
1. Otherwise, the <i>align to top flag</i> is not set; align <var>element edge B</var> with <var>scrolling box edge B</var>.
1237-
1. <dl class=switch>
1238+
1. If the {{ScrollIntoViewOptions/block}} dictionary member of <var>options</var> is "start", align <var>element edge A</var> with <var>scrolling box edge A</var>.
1239+
1. Otherwise, if the {{ScrollIntoViewOptions/block}} dictionary member of <var>options</var> is "end"; align <var>element edge B</var> with <var>scrolling box edge B</var>.
1240+
1. Otherwise, if the {{ScrollIntoViewOptions/block}} dictionary member of <var>options</var> is "center"; align the center of <var>element bounding border box</var> with the center of <var>scrolling box</var> in <var>scrolling box</var>'s <a>block flow direction</a>.
1241+
1. Otherwise, it is "nearest"; follow these steps:
1242+
<dl class=switch>
1243+
<dt>If <var>element edge A</var> and <var>element edge B</var> are both outside <var>scrolling box edge A</var> and <var>scrolling box edge B</var>
1244+
<dd>Do nothing.
1245+
1246+
<dt>If <var>element edge A</var> is outside <var>scrolling box edge A</var> and <var>element width</var> is less than <var>scrolling box width</var>
1247+
<dt>If <var>element edge B</var> is outside <var>scrolling box edge B</var> and <var>element width</var> is greater than <var>scrolling box width</var>
1248+
<dd>Align <var>element edge A</var> with <var>scrolling box edge A</var>.
1249+
1250+
<dt>If <var>element edge A</var> is outside <var>scrolling box edge A</var> and <var>element width</var> is greater than <var>scrolling box width</var>
1251+
<dt>If <var>element edge B</var> is outside <var>scrolling box edge B</var> and <var>element width</var> is less than <var>scrolling box width</var>
1252+
<dd>Align <var>element edge B</var> with <var>scrolling box edge B</var>.
1253+
</dl>
1254+
1. If the {{ScrollIntoViewOptions/inline}} dictionary member of <var>options</var> is "start", align <var>element edge C</var> with <var>scrolling box edge C</var>.
1255+
1. Otherwise, if the {{ScrollIntoViewOptions/inline}} dictionary member of <var>options</var> is "end"; align <var>element edge D</var> with <var>scrolling box edge D</var>.
1256+
1. Otherwise, if the {{ScrollIntoViewOptions/inline}} dictionary member of <var>options</var> is "center", align the center of <var>element bounding border box</var> with the center of <var>scrolling box</var> in <var>scrolling box</var>'s <a>inline base direction</a>.
1257+
1. Otherwise, it is "nearest"; follow these steps:
1258+
<dl class=switch>
12381259
<dt>If <var>element edge C</var> and <var>element edge D</var> are both outside <var>scrolling box edge C</var> and <var>scrolling box edge D</var>
12391260
<dd>Do nothing.
12401261

@@ -1258,6 +1279,7 @@ a <a>scrolling box</a> <var>scrolling box</var>, in order of innermost to outerm
12581279
Let <var>document</var> be the <a>viewport’s</a> associated {{Document}}.
12591280
Let <var>associated element</var> be <var>document</var>'s root element, if there is one, or null otherwise.
12601281
</dl>
1282+
1. Let <var>behavior</var> be the {{ScrollOptions/behavior}} dictionary member of <var>options</var>.
12611283
1. <a>Perform a scroll</a> of <var>scrolling box</var> to <var>position</var>, <var>associated element</var> as the associated element and <var>behavior</var> as the scroll behavior.
12621284

12631285

0 commit comments

Comments
 (0)