Skip to content

Commit b56dc16

Browse files
author
Simon Pieters
committed
[cssom-view] 'scroll to the begninning of the document' should do nothing if that's the scroll position already.
1 parent 4dad963 commit b56dc16

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

cssom-view/Overview.html

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,7 @@ <h2 class="no-num no-toc" id="toc">Table of Contents</h2>
139139
<li><a href="#css-pixels"><span class="secno">3.1 </span>CSS pixels</a></ol></li>
140140
<li><a href="#common-infrastructure"><span class="secno">4 </span>Common Infrastructure</a>
141141
<ol>
142-
<li><a href="#scrolling"><span class="secno">4.1 </span>Scrolling</a>
143-
<ol>
144-
<li><a href="#common-scroll-positions"><span class="secno">4.1.1 </span>Common Scroll Positions</a></ol></ol></li>
142+
<li><a href="#scrolling"><span class="secno">4.1 </span>Scrolling</a></ol></li>
145143
<li><a href="#extensions-to-the-window-interface"><span class="secno">5 </span>Extensions to the <code title="">Window</code> Interface</a>
146144
<ol>
147145
<li><a href="#the-mediaquerylist-interface"><span class="secno">5.1 </span>The <code title="">MediaQueryList</code> Interface</a></li>
@@ -483,15 +481,15 @@ <h3 id="scrolling"><span class="secno">4.1 </span>Scrolling</h3>
483481
<p>When a user agent is to perform an <dfn id="concept-instant-scroll" title="concept-instant-scroll">instant scroll</dfn> of a scrolling box <var>box</var> to
484482
<var>position</var>, it must update the scroll position of <var>box</var> to <var>position</var>.
485483

486-
<h4 id="common-scroll-positions"><span class="secno">4.1.1 </span>Common Scroll Positions</h4>
487-
488484
<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:
489485

490486
<ol>
491487
<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
492488
it is only invoked when navigating -->
493489
<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
494490
<a href="#scrolling-area">scrolling area</a> with the <a href="#beginning-edges">beginning edges</a> of the <a href="#viewport">viewport</a>.
491+
<li><p>If <var>position</var> is the same as <var>viewport</var>'s current scroll position, and <var>viewport</var> does not have an ongoing
492+
<a href="#concept-smooth-scroll" title="concept-smooth-scroll">smooth scroll</a>, abort these steps.
495493
<li><p>Let <var>task</var> be these steps:
496494
<ol>
497495
<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>.

cssom-view/Overview.src.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,15 +443,15 @@ <h3>Scrolling</h3>
443443
<p>When a user agent is to perform an <dfn title=concept-instant-scroll>instant scroll</dfn> of a scrolling box <var>box</var> to
444444
<var>position</var>, it must update the scroll position of <var>box</var> to <var>position</var>.
445445

446-
<h4>Common Scroll Positions</h4>
447-
448446
<p>To <dfn>scroll to the beginning of the document</dfn> for a document <var>document</var>, follow these steps:
449447

450448
<ol>
451449
<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
452450
it is only invoked when navigating -->
453451
<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
454452
<span>scrolling area</span> with the <span>beginning edges</span> of the <span>viewport</span>.
453+
<li><p>If <var>position</var> is the same as <var>viewport</var>'s current scroll position, and <var>viewport</var> does not have an ongoing
454+
<span title=concept-smooth-scroll>smooth scroll</span>, abort these steps.
455455
<li><p>Let <var>task</var> be these steps:
456456
<ol>
457457
<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>.

0 commit comments

Comments
 (0)