Skip to content

Commit 75303b3

Browse files
committed
(1) move CSSStyleDeclaration member documentation into IDL;
(2) fix idl makefile deps
1 parent 58d7539 commit 75303b3

5 files changed

Lines changed: 126 additions & 442 deletions

File tree

cssom/Overview.html

Lines changed: 20 additions & 143 deletions
Original file line numberDiff line numberDiff line change
@@ -1805,7 +1805,7 @@ <h3 id="css-declaration-blocks"><span class="secno">6.5 </span>CSS Declaration B
18051805

18061806
<p class="note">The <a href="#css-declaration-block-declarations">CSS declaration block declarations</a> are
18071807
ordered. This matters for the
1808-
<code title="dom-CSSStyleDeclaration-item"><a href="#dom-cssstyledeclaration-item">item()</a></code> method.</p>
1808+
<code title="dom-CSSStyleDeclaration-item">item()</code> method.</p>
18091809

18101810

18111811
<p class="XXX">To
@@ -1822,7 +1822,7 @@ <h3 id="css-declaration-blocks"><span class="secno">6.5 </span>CSS Declaration B
18221822

18231823
<h4 id="the-cssstyledeclaration-interface"><span class="secno">6.5.1 </span>The <code>CSSStyleDeclaration</code> Interface</h4>
18241824

