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
<p>The<dfnid="beginning-of-the-document">beginning of the document</dfn> is the scroll position the <ahref="#viewport">viewport</a> would have by aligning the <ahref="#beginning-edges">beginning edges</a>of the <ahref="#scrolling-area">scrolling area</a> with the <ahref="#beginning-edges">beginning edges</a> of the <ahref="#viewport">viewport</a>.
488
+
<p>To<dfnid="scroll-to-the-beginning-of-the-document">scroll to the beginningof the document</dfn> for a document <var>document</var>, follow these steps:
489
489
490
-
<pclass="note">The <ahref="#beginning-of-the-document">beginning of the document</a> concept is used when navigating to the <codetitle="">#top</code> fragment identifier, as defined in HTML.
491
-
<ahref="#refsHTML">[HTML]</a>
490
+
<ol>
491
+
<li><p>Let <var>viewport</var> be the <ahref="#viewport">viewport</a> that is associated with <var>document</var>. <!-- This assumes that there is a viewport, since
492
+
it is only invoked when navigating -->
493
+
<li><p>Let <var>position</var> be the the scroll position the <ahref="#viewport">viewport</a> would have by aligning the <ahref="#beginning-edges">beginning edges</a> of the
494
+
<ahref="#scrolling-area">scrolling area</a> with the <ahref="#beginning-edges">beginning edges</a> of the <ahref="#viewport">viewport</a>.
495
+
<li><p>Let <var>task</var> be these steps:
496
+
<ol>
497
+
<li><p><aclass="external" data-anolis-spec="dom" href="http://dom.spec.whatwg.org/#concept-event-fire" title="concept-event-fire">Fire an event</a> named <codetitle="">scroll</code> that bubbles at <var>document</var>.
498
+
</ol>
499
+
<li><p><ahref="#perform-a-scroll">Perform a scroll</a> of <var>viewport</var> to <var>position</var>, with the set of steps <var>task</var>, and <var>document</var>'s root
500
+
element as the associated element, if there is one, or null otherwise.
501
+
</ol>
502
+
503
+
<pclass="note">This algorithm is used when navigating to the <codetitle="">#top</code> fragment identifier, as defined in HTML. <ahref="#refsHTML">[HTML]</a>
492
504
493
505
<h2id="extensions-to-the-window-interface"><spanclass="secno">5 </span>Extensions to the <codetitle="">Window</code> Interface</h2>
Copy file name to clipboardExpand all lines: cssom-view/Overview.src.html
+15-3Lines changed: 15 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -445,10 +445,22 @@ <h3>Scrolling</h3>
445
445
446
446
<h4>Common Scroll Positions</h4>
447
447
448
-
<p>The<dfn>beginning of the document</dfn> is the scroll position the <span>viewport</span> would have by aligning the <span>beginning edges</span>of the <span>scrolling area</span> with the <span>beginning edges</span> of the <span>viewport</span>.
448
+
<p>To<dfn>scroll to the beginning of the document</dfn> for a document <var>document</var>, follow these steps:
449
449
450
-
<pclass=note>The <span>beginning of the document</span> concept is used when navigating to the <codetitle>#top</code> fragment identifier, as defined in HTML.
451
-
<spandata-anolis-ref>HTML</span>
450
+
<ol>
451
+
<li><p>Let <var>viewport</var> be the <span>viewport</span> that is associated with <var>document</var>. <!-- This assumes that there is a viewport, since
452
+
it is only invoked when navigating -->
453
+
<li><p>Let <var>position</var> be the the scroll position the <span>viewport</span> would have by aligning the <span>beginning edges</span> of the
454
+
<span>scrolling area</span> with the <span>beginning edges</span> of the <span>viewport</span>.
455
+
<li><p>Let <var>task</var> be these steps:
456
+
<ol>
457
+
<li><p><spandata-anolis-spec=domtitle=concept-event-fire>Fire an event</span> named <codetitle>scroll</code> that bubbles at <var>document</var>.
458
+
</ol>
459
+
<li><p><span>Perform a scroll</span> of <var>viewport</var> to <var>position</var>, with the set of steps <var>task</var>, and <var>document</var>'s root
460
+
element as the associated element, if there is one, or null otherwise.
461
+
</ol>
462
+
463
+
<pclass=note>This algorithm is used when navigating to the <codetitle>#top</code> fragment identifier, as defined in HTML. <spandata-anolis-ref>HTML</span>
452
464
453
465
<h2>Extensions to the <codetitle>Window</code> Interface</h2>
0 commit comments