Skip to content

Commit c90df7e

Browse files
author
Simon Pieters
committed
[cssom-view] Allow 'perform a scroll' to be invoked without specifying 'behavior'
1 parent 10f6656 commit c90df7e

2 files changed

Lines changed: 24 additions & 18 deletions

File tree

cssom-view/Overview.html

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -413,14 +413,15 @@ <h2 id="common-infrastructure"><span class="secno">4 </span>Common Infrastructur
413413
<h3 id="scrolling"><span class="secno">4.1 </span>Scrolling</h3>
414414

415415
<p>When a user agent is to <dfn id="perform-a-scroll">perform a scroll</dfn> of a scrolling box <var title="">box</var>, to a given position <var title="">position</var>, with a set of
416-
steps <var title="">task</var>, an associated element <var title="">element</var> and a scroll behavior <var title="">behavior</var>, the following steps must be run:
416+
steps <var title="">task</var>, an associated element <var title="">element</var> and optionally a scroll behavior <var title="">behavior</var> (which is
417+
<code title="">auto</code> if omitted), the following steps must be run:
417418

418419
<ol>
419420
<li><p><a href="#concept-smooth-scroll-aborted" title="concept-smooth-scroll-aborted">Abort</a> any ongoing <a href="#concept-smooth-scroll" title="concept-smooth-scroll">smooth scroll</a> for <var title="">box</var>.
420421
<li><p>If the user agent honors the '<code><a href="#scroll-behavior">scroll-behavior</a></code>' property and one of the following are true:
421422
<ul>
422-
<li><p><var title="">behavior</var> is <code title="">auto</code> and <var title="">element</var> is not null and its computed value of the '<code><a href="#scroll-behavior">scroll-behavior</a></code>'
423-
property is '<code title="scroll-behavior-smooth"><a href="#scroll-behavior-smooth">smooth</a></code>'
423+
<li><p><var title="">behavior</var> is <code title="">auto</code> and <var title="">element</var> is not null and its computed value of the
424+
'<code><a href="#scroll-behavior">scroll-behavior</a></code>' property is '<code title="scroll-behavior-smooth"><a href="#scroll-behavior-smooth">smooth</a></code>'
424425
<li><p><var title="">behavior</var> is <code title="">smooth</code>
425426
</ul>
426427
<p>...then follow these substeps:
@@ -544,7 +545,8 @@ <h2 id="extensions-to-the-window-interface"><span class="secno">5 </span>Extensi
544545

545546
<p>The <dfn id="dom-window-pageyoffset" title="dom-Window-pageYOffset"><code>pageYOffset</code></dfn> attribute must return the value returned by the <code>scrollY</code> attribute.</p>
546547

547-
<p>When the <dfn id="dom-window-scroll" title="dom-Window-scroll"><code>scroll(<var title="">x</var>, <var title="">y</var>, <var title="">options</var>)</code></dfn> method is invoked these steps must be run:</p>
548+
<p>When the <dfn id="dom-window-scroll" title="dom-Window-scroll"><code>scroll(<var title="">x</var>, <var title="">y</var>, <var title="">options</var>)</code></dfn> method is invoked these
549+
steps must be run:</p>
548550
<ol>
549551
<li><p>If there is no <a href="#viewport">viewport</a>, abort these steps.
550552
<dl class="switch">
@@ -573,14 +575,15 @@ <h2 id="extensions-to-the-window-interface"><span class="secno">5 </span>Extensi
573575
<code class="external"><a href="http://dom.spec.whatwg.org/#document">Document</a></code> object.
574576
</ol>
575577
<li><p><a href="#perform-a-scroll">Perform a scroll</a> of the <a href="#viewport">viewport</a> to <var title="">position</var>, with the set of steps <var title="">task</var>, and the
576-
<code class="external"><a href="http://dom.spec.whatwg.org/#document">Document</a></code>'s root element as the associated element, if there is one, or null otherwise, and the scroll behavior being the value of the <code title="">behavior</code> dictionary member of <var title="">options</var>.
578+
<code class="external"><a href="http://dom.spec.whatwg.org/#document">Document</a></code>'s root element as the associated element, if there is one, or null otherwise, and the scroll behavior being the
579+
value of the <code title="">behavior</code> dictionary member of <var title="">options</var>.
577580
</ol>
578581

579-
<p>When the <dfn id="dom-window-scrollto" title="dom-Window-scrollTo"><code>scrollTo(<var title="">x</var>, <var title="">y</var>, <var title="">options</var>)</code></dfn> method is invoked, the user agent must act as if
580-
the <code title="dom-Window-scroll"><a href="#dom-window-scroll">scroll()</a></code> method was invoked with the same arguments.</p>
582+
<p>When the <dfn id="dom-window-scrollto" title="dom-Window-scrollTo"><code>scrollTo(<var title="">x</var>, <var title="">y</var>, <var title="">options</var>)</code></dfn> method is invoked, the
583+
user agent must act as if the <code title="dom-Window-scroll"><a href="#dom-window-scroll">scroll()</a></code> method was invoked with the same arguments.</p>
581584

