Skip to content

Commit 966ef63

Browse files
author
Simon Pieters
committed
[cssom-view] Split ScrollOptions into separate dicts to be less confusing. https://www.w3.org/Bugs/Public/show_bug.cgi?id=23048
1 parent 17dfd45 commit 966ef63

3 files changed

Lines changed: 43 additions & 35 deletions

File tree

cssom-view/Overview.html

Lines changed: 21 additions & 17 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 13 August 2013</h2>
19+
<h2 class="no-num no-toc" id="w3c-doctype">Editor's Draft 23 August 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 13 August 2013 Editor's Draft of CSSOM View. Please send
86+
<p>This is the 23 August 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>)
@@ -494,9 +494,13 @@ <h2 id="extensions-to-the-window-interface"><span class="secno">5 </span>Extensi
494494
<pre class="idl">enum <dfn id="scrollbehavior">ScrollBehavior</dfn> { "auto", "instant", "smooth" };
495495

496496
dictionary <dfn id="scrolloptions">ScrollOptions</dfn> {
497+
<a href="#scrollbehavior">ScrollBehavior</a> behavior = "auto";
498+
};
499+
dictionary <dfn id="scrolloptionshorizontal">ScrollOptionsHorizontal</dfn> : <a href="#scrolloptions">ScrollOptions</a> {
497500
double x;
501+
};
502+
dictionary <dfn id="scrolloptionsvertical">ScrollOptionsVertical</dfn> : <a href="#scrolloptions">ScrollOptions</a> {
498503
double y;
499-
<a href="#scrollbehavior">ScrollBehavior</a> behavior = "auto";
500504
};
501505

