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>When a user agent is to <dfnid="perform-a-scroll">perform a scroll</dfn> of a scrolling box <vartitle="">box</var>, to a given position <vartitle="">position</var>, with a set of
275
-
steps <vartitle="">task</var>, and an associated element <vartitle="">element</var> the following steps must be run:
275
+
steps <vartitle="">task</var>, an associated element <vartitle="">element</var> and a scroll behavior <vartitle="">behavior</var>, the following steps must be run:
276
276
277
277
<ol>
278
278
<li><p><ahref="#concept-smooth-scroll-aborted" title="concept-smooth-scroll-aborted">Abort</a> any ongoing <ahref="#concept-smooth-scroll" title="concept-smooth-scroll">smooth scroll</a> for <vartitle="">box</var>.
279
-
<li><p>If <vartitle="">element</var> is not null and its computed value of the '<code><ahref="#scroll-behavior">scroll-behavior</a></code>' property is
280
-
'<codetitle="scroll-behavior-smooth"><ahref="#scroll-behavior-smooth">smooth</a></code>', and the user agent honors the '<code><ahref="#scroll-behavior">scroll-behavior</a></code>' property, then follow these substeps:
279
+
<li><p>If the user agent honors the '<code><ahref="#scroll-behavior">scroll-behavior</a></code>' property and one of the following are true:
280
+
<ul>
281
+
<li><p><vartitle="">behavior</var> is <codetitle="">auto</code> and <vartitle="">element</var> is not null and its computed value of the '<code><ahref="#scroll-behavior">scroll-behavior</a></code>'
282
+
property is '<codetitle="scroll-behavior-smooth"><ahref="#scroll-behavior-smooth">smooth</a></code>'
283
+
<li><p><vartitle="">behavior</var> is <codetitle="">smooth</code>
284
+
</ul>
285
+
<p>...then follow these substeps:
281
286
<ol>
282
287
<li><p>Perform a <ahref="#concept-smooth-scroll" title="concept-smooth-scroll">smooth scroll</a> of <vartitle="">box</var> to <vartitle="">position</var>.
283
288
<li><p><aclass="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#queue-a-task">Queue a task</a> to run <vartitle="">task</var>, unless a <aclass="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#concept-task" title="concept-task">task</a> to
<p>The <dfnid="dom-window-pageyoffset" title="dom-Window-pageYOffset"><code>pageYOffset</code></dfn> attribute must return the value returned by the <code>scrollY</code> attribute.</p>
370
383
371
-
<p>When the <dfnid="dom-window-scroll" title="dom-Window-scroll"><code>scroll(<vartitle="">x</var>, <vartitle="">y</var>)</code></dfn> method is invoked these steps must be run:</p>
384
+
<p>When the <dfnid="dom-window-scroll" title="dom-Window-scroll"><code>scroll(<vartitle="">x</var>, <vartitle="">y</var>, <vartitle="">options</var>)</code></dfn> method is invoked these steps must be run:</p>
372
385
<ol>
373
386
<li><p>If there is no <ahref="#viewport">viewport</a>, abort these steps.
<li><p><ahref="#perform-a-scroll">Perform a scroll</a> of the <ahref="#viewport">viewport</a> to <vartitle="">position</var>, with the set of steps <vartitle="">task</var>, and the
400
-
<codeclass="external"><ahref="http://dom.spec.whatwg.org/#document">Document</a></code>'s root element as the associated element, if there is one, or <code>null</code> otherwise.
413
+
<codeclass="external"><ahref="http://dom.spec.whatwg.org/#document">Document</a></code>'s root element as the associated element, if there is one, or <code>null</code> otherwise, and the scroll behavior being the value of the <codetitle="">behavior</code> dictionary member of <vartitle="">options</var>.
401
414
</ol>
402
415
403
-
<p>When the <dfnid="dom-window-scrollto" title="dom-Window-scrollTo"><code>scrollTo(<vartitle="">x</var>, <vartitle="">y</var>)</code></dfn> method is invoked, the user agent must act as if
416
+
<p>When the <dfnid="dom-window-scrollto" title="dom-Window-scrollTo"><code>scrollTo(<vartitle="">x</var>, <vartitle="">y</var>, <vartitle="">options</var>)</code></dfn> method is invoked, the user agent must act as if
404
417
the <codetitle="dom-Window-scroll"><ahref="#dom-window-scroll">scroll()</a></code> method was invoked with the same arguments.</p>
405
418
406
-
<p>When the <dfnid="dom-window-scrollby" title="dom-Window-scrollBy"><code>scrollBy(<vartitle="">x</var>, <vartitle="">y</var>)</code></dfn> method is invoked, the user agent must act as if
419
+
<p>When the <dfnid="dom-window-scrollby" title="dom-Window-scrollBy"><code>scrollBy(<vartitle="">x</var>, <vartitle="">y</var>, <vartitle="">options</var>)</code></dfn> method is invoked, the user agent must act as if
407
420
the <codetitle="dom-Window-scroll"><ahref="#dom-window-scroll">scroll()</a></code> method was invoked with
408
421
<vartitle="">x</var> plus <codetitle="dom-Window-scrollX"><ahref="#dom-window-scrollx">scrollX</a></code>
<p>The <dfnid="dom-element-scrollintroview" title="dom-Element-scrollIntroView"><code>scrollIntoView(<vartitle="">top</var>)</code></dfn> method must run these steps:</p>
687
+
<p>The <dfnid="dom-element-scrollintroview" title="dom-Element-scrollIntroView"><code>scrollIntoView(<vartitle="">top</var>, <vartitle="">options</var>)</code></dfn> method must run these steps:</p>
675
688
<ol>
676
689
<li><p>If the element does not have any associated <ahref="#css-layout-box">CSS layout box</a> terminate these steps.</li>
677
690
<li><p><ahref="#scroll-an-element-into-view" title="scroll an element into view">Scroll the element into view</a> with the
678
-
<ititle="">align to top flag</i> set if <vartitle="">top</var> is true or omitted.</li>
691
+
<ititle="">align to top flag</i> set if <vartitle="">top</var> is true or omitted, and the scroll behavior being the value of the <codetitle="">behavior</code>
692
+
dictionary member of <vartitle="">options</var>.</li>
679
693
</ol>
680
694
681
695
<p>The <dfnid="dom-element-scrolltop" title="dom-Element-scrollTop"><code>scrollTop</code></dfn> attribute must return the result of running these steps:</p>
<p>When setting the <codetitle="dom-Element-scrollTop"><ahref="#dom-element-scrolltop">scrollTop</a></code> attribute these steps must be run:</p>
697
711
<ol>
698
-
<li><p>Let <vartitle="">y</var> be the given value.</li>
712
+
<li><p>If the given value is a <code><ahref="#scrolloptions">ScrollOptions</a></code> object, and the <codetitle="">y</code> dictionary member is not present, abort these steps.
713
+
<li><p>If the given value is a <code><ahref="#scrolloptions">ScrollOptions</a></code> object, let <vartitle="">y</var> be the value of the <codetitle="">y</code> dictionary member. Otherwise,
714
+
let <vartitle="">y</var> be the given value.</li>
699
715
<li><p>If the element does not have any associated <ahref="#css-layout-box">CSS layout box</a>, the
700
716
element is the root element and the <codeclass="external"><ahref="http://dom.spec.whatwg.org/#document">Document</a></code> is in
701
717
<aclass="external" href="http://dom.spec.whatwg.org/#concept-document-quirks" title="concept-document-quirks">quirks mode</a>, or the element has no overflow, terminate these
702
718
steps.</li>
703
719
<li><p>If the element is the root element invoke
704
720
<codetitle="dom-Window-scroll"><ahref="#dom-window-scroll">scroll()</a></code> with zero as first
705
-
argument and <vartitle="">y</var> as second.</li>
721
+
argument and <vartitle="">y</var> as second, and, if the given value is a <code><ahref="#scrolloptions">ScrollOptions</a></code> object, the given value as the third argument.</li>
706
722
<li><p>If the element is <ahref="#the-html-body-element">the HTML <code>body</code> element</a>,
707
723
the <codeclass="external"><ahref="http://dom.spec.whatwg.org/#document">Document</a></code> is in <aclass="external" href="http://dom.spec.whatwg.org/#concept-document-quirks" title="concept-document-quirks">quirks mode</a>, and the element
708
724
does not have any vertical overflow, invoke
709
725
<codetitle="dom-Window-scroll"><ahref="#dom-window-scroll">scroll()</a></code> with
710
726
<codetitle="dom-Window-scrollX"><ahref="#dom-window-scrollx">scrollX</a></code> as first
711
-
argument and <vartitle="">y</var> as second.</li>
727
+
argument and <vartitle="">y</var> as second, and, if the given value is a <code><ahref="#scrolloptions">ScrollOptions</a></code> object, the given value as the third argument.</li>
712
728
<li><p><ahref="#scroll-an-element" title="scroll an element">Scroll the element</a> to
<codetitle="dom-Element-scrollLeft"><ahref="#dom-element-scrollleft">scrollLeft</a></code>,<vartitle="">y</var>, with the scroll behavior being the value of the <codetitle="">behavior</code> dictionary
730
+
member if the given value is a <code><ahref="#scrolloptions">ScrollOptions</a></code> object, or <codetitle="">auto</code> otherwise.
714
731
</ol>
715
732
716
733
<p>The <dfnid="dom-element-scrollleft" title="dom-Element-scrollLeft"><code>scrollLeft</code></dfn> attribute must return the result of running these steps:</p>
<p>When setting the <codetitle="dom-Element-scrollLeft"><ahref="#dom-element-scrollleft">scrollLeft</a></code> attribute these steps must be run:</p>
732
749
<ol>
733
-
<li><p>Let <vartitle="">x</var> be the given value.</li>
750
+
<li><p>If the given value is a <code><ahref="#scrolloptions">ScrollOptions</a></code> object, and the <codetitle="">x</code> dictionary member is not present, abort these steps.
751
+
<li><p>If the given value is a <code><ahref="#scrolloptions">ScrollOptions</a></code> object, let <vartitle="">x</var> be the value of the <codetitle="">x</code> dictionary member. Otherwise,
752
+
let <vartitle="">x</var> be the given value.</li>
734
753
<li><p>If the element does not have any associated <ahref="#css-layout-box">CSS layout box</a>, the
735
754
element is the root element and the <codeclass="external"><ahref="http://dom.spec.whatwg.org/#document">Document</a></code> is in
736
755
<aclass="external" href="http://dom.spec.whatwg.org/#concept-document-quirks" title="concept-document-quirks">quirks mode</a>, or the element has no overflow, terminate these
737
756
steps.</li>
738
757
<li><p>If the element is the root element invoke
739
758
<codetitle="dom-Window-scroll"><ahref="#dom-window-scroll">scroll()</a></code> with
740
-
<vartitle="">x</var> as first argument and zero as second.</li>
759
+
<vartitle="">x</var> as first argument and zero as second, and, if the given value is a <code><ahref="#scrolloptions">ScrollOptions</a></code> object, the given value as the third
760
+
argument.</li>
741
761
<li><p>If the element is <ahref="#the-html-body-element">the HTML <code>body</code> element</a>,
742
762
the <codeclass="external"><ahref="http://dom.spec.whatwg.org/#document">Document</a></code> is in <aclass="external" href="http://dom.spec.whatwg.org/#concept-document-quirks" title="concept-document-quirks">quirks mode</a>, and the element
743
763
does not have any vertical overflow, invoke
744
764
<codetitle="dom-Window-scroll"><ahref="#dom-window-scroll">scroll()</a></code> with
745
765
<vartitle="">x</var> as first argument and
746
-
<codetitle="dom-Window-scrollY"><ahref="#dom-window-scrolly">scrollY</a></code> as second.</li>
766
+
<codetitle="dom-Window-scrollY"><ahref="#dom-window-scrolly">scrollY</a></code> as second, and, if the given value is a <code><ahref="#scrolloptions">ScrollOptions</a></code> object, the given value as the third
767
+
argument.</li>
747
768
<li><p><ahref="#scroll-an-element" title="Scroll an element">Scroll the element</a> to
<vartitle="">x</var>,<codetitle="dom-Element-scrollTop"><ahref="#dom-element-scrolltop">scrollTop</a></code>, with the scroll behavior being the value of the <codetitle="">behavior</code> dictionary
770
+
member if the given value is a <code><ahref="#scrolloptions">ScrollOptions</a></code> object, or <codetitle="">auto</code> otherwise.
749
771
</ol>
750
772
751
773
<p>The <dfnid="dom-element-scrollwidth" title="dom-Element-scrollWidth"><code>scrollWidth</code></dfn> attribute must return the result of running these steps:</p>
<li><p><ahref="#perform-a-scroll">Perform a scroll</a> of <vartitle="">box</var> to <vartitle="">position</var>, with the set of steps <vartitle="">task</var>, and
888
-
<vartitle="">element</var> as the associated element.
909
+
<li><p><ahref="#perform-a-scroll">Perform a scroll</a> of <vartitle="">box</var> to <vartitle="">position</var>, with the set of steps <vartitle="">task</var>,
910
+
<vartitle="">element</var> as the associated element and <vartitle="">behavior</var> as the scroll behavior.
889
911
890
912
</ol>
891
913
892
-
<p>To <dfnid="scroll-an-element">scroll an element</dfn> to <vartitle="">x</var>,<vartitle="">y</var> means to:</p>
914
+
<p>To <dfnid="scroll-an-element">scroll an element</dfn> to <vartitle="">x</var>,<vartitle="">y</var>with a scroll behavior <vartitle="">behavior</var>means to:</p>
893
915
894
916
<ol>
895
917
<li><p>Let <vartitle="">element</var> be the element.
<codetitle="event-scroll">scroll</code> at the element.</li>
928
950
</ol>
929
951
930
-
<li><p><ahref="#perform-a-scroll">Perform a scroll</a> of <vartitle="">box</var> to <vartitle="">position</var>, with the set of steps <vartitle="">task</var>, and
931
-
<vartitle="">element</var> as the associated element.
952
+
<li><p><ahref="#perform-a-scroll">Perform a scroll</a> of <vartitle="">box</var> to <vartitle="">position</var>, with the set of steps <vartitle="">task</var>,
953
+
<vartitle="">element</var> as the associated element and <vartitle="">behavior</var> as the scroll behavior.
0 commit comments