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
Copy file name to clipboardExpand all lines: cssom-view-1/Overview.bs
+18-6Lines changed: 18 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -412,9 +412,11 @@ This specification depends on the WHATWG Infra standard. [[!INFRA]]
412
412
413
413
<h3 id=scrolling>Scrolling</h3>
414
414
415
+
<div algorithm="perform a scroll of a box">
416
+
415
417
When a user agent is to <dfn export>perform a scroll</dfn> of a <a>scrolling box</a><var>box</var>,
416
418
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>
418
420
(which is "<code>auto</code>" if omitted),
419
421
the following steps must be run:
420
422
@@ -434,6 +436,10 @@ the following steps must be run:
434
436
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.
435
437
</ol>
436
438
439
+
</div>
440
+
441
+
<div algorithm="perform a scroll of a viewport">
442
+
437
443
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>
438
444
(which is "<code>auto</code>" if omitted) it must perform a coordinated viewport scroll by following these steps:
439
445
@@ -464,6 +470,8 @@ so that the layout viewport is scrolled before the visual viewport. This is done
464
470
reasons to ensure consistent scroll event ordering. See the <a href="#example-vvanimation">example
465
471
above</a> for a visual depiction.
466
472
473
+
</div>
474
+
467
475
<div class='example'>
468
476
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
469
477
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
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>,
1450
1459
with a scroll behavior <var>behavior</var>,
1451
1460
a block flow direction position <var>block</var>,
1452
1461
an inline base direction position <var>inline</var>,
@@ -1497,9 +1506,10 @@ run the following steps:
1497
1506
<dd>Align <var>element edge D</var> with <var>scrolling box edge D</var>.
1498
1507
</dl>
1499
1508
1. Return <var>position</var>.
1509
+
</div>
1500
1510
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>,
1503
1513
with a scroll behavior <var>behavior</var>,
1504
1514
a block flow direction position <var>block</var>,
1505
1515
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
1522
1532
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>
1523
1533
as the scroll behavior.
1524
1534
</dl>
1535
+
</div>
1525
1536
1537
+
<div algorithm>
1526
1538
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:
1528
1540
1529
1541
1. Let <var>box</var> be <var>element</var>'s associated <a>scrolling box</a>.
1530
1542
1. <dl class=switch>
@@ -1544,7 +1556,7 @@ To <dfn>scroll an element</dfn> <var>element</var> to <var>x</var>,<var>y</var>
1544
1556
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>.
1545
1557
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.
1546
1558
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>
1548
1560
1549
1561
1550
1562
<h2 id=extensions-to-the-htmlelement-interface>Extensions to the {{HTMLElement}} Interface</h2>
0 commit comments