Skip to content

Commit 3410226

Browse files
author
Simon Pieters
committed
[cssom-view] Define 'beginning of the document' for navigating to #top. https://www.w3.org/Bugs/Public/show_bug.cgi?id=15588
1 parent a3f2072 commit 3410226

2 files changed

Lines changed: 51 additions & 5 deletions

File tree

cssom-view/Overview.html

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@ <h2 class="no-num no-toc" id="toc">Table of Contents</h2>
125125
<li><a href="#css-pixels"><span class="secno">3.1 </span>CSS pixels</a></ol></li>
126126
<li><a href="#common-infrastructure"><span class="secno">4 </span>Common Infrastructure</a>
127127
<ol class="toc">
128-
<li><a href="#scrolling"><span class="secno">4.1 </span>Scrolling</a></ol></li>
128+
<li><a href="#scrolling"><span class="secno">4.1 </span>Scrolling</a>
129+
<ol class="toc">
130+
<li><a href="#common-scroll-positions"><span class="secno">4.1.1 </span>Common Scroll Positions</a></ol></ol></li>
129131
<li><a href="#extensions-to-the-window-interface"><span class="secno">5 </span>Extensions to the <code title="">Window</code> Interface</a>
130132
<ol class="toc">
131133
<li><a href="#the-mediaquerylist-interface"><span class="secno">5.1 </span>The <code title="">MediaQueryList</code> Interface</a></li>
@@ -261,8 +263,8 @@ <h2 id="terminology"><span class="secno">3 </span>Terminology</h2>
261263
<dd><p>Righward and upward.
262264
</dl>
263265

264-
<p>The term <dfn id="scrolling-area">scrolling area</dfn> refers to a box of an element that has the following edges, depending on the element's scrolling box's <a href="#overflow-directions">overflow
265-
directions</a>.
266+
<p>The term <dfn id="scrolling-area">scrolling area</dfn> refers to a box of a <a href="#viewport">viewport</a> or an element that has the following edges, depending on the
267+
<a href="#viewport">viewport</a>'s or element's scrolling box's <a href="#overflow-directions">overflow directions</a>.
266268

267269
<dl class="switch">
268270
<dt>If the <a href="#overflow-directions">overflow directions</a> are rightward and downward
@@ -384,6 +386,28 @@ <h3 id="scrolling"><span class="secno">4.1 </span>Scrolling</h3>
384386
<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 title="">box</var> to
385387
<var title="">position</var>, it must update the scroll position of <var title="">box</var> to <var title="">position</var>.
386388

389+
<h4 id="common-scroll-positions"><span class="secno">4.1.1 </span>Common Scroll Positions</h4>
390+
391+
<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="#scrolling-area">scrolling area</a> in the
392+
<a href="#viewport">viewport</a> as follows, depending on the <a href="#viewport">viewport</a>'s <a href="#overflow-directions">overflow directions</a>:
393+
394+
<dl class="switch">
395+
<dt>If the <a href="#overflow-directions">overflow directions</a> are rightward and downward
396+
<dd><p>Align the top edge of the <a href="#scrolling-area">scrolling area</a> with the top of the <a href="#viewport">viewport</a>. Align the left edge of the <a href="#scrolling-area">scrolling area</a>
397+
with the left of the <a href="#viewport">viewport</a>.
398+
<dt>If the <a href="#overflow-directions">overflow directions</a> are leftward and downward
399+
<dd><p>Align the top edge of the <a href="#scrolling-area">scrolling area</a> with the top of the <a href="#viewport">viewport</a>. Align the right edge of the <a href="#scrolling-area">scrolling area</a>
400+
with the right of the <a href="#viewport">viewport</a>.
401+
<dt>If the <a href="#overflow-directions">overflow directions</a> are leftward and upward
402+
<dd><p>Align the bottom edge of the <a href="#scrolling-area">scrolling area</a> with the bottom of the <a href="#viewport">viewport</a>. Align the right edge of the <a href="#scrolling-area">scrolling
403+
area</a> with the right of the <a href="#viewport">viewport</a>.
404+
<dt>If the <a href="#overflow-directions">overflow directions</a> are rightward and upward
405+
<dd><p>Align the bottom edge of the <a href="#scrolling-area">scrolling area</a> with the bottom of the <a href="#viewport">viewport</a>. Align the left edge of the <a href="#scrolling-area">scrolling
406+
area</a> with the left of the <a href="#viewport">viewport</a>.
407+
</dl>
408+
409+
<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.
410+
<a href="#refsHTML">[HTML]</a>
387411

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

cssom-view/Overview.src.html

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,8 @@ <h2>Terminology</h2>
231231
<dd><p>Righward and upward.
232232
</dl>
233233

234-
<p>The term <dfn>scrolling area</dfn> refers to a box of an element that has the following edges, depending on the element's scrolling box's <span>overflow
235-
directions</span>.
234+
<p>The term <dfn>scrolling area</dfn> refers to a box of a <span>viewport</span> or an element that has the following edges, depending on the
235+
<span>viewport</span>'s or element's scrolling box's <span>overflow directions</span>.
236236

237237
<dl class=switch>
238238
<dt>If the <span>overflow directions</span> are rightward and downward
@@ -354,6 +354,28 @@ <h3>Scrolling</h3>
354354
<p>When a user agent is to perform an <dfn title=concept-instant-scroll>instant scroll</dfn> of a scrolling box <var title>box</var> to
355355
<var title>position</var>, it must update the scroll position of <var title>box</var> to <var title>position</var>.
356356

357+
<h4>Common Scroll Positions</h4>
358+
359+
<p>The <dfn>beginning of the document</dfn> is the scroll position the <span>viewport</span> would have by aligning the <span>scrolling area</span> in the
360+
<span>viewport</span> as follows, depending on the <span>viewport</span>'s <span>overflow directions</span>:
361+
362+
<dl class=switch>
363+
<dt>If the <span>overflow directions</span> are rightward and downward
364+
<dd><p>Align the top edge of the <span>scrolling area</span> with the top of the <span>viewport</span>. Align the left edge of the <span>scrolling area</span>
365+
with the left of the <span>viewport</span>.
366+
<dt>If the <span>overflow directions</span> are leftward and downward
367+
<dd><p>Align the top edge of the <span>scrolling area</span> with the top of the <span>viewport</span>. Align the right edge of the <span>scrolling area</span>
368+
with the right of the <span>viewport</span>.
369+
<dt>If the <span>overflow directions</span> are leftward and upward
370+
<dd><p>Align the bottom edge of the <span>scrolling area</span> with the bottom of the <span>viewport</span>. Align the right edge of the <span>scrolling
371+
area</span> with the right of the <span>viewport</span>.
372+
<dt>If the <span>overflow directions</span> are rightward and upward
373+
<dd><p>Align the bottom edge of the <span>scrolling area</span> with the bottom of the <span>viewport</span>. Align the left edge of the <span>scrolling
374+
area</span> with the left of the <span>viewport</span>.
375+
</dl>
376+
377+
<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.
378+
<span data-anolis-ref>HTML</span>
357379

358380
<h2>Extensions to the <code title>Window</code> Interface</h2>
359381

0 commit comments

Comments
 (0)