[cssom] Expose 'float' and 'font-size' etc IDL attributes on CSSStyleDeclaration. http://www.w3.org/mid/4F3C1122.6020306@mit.edu

Tue, 04 Jun 2013 21:28:41 +0200

author
Simon Pieters <simonp@opera.com>
date
Tue, 04 Jun 2013 21:28:41 +0200
changeset 8351
19cb06f0d5fb
parent 8350
2929095f9309
child 8352
03ae20715300

[cssom] Expose 'float' and 'font-size' etc IDL attributes on CSSStyleDeclaration. http://www.w3.org/mid/4F3C1122.6020306@mit.edu

cssom/Overview.html file | annotate | diff | comparison | revisions
cssom/Overview.src.html file | annotate | diff | comparison | revisions
     1.1 --- a/cssom/Overview.html	Tue Jun 04 20:27:07 2013 +0200
     1.2 +++ b/cssom/Overview.html	Tue Jun 04 21:28:41 2013 +0200
     1.3 @@ -2264,26 +2264,50 @@
     1.4  <code title="">float</code> as first argument, as second argument the given value, and no third argument.
     1.5  Any exceptions thrown must be re-thrown.
     1.6  
     1.7 -<p>For each CSS property <var title="">property</var> that the user agent supports, except for
     1.8 -the 'float' property, the following partial interface applies where <var title="">attribute</var>
     1.9 +<p>For each CSS property <var title="">property</var> that the user agent supports,
    1.10 +the following partial interface applies where <var title="">camel-cased attribute</var>
    1.11  is obtained by running the <a href="#css-property-to-idl-attribute">CSS property to IDL attribute</a> algorithm for
    1.12  <var>property</var>.</p>
    1.13  
    1.14  <pre class="idl">partial interface <a href="#cssstyledeclaration">CSSStyleDeclaration</a> {
    1.15 -           attribute DOMString _<var title="dom-CSSStyleDeclaration-attribute"><a href="#dom-cssstyledeclaration-attribute">attribute</a></var>;
    1.16 +           attribute DOMString _<a href="#dom-cssstyledeclaration-camel-cased-attribute" title="dom-CSSStyleDeclaration-camel-cased-attribute"><var title="">camel-cased attribute</var></a>;
    1.17  };</pre>
    1.18  
    1.19 -<p>The <dfn id="dom-cssstyledeclaration-attribute" title="dom-CSSStyleDeclaration-attribute"><code><var title="">attribute</var></code></dfn> attribute, on getting, must return the result of invoking
    1.20 -<code title="dom-CSSStyleDeclaration-getPropertyValue"><a href="#dom-cssstyledeclaration-getpropertyvalue">getPropertyValue()</a></code> with the
    1.21 +<p>The <dfn id="dom-cssstyledeclaration-camel-cased-attribute" title="dom-CSSStyleDeclaration-camel-cased-attribute"><code><var title="">camel-cased attribute</var></code></dfn> attribute, on getting, must return the
    1.22 +result of invoking <code title="dom-CSSStyleDeclaration-getPropertyValue"><a href="#dom-cssstyledeclaration-getpropertyvalue">getPropertyValue()</a></code> with the
    1.23  argument being the result of running the <a href="#idl-attribute-to-css-property">IDL attribute to CSS property</a>
    1.24 -algorithm for <var>attribute</var>.</p>
    1.25 -
    1.26 -<p>Setting the <code title="dom-CSSStyleDeclaration-attribute"><a href="#dom-cssstyledeclaration-attribute"><var>attribute</var></a></code> attribute must invoke
    1.27 +algorithm for <var title="">camel-cased attribute</var>.</p>
    1.28 +
    1.29 +<p>Setting the <code title="dom-CSSStyleDeclaration-camel-cased-attribute"><a href="#dom-cssstyledeclaration-camel-cased-attribute"><var title="">camel-cased attribute</var></a></code> attribute must invoke
    1.30  <code title="dom-CSSStyleDeclaration-setProperty"><a href="#dom-cssstyledeclaration-setproperty">setProperty()</a></code> with the
    1.31  first argument being the result of running the <a href="#idl-attribute-to-css-property">IDL attribute to CSS property</a>
    1.32 -algorithm for <var>attribute</var>, as second argument the given value, and no third argument. Any
    1.33 +algorithm for <var title="">camel-cased attribute</var>, as second argument the given value, and no third argument. Any
    1.34  exceptions thrown must be re-thrown.</p>
    1.35  
    1.36 +<p class="example">For example, for the 'font-size' property there would be a <code title="">fontSize</code> IDL attribute.
    1.37 +
    1.38 +<p>For each CSS property <var title="">property</var> that the user agent supports, except for properties that have no "<code title="">-</code>" (U+002D) in the
    1.39 +property name, user agents must act as if there was a WebIDL <a class="external" href="http://dev.w3.org/2006/webapi/WebIDL/#dfn-regular-attribute">regular attribute</a> member as part of the
    1.40 +<code><a href="#cssstyledeclaration">CSSStyleDeclaration</a></code> interface with the type being <code title="">DOMString</code> and the <a class="external" href="http://dev.w3.org/2006/webapi/WebIDL/#dfn-identifier">identifier</a> being
    1.41 +<var title="">property</var>, and let <var title="">dashed attribute</var> be <var title="">property</var>.
    1.42 +
    1.43 +<p>The <dfn id="dom-cssstyledeclaration-dashed-attribute" title="dom-CSSStyleDeclaration-dashed-attribute"><code><var title="">dashed attribute</var></code></dfn> attribute, on getting, must return the
    1.44 +result of invoking <code title="dom-CSSStyleDeclaration-getPropertyValue"><a href="#dom-cssstyledeclaration-getpropertyvalue">getPropertyValue()</a></code> with the
    1.45 +argument being <var title="">dashed attribute</var>.</p>
    1.46 +
    1.47 +<p>Setting the <code title="dom-CSSStyleDeclaration-dashed-attribute"><a href="#dom-cssstyledeclaration-dashed-attribute"><var title="">dashed attribute</var></a></code> attribute must invoke
    1.48 +<code title="dom-CSSStyleDeclaration-setProperty"><a href="#dom-cssstyledeclaration-setproperty">setProperty()</a></code> with the
    1.49 +first argument being <var title="">dashed attribute</var>, as second argument the given value, and no third argument. Any
    1.50 +exceptions thrown must be re-thrown.</p>
    1.51 +
    1.52 +<div class="example">
    1.53 + <p>For example, for the 'font-size' property there would be a <code title="">font-size</code> IDL attribute. In JavaScript, the property can be accessed as
    1.54 + follows, assuming <var title="">element</var> is an <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#html-elements" title="HTML elements">HTML element</a>:
    1.55 + <pre><var title="">element</var>.style['font-size'];</pre>
    1.56 +</div>
    1.57 +
    1.58 +<p class="note">WebIDL does not allow dashes in identifiers in its syntax.
    1.59 +
    1.60  <p>The <dfn id="css-property-to-idl-attribute">CSS property to IDL attribute</dfn> algorithm for <var title="">property</var> is as
    1.61  follows:</p>
    1.62  
     2.1 --- a/cssom/Overview.src.html	Tue Jun 04 20:27:07 2013 +0200
     2.2 +++ b/cssom/Overview.src.html	Tue Jun 04 21:28:41 2013 +0200
     2.3 @@ -2195,26 +2195,50 @@
     2.4  <code title>float</code> as first argument, as second argument the given value, and no third argument.
     2.5  Any exceptions thrown must be re-thrown.
     2.6  
     2.7 -<p>For each CSS property <var title>property</var> that the user agent supports, except for
     2.8 -the 'float' property, the following partial interface applies where <var title>attribute</var>
     2.9 +<p>For each CSS property <var title>property</var> that the user agent supports,
    2.10 +the following partial interface applies where <var title>camel-cased attribute</var>
    2.11  is obtained by running the <span>CSS property to IDL attribute</span> algorithm for
    2.12  <var>property</var>.</p>
    2.13  
    2.14  <pre class=idl>partial interface <span>CSSStyleDeclaration</span> {
    2.15 -           attribute DOMString _<var title=dom-CSSStyleDeclaration-attribute>attribute</var>;
    2.16 +           attribute DOMString _<span title=dom-CSSStyleDeclaration-camel-cased-attribute><var title>camel-cased attribute</var></span>;
    2.17  };</pre>
    2.18  
    2.19 -<p>The <dfn title=dom-CSSStyleDeclaration-attribute><code><var title>attribute</var></code></dfn> attribute, on getting, must return the result of invoking
    2.20 -<code title=dom-CSSStyleDeclaration-getPropertyValue>getPropertyValue()</code> with the
    2.21 +<p>The <dfn title=dom-CSSStyleDeclaration-camel-cased-attribute><code><var title>camel-cased attribute</var></code></dfn> attribute, on getting, must return the
    2.22 +result of invoking <code title=dom-CSSStyleDeclaration-getPropertyValue>getPropertyValue()</code> with the
    2.23  argument being the result of running the <span>IDL attribute to CSS property</span>
    2.24 -algorithm for <var>attribute</var>.</p>
    2.25 -
    2.26 -<p>Setting the <code title=dom-CSSStyleDeclaration-attribute><var>attribute</var></code> attribute must invoke
    2.27 +algorithm for <var title>camel-cased attribute</var>.</p>
    2.28 +
    2.29 +<p>Setting the <code title=dom-CSSStyleDeclaration-camel-cased-attribute><var title>camel-cased attribute</var></code> attribute must invoke
    2.30  <code title=dom-CSSStyleDeclaration-setProperty>setProperty()</code> with the
    2.31  first argument being the result of running the <span>IDL attribute to CSS property</span>
    2.32 -algorithm for <var>attribute</var>, as second argument the given value, and no third argument. Any
    2.33 +algorithm for <var title>camel-cased attribute</var>, as second argument the given value, and no third argument. Any
    2.34  exceptions thrown must be re-thrown.</p>
    2.35  
    2.36 +<p class=example>For example, for the 'font-size' property there would be a <code title>fontSize</code> IDL attribute.
    2.37 +
    2.38 +<p>For each CSS property <var title>property</var> that the user agent supports, except for properties that have no "<code title>-</code>" (U+002D) in the
    2.39 +property name, user agents must act as if there was a WebIDL <span data-anolis-spec=webidl>regular attribute</span> member as part of the
    2.40 +<code>CSSStyleDeclaration</code> interface with the type being <code title>DOMString</code> and the <span data-anolis-spec=webidl>identifier</span> being
    2.41 +<var title>property</var>, and let <var title>dashed attribute</var> be <var title>property</var>.
    2.42 +
    2.43 +<p>The <dfn title=dom-CSSStyleDeclaration-dashed-attribute><code><var title>dashed attribute</var></code></dfn> attribute, on getting, must return the
    2.44 +result of invoking <code title=dom-CSSStyleDeclaration-getPropertyValue>getPropertyValue()</code> with the
    2.45 +argument being <var title>dashed attribute</var>.</p>
    2.46 +
    2.47 +<p>Setting the <code title=dom-CSSStyleDeclaration-dashed-attribute><var title>dashed attribute</var></code> attribute must invoke
    2.48 +<code title=dom-CSSStyleDeclaration-setProperty>setProperty()</code> with the
    2.49 +first argument being <var title>dashed attribute</var>, as second argument the given value, and no third argument. Any
    2.50 +exceptions thrown must be re-thrown.</p>
    2.51 +
    2.52 +<div class=example>
    2.53 + <p>For example, for the 'font-size' property there would be a <code title>font-size</code> IDL attribute. In JavaScript, the property can be accessed as
    2.54 + follows, assuming <var title>element</var> is an <span data-anolis-spec=html title="HTML elements">HTML element</span>:
    2.55 + <pre><var title>element</var>.style['font-size'];</pre>
    2.56 +</div>
    2.57 +
    2.58 +<p class=note>WebIDL does not allow dashes in identifiers in its syntax.
    2.59 +
    2.60  <p>The <dfn>CSS property to IDL attribute</dfn> algorithm for <var title>property</var> is as
    2.61  follows:</p>
    2.62  

mercurial