502506
partial interface <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#window">Window</a> {
@@ -831,8 +835,8 @@ <h2 id="extensions-to-the-element-interface"><span class="secno">7 </span>Extens
831835
<a href="#clientrectlist">ClientRectList</a> <a href="#dom-element-getclientrects" title="dom-Element-getClientRects">getClientRects</a>();
832836
<a href="#clientrect">ClientRect</a> <a href="#dom-element-getboundingclientrect" title="dom-Element-getBoundingClientRect">getBoundingClientRect</a>();
833837
void <a href="#dom-element-scrollintoview" title="dom-Element-scrollIntoView">scrollIntoView</a>(optional boolean top = true, optional <a href="#scrolloptions">ScrollOptions</a> options);
834-
attribute (double or <a href="#scrolloptions">ScrollOptions</a>) <a href="#dom-element-scrolltop" title="dom-Element-scrollTop">scrollTop</a>;
835-
attribute (double or <a href="#scrolloptions">ScrollOptions</a>) <a href="#dom-element-scrollleft" title="dom-Element-scrollLeft">scrollLeft</a>;
838+
attribute (double or <a href="#scrolloptionsvertical">ScrollOptionsVertical</a>) <a href="#dom-element-scrolltop" title="dom-Element-scrollTop">scrollTop</a>;
839+
attribute (double or <a href="#scrolloptionshorizontal">ScrollOptionsHorizontal</a>) <a href="#dom-element-scrollleft" title="dom-Element-scrollLeft">scrollLeft</a>;
836840
readonly attribute double <a href="#dom-element-scrollwidth" title="dom-Element-scrollWidth">scrollWidth</a>;
837841
readonly attribute double <a href="#dom-element-scrollheight" title="dom-Element-scrollHeight">scrollHeight</a>;
838842
readonly attribute double <a href="#dom-element-clienttop" title="dom-Element-clientTop">clientTop</a>;
@@ -919,25 +923,25 @@ <h2 id="extensions-to-the-element-interface"><span class="secno">7 </span>Extens
919923
</ol>
920924
<p>When setting the <code title="dom-Element-scrollTop"><a href="#dom-element-scrolltop">scrollTop</a></code> attribute these steps must be run:</p>
921925
<ol>
922-
<li><p>If the given value is a <code><a href="#scrolloptions">ScrollOptions</a></code> object, and the <code title="">y</code> dictionary member is not present, abort these steps.
923-
<li><p>If the given value is a <code><a href="#scrolloptions">ScrollOptions</a></code> object, let <var>y</var> be the value of the <code title="">y</code> dictionary member. Otherwise,
924-
let <var>y</var> be the given value.</li>
926+
<li><p>If the given value is a <code><a href="#scrolloptionsvertical">ScrollOptionsVertical</a></code> object, and the <code title="">y</code> dictionary member is not present, abort these steps.
927+
<li><p>If the given value is a <code><a href="#scrolloptionsvertical">ScrollOptionsVertical</a></code> object, let <var>y</var> be the value of the <code title="">y</code> dictionary member.
928+
Otherwise, let <var>y</var> be the given value.</li>
925929
<li><p>If the element does not have any associated <a href="#css-layout-box">CSS layout box</a>, the
926930
element is the root element and the <code class="external" data-anolis-spec="dom"><a href="http://dom.spec.whatwg.org/#document">Document</a></code> is in
927931
<a class="external" data-anolis-spec="dom" href="http://dom.spec.whatwg.org/#concept-document-quirks" title="concept-document-quirks">quirks mode</a>, or the element has no associated scrolling box, or the element has no overflow,
928932
terminate these steps.</li>
929933
<li><p>If the element is the root element invoke
930934
<code title="dom-Window-scroll"><a href="#dom-window-scroll">scroll()</a></code> with zero as first
931-
argument and <var>y</var> as second, and, if the given value is a <code><a href="#scrolloptions">ScrollOptions</a></code> object, the given value as the third argument.</li>
935+
argument and <var>y</var> as second, and, if the given value is a <code><a href="#scrolloptionsvertical">ScrollOptionsVertical</a></code> object, the given value as the third argument.</li>
932936
<li><p>If the element is <a href="#the-html-body-element">the HTML <code title="">body</code> element</a>,
933937
the <code class="external" data-anolis-spec="dom"><a href="http://dom.spec.whatwg.org/#document">Document</a></code> is in <a class="external" data-anolis-spec="dom" href="http://dom.spec.whatwg.org/#concept-document-quirks" title="concept-document-quirks">quirks mode</a>, and the element
934938
does not have any vertical overflow, invoke
935939
<code title="dom-Window-scroll"><a href="#dom-window-scroll">scroll()</a></code> with
936940
<code title="dom-Window-scrollX"><a href="#dom-window-scrollx">scrollX</a></code> as first
937-
argument and <var>y</var> as second, and, if the given value is a <code><a href="#scrolloptions">ScrollOptions</a></code> object, the given value as the third argument.</li>
941+
argument and <var>y</var> as second, and, if the given value is a <code><a href="#scrolloptionsvertical">ScrollOptionsVertical</a></code> object, the given value as the third argument.</li>
938942
<li><p><a href="#scroll-an-element" title="scroll an element">Scroll the element</a> to
939943
<code title="dom-Element-scrollLeft"><a href="#dom-element-scrollleft">scrollLeft</a></code>,<var>y</var>, with the scroll behavior being the value of the <code title="">behavior</code> dictionary
940-
member if the given value is a <code><a href="#scrolloptions">ScrollOptions</a></code> object, or <code title="">auto</code> otherwise.
944+
member if the given value is a <code><a href="#scrolloptionsvertical">ScrollOptionsVertical</a></code> object, or <code title="">auto</code> otherwise.
941945
</ol>
942946

