You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To <dfn export>scroll a target into view</dfn><var>target</var>, which is an <a for="/">Element</a> or <a>Range</a>,
1448
+
1449
+
To <dfn export>determine the scroll-into-view position</dfn> of a <var>target</var>, which is an <a for="/">Element</a> or <a>Range</a>,
1449
1450
with a scroll behavior <var>behavior</var>,
1450
1451
a block flow direction position <var>block</var>,
1451
-
and an inline base direction position <var>inline</var>,
1452
-
means to run these steps for each ancestor element or <a>viewport</a>that establishes
1453
-
a <a>scrolling box</a><var>scrolling box</var>, in order of innermost to outermost <a>scrolling box</a>:
1452
+
an inline base direction position <var>inline</var>,
1453
+
and a <a>scrolling box</a><var>scrolling box</var>,
1454
+
run the following steps:
1454
1455
1455
-
1. If the {{Document}} associated with <var>target</var> is not <a>same origin</a> with the {{Document}} associated with the element or <a>viewport</a> associated with <var>scrolling box</var>, terminate these steps.
1456
1456
1. Let <var>target bounding border box</var> be the box represented by the return value of invoking Element's {{Element/getBoundingClientRect()}}, if <var>target</var> is an <a for="/">Element</a>, or Range's {{Range/getBoundingClientRect()}}, if <var>target</var> is a <a>Range</a>.
1457
1457
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>target bounding border box</var>'s edge on the same physical side as that of <var>scrolling box edge A</var>.
1458
1458
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>target bounding border box</var>'s edge on the same physical side as that of <var>scrolling box edge B</var>.
@@ -1496,7 +1496,19 @@ a <a>scrolling box</a> <var>scrolling box</var>, in order of innermost to outerm
1496
1496
<dt>If <var>element edge D</var> is outside <var>scrolling box edge D</var> and <var>element width</var> is less than <var>scrolling box width</var>
1497
1497
<dd>Align <var>element edge D</var> with <var>scrolling box edge D</var>.
1498
1498
</dl>
1499
+
1. Return <var>position</var>.
1500
+
1499
1501
1502
+
To <dfn export>scroll a target into view</dfn><var>target</var>, which is an <a for="/">Element</a> or <a>Range</a>,
1503
+
with a scroll behavior <var>behavior</var>,
1504
+
a block flow direction position <var>block</var>,
1505
+
and an inline base direction position <var>inline</var>,
1506
+
means to run these steps for each ancestor element or <a>viewport</a> that establishes
1507
+
a <a>scrolling box</a><var>scrolling box</var>, in order of innermost to outermost <a>scrolling box</a>:
1508
+
1509
+
1. If the {{Document}} associated with <var>target</var> is not <a>same origin</a> with the {{Document}} associated with the element or <a>viewport</a> associated with <var>scrolling box</var>, terminate these steps.
1510
+
1. Let <var>position</var> be the scroll position resulting from running the steps to <a>determine the scroll-into-view position</a> of <var>target</var> with <var>behavior</var> as the |scroll behavior|,
1511
+
<var>block</var> as the |block flow position|, <var>inline</var> as the |inline base direction position| and <var>scrolling box</var> as the |scrolling box|.
1500
1512
1. If <var>position</var> is the same as <var>scrolling box</var>'s current scroll position, and <var>scrolling box</var> does not have an ongoing <a>smooth scroll</a>, then return.
1501
1513
1. <dl class=switch>
1502
1514
<dt>If <var>scrolling box</var> is associated with an element
0 commit comments