Skip to content

Commit 3935c33

Browse files
committed
[cssom-view] Make the various scrolling algorithms accept a pseudo-element.
1 parent 582de32 commit 3935c33

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

cssom-view-1/Overview.bs

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -412,9 +412,11 @@ This specification depends on the WHATWG Infra standard. [[!INFRA]]
412412

413413
<h3 id=scrolling>Scrolling</h3>
414414

415+
<div algorithm="perform a scroll of a box">
416+
415417
When a user agent is to <dfn export>perform a scroll</dfn> of a <a>scrolling box</a> <var>box</var>,
416418
to a given position <var>position</var>,
417-
an associated element <var>element</var> and optionally a scroll behavior <var>behavior</var>
419+
an associated element or [=pseudo-element=] <var>element</var> and optionally a scroll behavior <var>behavior</var>
418420
(which is "<code>auto</code>" if omitted),
419421
the following steps must be run:
420422

@@ -434,6 +436,10 @@ the following steps must be run:
434436
Note: If the scroll position did not change as a result of the user interaction or programmatic invocation, where no translations were applied as a result, then no <a event>scrollend</a> event fires because no scrolling occurred.
435437
</ol>
436438

439+
</div>
440+
441+
<div algorithm="perform a scroll of a viewport">
442+
437443
When a user agent is to <dfn for="viewport" export>perform a scroll</dfn> of a <a>viewport</a> to a given position <var>position</var> and optionally a scroll behavior <var>behavior</var>
438444
(which is "<code>auto</code>" if omitted) it must perform a coordinated viewport scroll by following these steps:
439445

@@ -464,6 +470,8 @@ so that the layout viewport is scrolled before the visual viewport. This is done
464470
reasons to ensure consistent scroll event ordering. See the <a href="#example-vvanimation">example
465471
above</a> for a visual depiction.
466472

473+
</div>
474+
467475
<div class='example'>
468476
The user pinch-zooms into the document and ticks their mouse wheel, requesting the user agent scroll the document down by 50px. Because the document
469477
is pinch-zoomed in, the visual viewport has 20px of room to scroll. The user agent distributes the scroll by scrolling the visual viewport down by
@@ -1445,8 +1453,9 @@ The <dfn attribute for=Element>currentCSSZoom</dfn> attribute must return the
14451453

14461454
<h3 id=element-scrolling-members>{{Element}} Scrolling Members</h3>
14471455

1456+
<div algorithm>
14481457

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>,
1458+
To <dfn export>determine the scroll-into-view position</dfn> of a <var>target</var>, which is an <a for="/">Element</a>, [=pseudo-element=], or <a>Range</a>,
14501459
with a scroll behavior <var>behavior</var>,
14511460
a block flow direction position <var>block</var>,
14521461
an inline base direction position <var>inline</var>,
@@ -1497,9 +1506,10 @@ run the following steps:
14971506
<dd>Align <var>element edge D</var> with <var>scrolling box edge D</var>.
14981507
</dl>
14991508
1. Return <var>position</var>.
1509+
</div>
15001510

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>,
1511+
<div algorithm>
1512+
To <dfn export>scroll a target into view</dfn> <var>target</var>, which is an <a for="/">Element</a>, [=pseudo-element=], or <a>Range</a>,
15031513
with a scroll behavior <var>behavior</var>,
15041514
a block flow direction position <var>block</var>,
15051515
and an inline base direction position <var>inline</var>,
@@ -1522,9 +1532,11 @@ a <a>scrolling box</a> <var>scrolling box</var>, in order of innermost to outerm
15221532
1. <a for="viewport">Perform a scroll</a> of the <a>viewport</a> to <var>position</var>, with <var>root element</var> as the associated element and <var>behavior</var>
15231533
as the scroll behavior.
15241534
</dl>
1535+
</div>
15251536

1537+
<div algorithm>
15261538

1527-
To <dfn>scroll an element</dfn> <var>element</var> to <var>x</var>,<var>y</var> optionally with a scroll behavior <var>behavior</var> (which is "<code>auto</code>" if omitted) means to:
1539+
To <dfn>scroll an element</dfn> (or [=pseudo-element=]) <var>element</var> to <var>x</var>,<var>y</var> optionally with a scroll behavior <var>behavior</var> (which is "<code>auto</code>" if omitted) means to:
15281540

15291541
1. Let <var>box</var> be <var>element</var>'s associated <a>scrolling box</a>.
15301542
1. <dl class=switch>
@@ -1544,7 +1556,7 @@ To <dfn>scroll an element</dfn> <var>element</var> to <var>x</var>,<var>y</var>
15441556
1. Let <var>position</var> be the scroll position <var>box</var> would have by aligning <a>scrolling area</a> x-coordinate <var>x</var> with the left of <var>box</var> and aligning <a>scrolling area</a> y-coordinate <var>y</var> with the top of <var>box</var>.
15451557
1. If <var>position</var> is the same as <var>box</var>'s current scroll position, and <var>box</var> does not have an ongoing <a>smooth scroll</a>, abort these steps.
15461558
1. <a for="/">Perform a scroll</a> of <var>box</var> to <var>position</var>, <var>element</var> as the associated element and <var>behavior</var> as the scroll behavior.
1547-
1559+
</div>
15481560

15491561

15501562
<h2 id=extensions-to-the-htmlelement-interface>Extensions to the {{HTMLElement}} Interface</h2>

0 commit comments

Comments
 (0)