1825-
1825+
<p>The <code>CSSStyleDeclaration</code> interface represents a <a href="#css-declaration-block">CSS declaration block</a>, including its underlying state, where this underlying state depends upon the source of the <code>CSSStyleDeclaration</code> instance.</p>
18261826
<pre class="idl"><span class="idlInterface" id="widl-def-CSSStyleDeclaration">interface <span class="idlInterfaceID">CSSStyleDeclaration</span> {
18271827
<span class="idlAttribute"> attribute <span class="idlAttrType"><a>DOMString</a></span> <span class="idlAttrName"><a href="#widl-CSSStyleDeclaration-cssText">cssText</a></span>;</span>
18281828
<span class="idlAttribute"> readonly attribute <span class="idlAttrType"><a>unsigned long</a></span> <span class="idlAttrName"><a href="#widl-CSSStyleDeclaration-length">length</a></span>;</span>
@@ -1836,175 +1836,52 @@ <h4 id="the-cssstyledeclaration-interface"><span class="secno">6.5.1 </span>The
18361836
<dl class="attributes">
18371837
<dt class="attribute">
18381838
<code>cssText</code> of type <span class="idlAttrType"><a>DOMString</a></span></dt>
1839+
<dd>
1840+
<p>The <code>cssText</code> attribute must return the result of <a href="#serialize-a-css-declaration-block" title="serialize a CSS declaration block">serializing</a> the <a href="#css-declaration-block-declarations">CSS declaration block declarations</a>.</p> <p>Setting the <code>cssText</code> attribute must run these steps: <ol> <li><p>If the <a href="#css-declaration-block-readonly-flag">CSS declaration block readonly flag</a> is set, <a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-throw" title="concept-throw">throw</a> a <code class="external"><a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#nomodificationallowederror">NoModificationAllowedError</a></code> exception and terminate these steps.</li> <li><p>Empty the <a href="#css-declaration-block-declarations">CSS declaration block declarations</a>.</li> <li><p><a href="#parse-a-css-declaration-block" title="Parse a CSS declaration block">Parse</a> the given value and, if the return value is not null, insert it into the <a href="#css-declaration-block-declarations">CSS declaration block declarations</a>.</li> </ol></dd>
18391841
<dt class="attribute">
18401842
<code>length</code> of type <span class="idlAttrType"><a>unsigned long</a></span>, readonly</dt>
1843+
<dd>
1844+
<p>The <code>length</code> attribute must return the number of declarations in the <span>collection of CSS declarations</span>.</dd>
18411845
<dt class="attribute">
18421846
<code>parentRule</code> of type <span class="idlAttrType"><a>CSSRule</a></span>, readonly</dt>
1847+
<dd>
1848+
<p>The <code>parentRule</code> attribute must return the <code>CSSrule</code> object the <code>CSSStyleDeclaration</code> is object is associated with or null if it is not associated with a <code>CSSrule</code> object.</dd>
18431849
</dl>
18441850
<dl class="methods">
18451851
<dt class="method">
18461852
<code>item</code> (<span class="idlParam"><span class="idlParamType"><a>unsigned long</a></span></span>), returns <span class="idlMethType"><a>DOMString</a></span></dt>
1853+
<dd>
1854+
<p>The <code>item</code> operation must return the property at position <var>index</var>.</dd>
18471855
<dt class="method">
18481856
<code>getPropertyValue</code> (<span class="idlParam"><span class="idlParamType"><a>DOMString</a></span></span>), returns <span class="idlMethType"><a>DOMString</a></span></dt>
1857+
<dd>
1858+
<p>The <code>getPropertyValue</code> operation must ...</dd>
18491859
<dt class="method">
18501860
<code>getPropertyPriority</code> (<span class="idlParam"><span class="idlParamType"><a>DOMString</a></span></span>), returns <span class="idlMethType"><a>DOMString</a></span></dt>
1861+
<dd>
1862+
<p>The <code>getPropertyPriority</code> operation, when invoked, if <var>property</var> is an <a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#ascii-case-insensitive">ASCII case-insensitive</a> match for a property that has a priority user agents must return the canonical priority of that property as given in the syntax definition. Otherwise, the empty string must be returned.</p> <p class="example">E.g. for <code>background-color:lime !IMPORTANT</code> the return value would be '<code>important</code>'.</dd>
18511863
<dt class="method">
18521864
<code>setProperty</code> (<span class="idlParam"><span class="idlParamType"><a>DOMString</a></span></span>, <span class="idlParam"><span class="idlParamType"><a>DOMString</a></span></span>, <span class="idlParam">optional <span class="idlParamType"><a>DOMString</a></span></span>), returns <span class="idlMethType"><a>void</a></span></dt>
1865+
<dd>
1866+
<p>The <code>setProperty</code> operation must run these steps:</p> <ol> <li><p>If the <a href="#css-declaration-block-readonly-flag">CSS declaration block readonly flag</a> is set, <a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-throw" title="concept-throw">throw</a> an '<code class="external"><a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#nomodificationallowederror">NoModificationAllowedError</a></code>' and terminate these steps.</li> <li><p>If <var>property</var> is not an <a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#ascii-case-insensitive">ASCII case-insensitive</a> match for a supported property, terminate this algorithm.</li> <li><p>If <var>value</var> is the empty string, invoke <code title="dom-CSSStyleDeclaration-removeProperty">removeProperty()</code> with <var>property</var> as argument and terminate this algorithm.</li> <li><p>If the <var>priority</var> argument has been omitted let <var>priority</var> be the empty string.</li> <li><p>If <var>priority</var> is neither a valid priority nor the empty string terminate this algorithm.</li> <li> <p>If <a href="#parse-a-css-value" title="parse a CSS value">parsing the <var>value</var></a> returns null terminate this algorithm. <p class="note"><var>value</var> can not include '<code>!important</code>'.</p> </li> <li><p>Finally, set <var>property</var> to <var>value</var> with priority <var>priority</var> when <var>priority</var> is not the empty string. Otherwise set <var>property</var> to <var>value</var>.</li> </ol></dd>
18531867
<dt class="method">
18541868
<code>removeProperty</code> (<span class="idlParam"><span class="idlParamType"><a>DOMString</a></span></span>), returns <span class="idlMethType"><a>DOMString</a></span></dt>
1869+
<dd>
1870+
<p>The <code>removeProperty</code> operation must run these steps:</p> <ol> <li><p>If the <a href="#css-declaration-block-readonly-flag">CSS declaration block readonly flag</a> is set, <a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-throw" title="concept-throw">throw</a> a '<code class="external"><a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#nomodificationallowederror">NoModificationAllowedError</a></code>' and terminate these steps.</li> <li><p>If <var>property</var> is an <a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#ascii-case-insensitive">ASCII case-insensitive</a> match for a property of a declaration in the <span>collection of CSS declarations</span> remove the declaration.</li> </ol></dd>
18551871
</dl>
18561872

18571873

1858-
<!--
1859-
<pre class="idl">interface <dfn>CSSStyleDeclaration</dfn> {
1860-
attribute DOMString <span title="dom-CSSStyleDeclaration-cssText">cssText</span>;
1861-
1862-
readonly attribute unsigned long <span title="dom-CSSStyleDeclaration-length">length</span>;
1863-
DOMString <span title="dom-CSSStyleDeclaration-item">item</span>(unsigned long <var>index</var>);
1864-
1865-
DOMString <span title="dom-CSSStyleDeclaration-getPropertyValue">getPropertyValue</span>(DOMString <var>property</var>);
1866-
DOMString <span title="dom-CSSStyleDeclaration-getPropertyPriority">getPropertyPriority</span>(DOMString <var>property</var>);
1867-
void <span title="dom-CSSStyleDeclaration-setProperty">setProperty</span>(DOMString <var>property</var>, DOMString <var>value</var>, optional DOMString <var>priority</var>);
1868-
DOMString <span title="dom-CSSStyleDeclaration-removeProperty">removeProperty</span>(DOMString <var>property</var>);
1869-
1870-
readonly attribute <span>CSSRule</span> <span title="dom-CSSStyleDeclaration-parentRule">parentRule</span>;
1871-
1872-
// CSS Properties
1873-
};</pre>
1874-
-->
1875-
1876-
<p>The
1877-
<dfn id="dom-cssstyledeclaration-csstext" title="dom-CSSStyleDeclaration-cssText"><code>cssText</code></dfn>
1878-
attribute must return the result of
1879-
<a href="#serialize-a-css-declaration-block" title="serialize a CSS declaration block">serializing</a> the
1880-
<a href="#css-declaration-block-declarations">CSS declaration block declarations</a>.</p>
1881-
1882-
<p>Setting the <code>cssText</code> attribute must run these steps:
1883-
1884-
<ol>
1885-
<li><p>If the <a href="#css-declaration-block-readonly-flag">CSS declaration block readonly flag</a> is set,
1886-
<a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-throw" title="concept-throw">throw</a> a
1887-
"<code class="external"><a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#nomodificationallowederror">NoModificationAllowedError</a></code>" exception
1888-
and terminate these steps.</li>
1889-
1890-
<li><p>Empty the <a href="#css-declaration-block-declarations">CSS declaration block declarations</a>.</li>
1891-
1892-
<li><p><a href="#parse-a-css-declaration-block" title="Parse a CSS declaration block">Parse</a> the given
1893-
value and, if the return value is not null, insert it into the
1894-
<a href="#css-declaration-block-declarations">CSS declaration block declarations</a>.</li>
1895-
</ol>
1896-
1897-
1898-
<!-- XXX WebIDL work -->
1899-
<p>The
1900-
<dfn id="dom-cssstyledeclaration-length" title="dom-CSSStyleDeclaration-length"><code>length</code></dfn>
1901-
attribute must return the number of declarations in
1902-
the <span>collection of CSS declarations</span>.</p>
1903-
1904-
<p>The
1905-
<dfn id="dom-cssstyledeclaration-item" title="dom-CSSStyleDeclaration-item"><code>item(<var>index</var>)</code></dfn>
1906-
method must <span class="XXX">...</span>.</p>
1907-
<!-- returns the name of property at position index. -->
1908-
1909-
1910-
<p>The
1911-
<dfn id="dom-cssstyledeclaration-getpropertyvalue" title="dom-CSSStyleDeclaration-getPropertyValue"><code>getPropertyValue(<var>property</var>)</code></dfn>
1912-
method must <span class="XXX">...</span>.</p>
1913-
<!-- Once we have defined how everything will be canonicalized we can start
1914-
thinking about this... --><p></p>
1915-
1916-
<p>The
1917-
<dfn id="dom-cssstyledeclaration-getpropertypriority" title="dom-CSSStyleDeclaration-getPropertyPriority"><code>getPropertyPriority(<var>property</var>)</code></dfn>
1918-
method, when invoked, if <var>property</var> is an
1919-
<a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#ascii-case-insensitive">ASCII case-insensitive</a> match for a
1920-
property that has a priority user agents must return the canonical
1921-
priority of that property as given in the syntax definition. Otherwise,
1922-
the empty string must be returned.</p>
1923-
1924-
<p class="example">E.g. for <code>background-color:lime !IMPORTANT</code>
1925-
the return value would be "<code>important</code>".</p>
1926-
1927-
1928-
<p>The
1929-
<dfn id="dom-cssstyledeclaration-setproperty" title="dom-CSSStyleDeclaration-setProperty"><code>setProperty(<var>property</var>, <var>value</var>, <var>priority</var>)</code></dfn>
1930-
method must run these steps:
1931-
1932-
<ol>
1933-
<li><p>If the <a href="#css-declaration-block-readonly-flag">CSS declaration block readonly flag</a> is set,
1934-
<a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-throw" title="concept-throw">throw</a> an
1935-
"<code class="external"><a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#nomodificationallowederror">NoModificationAllowedError</a></code>" and
1936-
terminate these steps.</li>
1937-
1938-
<li><p>If <var>property</var> is not an
1939-
<a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#ascii-case-insensitive">ASCII case-insensitive</a> match for a
1940-
supported property, terminate this algorithm.</li>
1941-
1942-
<li><p>If <var>value</var> is the empty string, invoke
1943-
<code title="dom-CSSStyleDeclaration-removeProperty"><a href="#dom-cssstyledeclaration-removeproperty">removeProperty()</a></code>
1944-
with <var>property</var> as argument and terminate this
1945-
algorithm.</li>
1946-
1947-
<li><p>If the <var>priority</var> argument has been omitted let
1948-
<var>priority</var> be the empty string.</li>
1949-
1950-
<li><p>If <var>priority</var> is neither a valid priority nor
1951-
the empty string terminate this algorithm.</li>
1952-
<!-- define valid priority somehow -->
1953-
1954-
<li>
1955-
<p>If <a href="#parse-a-css-value" title="parse a CSS value">parsing the
1956-
<var>value</var></a> returns null terminate this algorithm.
1957-
1958-
<p class="note"><var>value</var> can not include
1959-
"<code>!important</code>".</p>
1960-
</li>
1961-
1962-
<li><p>Finally, set <var>property</var> to <var>value</var>
1963-
with priority <var>priority</var> when <var>priority</var>
1964-
is not the empty string. Otherwise set
1965-
<var>property</var> to <var>value</var>.</li>
1966-
</ol>
1967-
1968-
<p>The
1969-
<dfn id="dom-cssstyledeclaration-removeproperty" title="dom-CSSStyleDeclaration-removeProperty"><code>removeProperty(<var>property</var>)</code></dfn>
1970-
method must run these steps:
1971-
1972-
<ol>
1973-
<li><p>If the <a href="#css-declaration-block-readonly-flag">CSS declaration block readonly flag</a> is set,
1974-
<a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-throw" title="concept-throw">throw</a> a
1975-
"<code class="external"><a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#nomodificationallowederror">NoModificationAllowedError</a></code>" and
1976-
terminate these steps.</li>
1977-
1978-
<li><p>If <var>property</var> is an
1979-
<a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#ascii-case-insensitive">ASCII case-insensitive</a> match for a
1980-
property of a declaration in the
1981-
<span>collection of CSS declarations</span> remove the declaration.</li>
1982-
</ol>
1983-
1984-
1985-
<p>The
1986-
<dfn id="dom-cssstyledeclaration-values" title="dom-CSSStyleDeclaration-values"><code>values</code></dfn>
1987-
attribute must return <span class="XXX">...</span></p>
1988-
1989-
1990-
<p>The
1991-
<dfn id="dom-cssstyledeclaration-parentrule" title="dom-CSSStyleDeclaration-parentRule"><code>parentRule</code></dfn>
1992-
attribute must return the <code>CSSrule</code> object the
1993-
<code>CSSStyleDeclaration</code> is object is associated with or null if
1994-
it is not associated with a <code>CSSrule</code> object.</p>
1995-
<!-- XXX introduce a concept for this instead -->
1996-
19971874
<hr>
19981875

19991876
<p>For the table below, the IDL attribute in the first column
20001877
must return the result of invoking
2001-
<code title="dom-CSSStyleDeclaration-getPropertyValue"><a href="#dom-cssstyledeclaration-getpropertyvalue">getPropertyValue()</a></code>
1878+
<code title="dom-CSSStyleDeclaration-getPropertyValue">getPropertyValue()</code>
20021879
with as argument the CSS property given in the second column on the same
20031880
row.</p>
20041881

20051882
<p>Similarly for the table below, setting the IDL attribute in the
20061883
first column must invoke
2007-
<code title="dom-CSSStyleDeclaration-setProperty"><a href="#dom-cssstyledeclaration-setproperty">setProperty()</a></code>
1884+
<code title="dom-CSSStyleDeclaration-setProperty">setProperty()</code>
20081885
with as first argument the CSS property given in the second column on the
20091886
same row, as second argument the given value, and no third argument. Any
20101887
exceptions thrown must be re-thrown.</p>

0 commit comments

Comments
 (0)