582-
<p>When the <dfn id="dom-window-scrollby" title="dom-Window-scrollBy"><code>scrollBy(<var title="">x</var>, <var title="">y</var>, <var title="">options</var>)</code></dfn> method is invoked, the user agent must act as if
583-
the <code title="dom-Window-scroll"><a href="#dom-window-scroll">scroll()</a></code> method was invoked with
585+
<p>When the <dfn id="dom-window-scrollby" title="dom-Window-scrollBy"><code>scrollBy(<var title="">x</var>, <var title="">y</var>, <var title="">options</var>)</code></dfn> method is invoked, the
586+
user agent must act as if the <code title="dom-Window-scroll"><a href="#dom-window-scroll">scroll()</a></code> method was invoked with
584587
<var title="">x</var> plus <code title="dom-Window-scrollX"><a href="#dom-window-scrollx">scrollX</a></code>
585588
as first argument and <var title="">y</var> plus
586589
<code title="dom-Window-scrollY"><a href="#dom-window-scrolly">scrollY</a></code> as second argument.</p>

cssom-view/Overview.src.html

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -381,14 +381,15 @@ <h2>Common Infrastructure</h2>
381381
<h3>Scrolling</h3>
382382

383383
<p>When a user agent is to <dfn>perform a scroll</dfn> of a scrolling box <var title>box</var>, to a given position <var title>position</var>, with a set of
384-
steps <var title>task</var>, an associated element <var title>element</var> and a scroll behavior <var title>behavior</var>, the following steps must be run:
384+
steps <var title>task</var>, an associated element <var title>element</var> and optionally a scroll behavior <var title>behavior</var> (which is
385+
<code title>auto</code> if omitted), the following steps must be run:
385386

386387
<ol>
387388
<li><p><span title=concept-smooth-scroll-aborted>Abort</span> any ongoing <span title=concept-smooth-scroll>smooth scroll</span> for <var title>box</var>.
388389
<li><p>If the user agent honors the '<code>scroll-behavior</code>' property and one of the following are true:
389390
<ul>
390-
<li><p><var title>behavior</var> is <code title>auto</code> and <var title>element</var> is not null and its computed value of the '<code>scroll-behavior</code>'
391-
property is '<code title=scroll-behavior-smooth>smooth</code>'
391+
<li><p><var title>behavior</var> is <code title>auto</code> and <var title>element</var> is not null and its computed value of the
392+
'<code>scroll-behavior</code>' property is '<code title=scroll-behavior-smooth>smooth</code>'
392393
<li><p><var title>behavior</var> is <code title>smooth</code>
393394
</ul>
394395
<p>...then follow these substeps:
@@ -512,7 +513,8 @@ <h2>Extensions to the <code title>Window</code> Interface</h2>
512513

513514
<p>The <dfn title=dom-Window-pageYOffset><code>pageYOffset</code></dfn> attribute must return the value returned by the <code>scrollY</code> attribute.</p>
514515

515-
<p>When the <dfn title=dom-Window-scroll><code>scroll(<var title>x</var>, <var title>y</var>, <var title>options</var>)</code></dfn> method is invoked these steps must be run:</p>
516+
<p>When the <dfn title=dom-Window-scroll><code>scroll(<var title>x</var>, <var title>y</var>, <var title>options</var>)</code></dfn> method is invoked these
517+
steps must be run:</p>
516518
<ol>
517519
<li><p>If there is no <span>viewport</span>, abort these steps.
518520
<dl class=switch>
@@ -541,14 +543,15 @@ <h2>Extensions to the <code title>Window</code> Interface</h2>
541543
<code data-anolis-spec=dom>Document</code> object.
542544
</ol>
543545
<li><p><span>Perform a scroll</span> of the <span>viewport</span> to <var title>position</var>, with the set of steps <var title>task</var>, and the
544-
<code data-anolis-spec=dom>Document</code>'s root element as the associated element, if there is one, or null otherwise, and the scroll behavior being the value of the <code title>behavior</code> dictionary member of <var title>options</var>.
546+
<code data-anolis-spec=dom>Document</code>'s root element as the associated element, if there is one, or null otherwise, and the scroll behavior being the
547+
value of the <code title>behavior</code> dictionary member of <var title>options</var>.
545548
</ol>
546549

547-
<p>When the <dfn title=dom-Window-scrollTo><code>scrollTo(<var title>x</var>, <var title>y</var>, <var title>options</var>)</code></dfn> method is invoked, the user agent must act as if
548-
the <code title=dom-Window-scroll>scroll()</code> method was invoked with the same arguments.</p>
550+
<p>When the <dfn title=dom-Window-scrollTo><code>scrollTo(<var title>x</var>, <var title>y</var>, <var title>options</var>)</code></dfn> method is invoked, the
551+
user agent must act as if the <code title=dom-Window-scroll>scroll()</code> method was invoked with the same arguments.</p>
549552

550-
<p>When the <dfn title=dom-Window-scrollBy><code>scrollBy(<var title>x</var>, <var title>y</var>, <var title>options</var>)</code></dfn> method is invoked, the user agent must act as if
551-
the <code title=dom-Window-scroll>scroll()</code> method was invoked with
553+
<p>When the <dfn title=dom-Window-scrollBy><code>scrollBy(<var title>x</var>, <var title>y</var>, <var title>options</var>)</code></dfn> method is invoked, the
554+
user agent must act as if the <code title=dom-Window-scroll>scroll()</code> method was invoked with
552555
<var title>x</var> plus <code title='dom-Window-scrollX'>scrollX</code>
553556
as first argument and <var title>y</var> plus
554557
<code title='dom-Window-scrollY'>scrollY</code> as second argument.</p>

0 commit comments

Comments
 (0)