943947
<p>The <dfn id="dom-element-scrollleft" title="dom-Element-scrollLeft"><code>scrollLeft</code></dfn> attribute must return the result of running these steps:</p>
@@ -957,27 +961,27 @@ <h2 id="extensions-to-the-element-interface"><span class="secno">7 </span>Extens
957961
</ol>
958962
<p>When setting the <code title="dom-Element-scrollLeft"><a href="#dom-element-scrollleft">scrollLeft</a></code> attribute these steps must be run:</p>
959963
<ol>
960-
<li><p>If the given value is a <code><a href="#scrolloptions">ScrollOptions</a></code> object, and the <code title="">x</code> dictionary member is not present, abort these steps.
961-
<li><p>If the given value is a <code><a href="#scrolloptions">ScrollOptions</a></code> object, let <var>x</var> be the value of the <code title="">x</code> dictionary member. Otherwise,
962-
let <var>x</var> be the given value.</li>
964+
<li><p>If the given value is a <code><a href="#scrolloptionshorizontal">ScrollOptionsHorizontal</a></code> object, and the <code title="">x</code> dictionary member is not present, abort these steps.
965+
<li><p>If the given value is a <code><a href="#scrolloptionshorizontal">ScrollOptionsHorizontal</a></code> object, let <var>x</var> be the value of the <code title="">x</code> dictionary member.
966+
Otherwise, let <var>x</var> be the given value.</li>
963967
<li><p>If the element does not have any associated <a href="#css-layout-box">CSS layout box</a>, the
964968
element is the root element and the <code class="external" data-anolis-spec="dom"><a href="http://dom.spec.whatwg.org/#document">Document</a></code> is in
965969
<a class="external" data-anolis-spec="dom" href="http://dom.spec.whatwg.org/#concept-document-quirks" title="concept-document-quirks">quirks mode</a>, or the element has no associated scrolling box, or the element has no overflow,
966970
terminate these steps.</li>
967971
<li><p>If the element is the root element invoke
968972
<code title="dom-Window-scroll"><a href="#dom-window-scroll">scroll()</a></code> with
969-
<var>x</var> as first argument and zero as second, and, if the given value is a <code><a href="#scrolloptions">ScrollOptions</a></code> object, the given value as the third
973+
<var>x</var> as first argument and zero as second, and, if the given value is a <code><a href="#scrolloptionshorizontal">ScrollOptionsHorizontal</a></code> object, the given value as the third
970974
argument.</li>
971975
<li><p>If the element is <a href="#the-html-body-element">the HTML <code title="">body</code> element</a>,
972976
the <code class="external" data-anolis-spec="dom"><a href="http://dom.spec.whatwg.org/#document">Document</a></code> is in <a class="external" data-anolis-spec="dom" href="http://dom.spec.whatwg.org/#concept-document-quirks" title="concept-document-quirks">quirks mode</a>, and the element
973977
does not have any vertical overflow, invoke
974978
<code title="dom-Window-scroll"><a href="#dom-window-scroll">scroll()</a></code> with
975979
<var>x</var> as first argument and
976-
<code title="dom-Window-scrollY"><a href="#dom-window-scrolly">scrollY</a></code> as second, and, if the given value is a <code><a href="#scrolloptions">ScrollOptions</a></code> object, the given value as the third
980+
<code title="dom-Window-scrollY"><a href="#dom-window-scrolly">scrollY</a></code> as second, and, if the given value is a <code><a href="#scrolloptionshorizontal">ScrollOptionsHorizontal</a></code> object, the given value as the third
977981
argument.</li>
978982
<li><p><a href="#scroll-an-element" title="Scroll an element">Scroll the element</a> to
979983
<var>x</var>,<code title="dom-Element-scrollTop"><a href="#dom-element-scrolltop">scrollTop</a></code>, with the scroll behavior being the value of the <code title="">behavior</code> dictionary
980-
member if the given value is a <code><a href="#scrolloptions">ScrollOptions</a></code> object, or <code title="">auto</code> otherwise.
984+
member if the given value is a <code><a href="#scrolloptionshorizontal">ScrollOptionsHorizontal</a></code> object, or <code title="">auto</code> otherwise.
981985
</ol>
982986

983987
<p>The <dfn id="dom-element-scrollwidth" title="dom-Element-scrollWidth"><code>scrollWidth</code></dfn> attribute must return the result of running these steps:</p>

cssom-view/Overview.src.html

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -456,9 +456,13 @@ <h2>Extensions to the <code title>Window</code> Interface</h2>
456456
<pre class=idl>enum <dfn>ScrollBehavior</dfn> { "auto", "instant", "smooth" };
457457

458458
dictionary <dfn>ScrollOptions</dfn> {
459+
<span>ScrollBehavior</span> behavior = "auto";
460+
};
461+
dictionary <dfn>ScrollOptionsHorizontal</dfn> : <span>ScrollOptions</span> {
459462
double x;
463+
};
464+
dictionary <dfn>ScrollOptionsVertical</dfn> : <span>ScrollOptions</span> {
460465
double y;
461-
<span>ScrollBehavior</span> behavior = "auto";
462466
};
463467

