Skip to content

Commit 4d7b2ac

Browse files
author
Simon Pieters
committed
[cssom-view] Make scrollIntoView(undefined) not scroll to top. https://www.w3.org/Bugs/Public/show_bug.cgi?id=23565
1 parent f80fb07 commit 4d7b2ac

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

cssom-view/Overview.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
<h1>CSSOM View Module</h1>
1818

19-
<h2 class="no-num no-toc" id="w3c-doctype">Editor's Draft 17 October 2013</h2>
19+
<h2 class="no-num no-toc" id="w3c-doctype">Editor's Draft 21 October 2013</h2>
2020

2121
<dl>
2222

@@ -83,7 +83,7 @@ <h2 class="no-num no-toc" id="sotd">Status of This Document</h2>
8383
can be found in the <a href="http://www.w3.org/TR/">W3C technical reports
8484
index at http://www.w3.org/TR/.</a></em>
8585

86-
<p>This is the 17 October 2013 Editor's Draft of CSSOM View. Please send
86+
<p>This is the 21 October 2013 Editor's Draft of CSSOM View. Please send
8787
comments to
8888
<a href="mailto:www-style@w3.org?subject=%5Bcssom-view%5D%20">www-style@w3.org</a>
8989
(<a href="http://lists.w3.org/Archives/Public/www-style/">archived</a>)
@@ -1007,7 +1007,8 @@ <h2 id="extensions-to-the-element-interface"><span class="secno">7 </span>Extens
10071007
partial interface <a class="external" data-anolis-spec="dom" href="http://dom.spec.whatwg.org/#element">Element</a> {
10081008
<a href="#domrectlist">DOMRectList</a> <a href="#dom-element-getclientrects" title="dom-Element-getClientRects">getClientRects</a>();
10091009
<a href="#domrect">DOMRect</a> <a href="#dom-element-getboundingclientrect" title="dom-Element-getBoundingClientRect">getBoundingClientRect</a>();
1010-
void <a href="#dom-element-scrollintoview" title="dom-Element-scrollIntoView">scrollIntoView</a>(optional boolean top = true, optional <a href="#scrolloptions">ScrollOptions</a> options);
1010+
void <a href="#dom-element-scrollintoview" title="dom-Element-scrollIntoView">scrollIntoView</a>();
1011+
void <a href="#dom-element-scrollintoview" title="dom-Element-scrollIntoView">scrollIntoView</a>(boolean top, optional <a href="#scrolloptions">ScrollOptions</a> options);
10111012
attribute (double or <a href="#scrolloptionsvertical">ScrollOptionsVertical</a>) <a href="#dom-element-scrolltop" title="dom-Element-scrollTop">scrollTop</a>;
10121013
attribute (double or <a href="#scrolloptionshorizontal">ScrollOptionsHorizontal</a>) <a href="#dom-element-scrollleft" title="dom-Element-scrollLeft">scrollLeft</a>;
10131014
readonly attribute double <a href="#dom-element-scrollwidth" title="dom-Element-scrollWidth">scrollWidth</a>;
@@ -1072,6 +1073,9 @@ <h2 id="extensions-to-the-element-interface"><span class="secno">7 </span>Extens
10721073

10731074
<p>The <dfn id="dom-element-scrollintoview" title="dom-Element-scrollIntoView"><code>scrollIntoView(<var>top</var>, <var>options</var>)</code></dfn> method must run these steps:</p>
10741075
<ol>
1076+
<li><p>If invoked with no arguments, let <var>top</var> be true and let <var>options</var> be a <code><a href="#scrolloptions">ScrollOptions</a></code> dictionary with its members not
1077+
present or present with the default value, as appropriate.
1078+
<!-- scrollIntoView() means top=true but scrollIntoView(undefined) means top=false, to align with impls. -->
10751079
<li><p>If the element does not have any associated <a href="#layout-box">layout box</a> terminate these steps.</li>
10761080
<li><p><a href="#scroll-an-element-into-view" title="scroll an element into view">Scroll the element into view</a> with the
10771081
<i>align to top flag</i> set if <var>top</var> is true, and the scroll behavior being the value of the <code title="">behavior</code>

cssom-view/Overview.src.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,8 @@ <h2>Extensions to the <code title>Element</code> Interface</h2>
964964
partial interface <span data-anolis-spec=dom>Element</span> {
965965
<span>DOMRectList</span> <span title=dom-Element-getClientRects>getClientRects</span>();
966966
<span>DOMRect</span> <span title=dom-Element-getBoundingClientRect>getBoundingClientRect</span>();
967-
void <span title=dom-Element-scrollIntoView>scrollIntoView</span>(optional boolean top = true, optional <span>ScrollOptions</span> options);
967+
void <span title=dom-Element-scrollIntoView>scrollIntoView</span>();
968+
void <span title=dom-Element-scrollIntoView>scrollIntoView</span>(boolean top, optional <span>ScrollOptions</span> options);
968969
attribute (double or <span>ScrollOptionsVertical</span>) <span title=dom-Element-scrollTop>scrollTop</span>;
969970
attribute (double or <span>ScrollOptionsHorizontal</span>) <span title=dom-Element-scrollLeft>scrollLeft</span>;
970971
readonly attribute double <span title=dom-Element-scrollWidth>scrollWidth</span>;
@@ -1029,6 +1030,9 @@ <h2>Extensions to the <code title>Element</code> Interface</h2>
10291030

10301031
<p>The <dfn title=dom-Element-scrollIntoView><code>scrollIntoView(<var>top</var>, <var>options</var>)</code></dfn> method must run these steps:</p>
10311032
<ol>
1033+
<li><p>If invoked with no arguments, let <var>top</var> be true and let <var>options</var> be a <code>ScrollOptions</code> dictionary with its members not
1034+
present or present with the default value, as appropriate.
1035+
<!-- scrollIntoView() means top=true but scrollIntoView(undefined) means top=false, to align with impls. -->
10321036
<li><p>If the element does not have any associated <span>layout box</span> terminate these steps.</p></li>
10331037
<li><p><span title='scroll an element into view'>Scroll the element into view</span> with the
10341038
<i>align to top flag</i> set if <var>top</var> is true, and the scroll behavior being the value of the <code title>behavior</code>

0 commit comments

Comments
 (0)