Skip to content

Commit 4dad963

Browse files
author
Simon Pieters
committed
[cssom-view] Replace 'beginning of the document' with 'scroll to the beginning of the document' which needs less boilerplate for Hixie. https://www.w3.org/Bugs/Public/show_bug.cgi?id=15588
1 parent 7e39dbc commit 4dad963

2 files changed

Lines changed: 30 additions & 6 deletions

File tree

cssom-view/Overview.html

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -485,10 +485,22 @@ <h3 id="scrolling"><span class="secno">4.1 </span>Scrolling</h3>
485485

486486
<h4 id="common-scroll-positions"><span class="secno">4.1.1 </span>Common Scroll Positions</h4>
487487

488-
<p>The <dfn id="beginning-of-the-document">beginning of the document</dfn> is the scroll position the <a href="#viewport">viewport</a> would have by aligning the <a href="#beginning-edges">beginning edges</a> of the <a href="#scrolling-area">scrolling area</a> with the <a href="#beginning-edges">beginning edges</a> of the <a href="#viewport">viewport</a>.
488+
<p>To <dfn id="scroll-to-the-beginning-of-the-document">scroll to the beginning of the document</dfn> for a document <var>document</var>, follow these steps:
489489

490-
<p class="note">The <a href="#beginning-of-the-document">beginning of the document</a> concept is used when navigating to the <code title="">#top</code> fragment identifier, as defined in HTML.
491-
<a href="#refsHTML">[HTML]</a>
490+
<ol>
491+
<li><p>Let <var>viewport</var> be the <a href="#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 <a href="#viewport">viewport</a> would have by aligning the <a href="#beginning-edges">beginning edges</a> of the
494+
<a href="#scrolling-area">scrolling area</a> with the <a href="#beginning-edges">beginning edges</a> of the <a href="#viewport">viewport</a>.
495+
<li><p>Let <var>task</var> be these steps:
496+
<ol>
497+
<li><p><a class="external" data-anolis-spec="dom" href="http://dom.spec.whatwg.org/#concept-event-fire" title="concept-event-fire">Fire an event</a> named <code title="">scroll</code> that bubbles at <var>document</var>.
498+
</ol>
499+
<li><p><a href="#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+
<p class="note">This algorithm is used when navigating to the <code title="">#top</code> fragment identifier, as defined in HTML. <a href="#refsHTML">[HTML]</a>
492504

493505
<h2 id="extensions-to-the-window-interface"><span class="secno">5 </span>Extensions to the <code title="">Window</code> Interface</h2>
494506

cssom-view/Overview.src.html

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -445,10 +445,22 @@ <h3>Scrolling</h3>
445445

446446
<h4>Common Scroll Positions</h4>
447447

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:
449449

450-
<p class=note>The <span>beginning of the document</span> concept is used when navigating to the <code title>#top</code> fragment identifier, as defined in HTML.
451-
<span data-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><span data-anolis-spec=dom title=concept-event-fire>Fire an event</span> named <code title>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+
<p class=note>This algorithm is used when navigating to the <code title>#top</code> fragment identifier, as defined in HTML. <span data-anolis-ref>HTML</span>
452464

453465
<h2>Extensions to the <code title>Window</code> Interface</h2>
454466

0 commit comments

Comments
 (0)