464468
partial interface <span data-anolis-spec=html>Window</span> {
@@ -793,8 +797,8 @@ <h2>Extensions to the <code title>Element</code> Interface</h2>
793797
<span>ClientRectList</span> <span title=dom-Element-getClientRects>getClientRects</span>();
794798
<span>ClientRect</span> <span title=dom-Element-getBoundingClientRect>getBoundingClientRect</span>();
795799
void <span title=dom-Element-scrollIntoView>scrollIntoView</span>(optional boolean top = true, optional <span>ScrollOptions</span> options);
796-
attribute (double or <span>ScrollOptions</span>) <span title=dom-Element-scrollTop>scrollTop</span>;
797-
attribute (double or <span>ScrollOptions</span>) <span title=dom-Element-scrollLeft>scrollLeft</span>;
800+
attribute (double or <span>ScrollOptionsVertical</span>) <span title=dom-Element-scrollTop>scrollTop</span>;
801+
attribute (double or <span>ScrollOptionsHorizontal</span>) <span title=dom-Element-scrollLeft>scrollLeft</span>;
798802
readonly attribute double <span title=dom-Element-scrollWidth>scrollWidth</span>;
799803
readonly attribute double <span title=dom-Element-scrollHeight>scrollHeight</span>;
800804
readonly attribute double <span title=dom-Element-clientTop>clientTop</span>;
@@ -881,25 +885,25 @@ <h2>Extensions to the <code title>Element</code> Interface</h2>
881885
</ol>
882886
<p>When setting the <code title=dom-Element-scrollTop>scrollTop</code> attribute these steps must be run:</p>
883887
<ol>
884-
<li><p>If the given value is a <code>ScrollOptions</code> object, and the <code title>y</code> dictionary member is not present, abort these steps.
885-
<li><p>If the given value is a <code>ScrollOptions</code> object, let <var>y</var> be the value of the <code title>y</code> dictionary member. Otherwise,
886-
let <var>y</var> be the given value.</p></li>
888+
<li><p>If the given value is a <code>ScrollOptionsVertical</code> object, and the <code title>y</code> dictionary member is not present, abort these steps.
889+
<li><p>If the given value is a <code>ScrollOptionsVertical</code> object, let <var>y</var> be the value of the <code title>y</code> dictionary member.
890+
Otherwise, let <var>y</var> be the given value.</p></li>
887891
<li><p>If the element does not have any associated <span>CSS layout box</span>, the
888892
element is the root element and the <code data-anolis-spec=dom>Document</code> is in
889893
<span data-anolis-spec=dom title=concept-document-quirks>quirks mode</span>, or the element has no associated scrolling box, or the element has no overflow,
890894
terminate these steps.</p></li>
891895
<li><p>If the element is the root element invoke
892896
<code title=dom-Window-scroll>scroll()</code> with zero as first
893-
argument and <var>y</var> as second, and, if the given value is a <code>ScrollOptions</code> object, the given value as the third argument.</p></li>
897+
argument and <var>y</var> as second, and, if the given value is a <code>ScrollOptionsVertical</code> object, the given value as the third argument.</p></li>
894898
<li><p>If the element is <span>the HTML <code title>body</code> element</span>,
895899
the <code data-anolis-spec=dom>Document</code> is in <span data-anolis-spec=dom title=concept-document-quirks>quirks mode</span>, and the element
896900
does not have any vertical overflow, invoke
897901
<code title=dom-Window-scroll>scroll()</code> with
898902
<code title=dom-Window-scrollX>scrollX</code> as first
899-
argument and <var>y</var> as second, and, if the given value is a <code>ScrollOptions</code> object, the given value as the third argument.</p></li>
903+
argument and <var>y</var> as second, and, if the given value is a <code>ScrollOptionsVertical</code> object, the given value as the third argument.</p></li>
900904
<li><p><span title='scroll an element'>Scroll the element</span> to
901905
<code title=dom-Element-scrollLeft>scrollLeft</code>,<var>y</var>, with the scroll behavior being the value of the <code title>behavior</code> dictionary
902-
member if the given value is a <code>ScrollOptions</code> object, or <code title>auto</code> otherwise.
906+
member if the given value is a <code>ScrollOptionsVertical</code> object, or <code title>auto</code> otherwise.
903907
</ol>
904908

905909
<p>The <dfn title=dom-Element-scrollLeft><code>scrollLeft</code></dfn> attribute must return the result of running these steps:</p>
@@ -919,27 +923,27 @@ <h2>Extensions to the <code title>Element</code> Interface</h2>
919923
</ol>
920924
<p>When setting the <code title=dom-Element-scrollLeft>scrollLeft</code> attribute these steps must be run:</p>
921925
<ol>
922-
<li><p>If the given value is a <code>ScrollOptions</code> object, and the <code title>x</code> dictionary member is not present, abort these steps.
923-
<li><p>If the given value is a <code>ScrollOptions</code> object, let <var>x</var> be the value of the <code title>x</code> dictionary member. Otherwise,
924-
let <var>x</var> be the given value.</p></li>
926+
<li><p>If the given value is a <code>ScrollOptionsHorizontal</code> object, and the <code title>x</code> dictionary member is not present, abort these steps.
927+
<li><p>If the given value is a <code>ScrollOptionsHorizontal</code> object, let <var>x</var> be the value of the <code title>x</code> dictionary member.
928+
Otherwise, let <var>x</var> be the given value.</p></li>
925929
<li><p>If the element does not have any associated <span>CSS layout box</span>, the
926930
element is the root element and the <code data-anolis-spec=dom>Document</code> is in
927931
<span data-anolis-spec=dom title=concept-document-quirks>quirks mode</span>, or the element has no associated scrolling box, or the element has no overflow,
928932
terminate these steps.</p></li>
929933
<li><p>If the element is the root element invoke
930934
<code title=dom-Window-scroll>scroll()</code> with
931-
<var>x</var> as first argument and zero as second, and, if the given value is a <code>ScrollOptions</code> object, the given value as the third
935+
<var>x</var> as first argument and zero as second, and, if the given value is a <code>ScrollOptionsHorizontal</code> object, the given value as the third
932936
argument.</p></li>
933937
<li><p>If the element is <span>the HTML <code title>body</code> element</span>,
934938
the <code data-anolis-spec=dom>Document</code> is in <span data-anolis-spec=dom title=concept-document-quirks>quirks mode</span>, and the element
935939
does not have any vertical overflow, invoke
936940
<code title='dom-Window-scroll'>scroll()</code> with
937941
<var>x</var> as first argument and
938-
<code title=dom-Window-scrollY>scrollY</code> as second, and, if the given value is a <code>ScrollOptions</code> object, the given value as the third
942+
<code title=dom-Window-scrollY>scrollY</code> as second, and, if the given value is a <code>ScrollOptionsHorizontal</code> object, the given value as the third
939943
argument.</p></li>
940944
<li><p><span title='Scroll an element'>Scroll the element</span> to
941945
<var>x</var>,<code title=dom-Element-scrollTop>scrollTop</code>, with the scroll behavior being the value of the <code title>behavior</code> dictionary
942-
member if the given value is a <code>ScrollOptions</code> object, or <code title>auto</code> otherwise.
946+
member if the given value is a <code>ScrollOptionsHorizontal</code> object, or <code title>auto</code> otherwise.
943947
</ol>
944948

945949
<p>The <dfn title=dom-Element-scrollWidth><code>scrollWidth</code></dfn> attribute must return the result of running these steps:</p>

cssom/Overview.src.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2166,7 +2166,7 @@ <h4>The <code title>CSSStyleDeclaration</code> Interface</h4>
21662166
void <span title=dom-CSSStyleDeclaration-setProperty>setProperty</span>(DOMString property, [TreatNullAs=EmptyString] DOMString value, <!--
21672167
-->[TreatNullAs=EmptyString] optional DOMString priority);
21682168
DOMString <span title=dom-CSSStyleDeclaration-removeProperty>removeProperty</span>(DOMString property);
2169-
readonly attribute <span>CSSRule</span>? <span title=dom-CSSStyleDeclaration-length>parentRule</span>;
2169+
readonly attribute <span>CSSRule</span>? <span title=dom-CSSStyleDeclaration-parentRule>parentRule</span>;
21702170
attribute DOMString <span title=dom-CSSStyleDeclaration-cssFloat>cssFloat</span>;<!-- setProperty's value arg has [TreatNullAs=EmptyString] -->
21712171
};</pre>
21722172

@@ -2292,8 +2292,8 @@ <h4>The <code title>CSSStyleDeclaration</code> Interface</h4>
22922292
<li><p>Return <var>value</var>.
22932293
</ol>
22942294

2295-
<p>The <dfn title=dom-CSSStyleDeclaration-parentRule><code>parentRule</code></dfn> attribute must return the <code>CSSrule</code> object the
2296-
<code>CSSStyleDeclaration</code> is object is associated with or null if it is not associated with a <code>CSSrule</code> object.</p>
2295+
<p>The <dfn title=dom-CSSStyleDeclaration-parentRule><code>parentRule</code></dfn> attribute must return the <code>CSSRule</code> object the
2296+
<code>CSSStyleDeclaration</code> is object is associated with or null if it is not associated with a <code>CSSRule</code> object.</p>
22972297

22982298
<p>The <dfn title=dom-CSSStyleDeclaration-cssFloat><code>cssFloat</code></dfn>
22992299
attribute, on getting, must return the result of invoking

0 commit comments

Comments
 (0)