[cssom] add support for partial interfaces on existing interfaces and extended attributes on members

Thu, 25 Apr 2013 14:24:55 -0700

author
Glenn Adams <glenn@skynav.com>
date
Thu, 25 Apr 2013 14:24:55 -0700
changeset 8018
9ccea5fe11d4
parent 8017
5c6f1a2ed746
child 8019
cc1597d83935

[cssom] add support for partial interfaces on existing interfaces and extended attributes on members

cssom/Overview.html file | annotate | diff | comparison | revisions
cssom/README file | annotate | diff | comparison | revisions
cssom/cssom-generate.js file | annotate | diff | comparison | revisions
cssom/cssom-source file | annotate | diff | comparison | revisions
cssom/cssom.idl file | annotate | diff | comparison | revisions
cssom/data/xrefs/css/cssom.json file | annotate | diff | comparison | revisions
cssom/idl/CSSStyleDeclarationProperties.idl file | annotate | diff | comparison | revisions
     1.1 --- a/cssom/Overview.html	Thu Apr 25 14:17:50 2013 -0700
     1.2 +++ b/cssom/Overview.html	Thu Apr 25 14:24:55 2013 -0700
     1.3 @@ -8,7 +8,7 @@
     1.4    <div class="head">
     1.5     
     1.6  <!--begin-logo-->
     1.7 -<p><a href="http://www.w3.org/"><img alt="W3C" height="48" src="https://www.w3.org/Icons/w3c_home" width="72"></a></p>
     1.8 +<p><a href="http://www.w3.org/"><img alt="W3C" height="48" src="http://www.w3.org/Icons/w3c_home" width="72"></a></p>
     1.9  <!--end-logo-->
    1.10  
    1.11     <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
    1.12 @@ -1196,6 +1196,43 @@
    1.13  <p>The <code>enableStyleSheetsForSet</code> operation must, when invoked, run these steps:</p>    <ol>      <li><p>If <var>name</var> is <code>null</code> terminate these steps.</li>      <li><p><a href="#enable-a-style-sheet-set">Enable a style sheet set</a> with name <var>name</var>.</li>    </ol>    <p class="note"><span title="Style sheet">Style sheets</span> with an    empty <a href="#style-sheet-title">style sheet title</a> are never affected by this method.    This method does not change the values of the    <code title="dom-Document-lastStyleSheetSet">lastStyleSheetSet</code> or    <code title="dom-Document-preferredStyleSheetSet">preferredStyleSheetSet</code> attributes.</dd>
    1.14  </dl>
    1.15  
    1.16 +<pre class="idl"><span class="idlInterface" id="widl-def-Document">partial interface <span class="idlInterfaceID">Document</span> {
    1.17 +<span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a>StyleSheetList</a></span> <span class="idlAttrName"><a href="#widl-Document-styleSheets">styleSheets</a></span>;</span>
    1.18 +<span class="idlAttribute">    attribute <span class="idlAttrType"><a>DOMString</a>?</span> <span class="idlAttrName"><a href="#widl-Document-selectedStyleSheetSet">selectedStyleSheetSet</a></span>;</span>
    1.19 +<span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a>DOMString</a>?</span> <span class="idlAttrName"><a href="#widl-Document-lastStyleSheetSet">lastStyleSheetSet</a></span>;</span>
    1.20 +<span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a>DOMString</a>?</span> <span class="idlAttrName"><a href="#widl-Document-preferredStyleSheetSet">preferredStyleSheetSet</a></span>;</span>
    1.21 +<span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a>DOMString</a></span> <span class="idlAttrName"><a href="#widl-Document-styleSheetSets">styleSheetSets</a></span>;</span>
    1.22 +<span class="idlMethod">    <span class="idlMethType"><a>void</a></span> <span class="idlMethName"><a href="#widl-Document-enableStyleSheetsForSet-void-DOMString-name">enableStyleSheetsForSet</a></span> (<span class="idlParam"><span class="idlParamType"><a>DOMString</a>?</span> <span class="idlParamName">name</span></span>);</span>
    1.23 +};</span></pre>
    1.24 +<dl class="attributes">
    1.25 +<dt class="attribute" id="widl-Document-styleSheets">
    1.26 +<code>styleSheets</code> of type <span class="idlAttrType"><a>StyleSheetList</a></span>, readonly</dt>
    1.27 +<dd>
    1.28 +<p>The <code>styleSheets</code> attribute must return a <code>StyleSheetList</code> sequence representing    the <a href="#document-style-sheets">document style sheets</a>.</p>    <p class="note">Because of historical IDL limitations the <code>styleSheets</code> attribute    used to be on a separate interface, <code>DocumentStyle</code>.</dd>
    1.29 +<dt class="attribute" id="widl-Document-selectedStyleSheetSet">
    1.30 +<code>selectedStyleSheetSet</code> of type <span class="idlAttrType"><a>DOMString</a>?</span></dt>
    1.31 +<dd>
    1.32 +<p>The <code>selectedStyleSheetSet</code> attribute must, on getting, must run these steps:</p>    <ol>      <li><p>If there is a single <a href="#enabled-style-sheet-set">enabled style sheet set</a> and no      other <a href="#document-style-sheets">document style sheets</a> with a non-empty      <a href="#style-sheet-title">style sheet title</a> have the      <a href="#style-sheet-disabled-flag">style sheet disabled flag</a> unset, return the      <a href="#style-sheet-set-name">style sheet set name</a> of the      <a href="#enabled-style-sheet-set">enabled style sheet set</a> and terminate these steps.</li>            <li><p>Otherwise, if <span title="style sheet">style sheets</span> from      different <a href="#style-sheet-set" title="style sheet set">style sheet sets</a> have      their <a href="#style-sheet-disabled-flag">style sheet disabled flag</a> unset, return      <code>null</code> and terminate these steps.</li>            <li>       <p>Otherwise, return the empty string.</p>             <p class="note">At this point either all       <span title="style sheet">style sheets</span> with a non-empty       <a href="#style-sheet-title">style sheet title</a> have the       <a href="#style-sheet-disabled-flag">style sheet disabled flag</a> set, or there are no such       <span title="style sheet">style sheets</span>.</p>      </li>     </ol>        <p>On setting the    <code title="dom-Document-selectedStyleSheetSet">selectedStyleSheetSet</code>    attribute these steps must be run:</p>        <ol>      <li><p>If the value is <code>null</code> terminate this set of steps.</li>      <li><p>Otherwise, <a href="#select-a-style-sheet-set">select a style sheet set</a> with as name the      value passed.</li>    </ol>        <p>From the DOM's perspective, all views have the same    <code title="dom-Document-selectedStyleSheetSet">selectedStyleSheetSet</code>.    If a user agent supports multiple views with different selected    alternative style sheets, then this attribute (and the    <code>StyleSheet</code> interface's    <code title="dom-StyleSheet-disabled">disabled</code> attribute)    must return and set the value for the default    view.</dd>
    1.33 +<dt class="attribute" id="widl-Document-lastStyleSheetSet">
    1.34 +<code>lastStyleSheetSet</code> of type <span class="idlAttrType"><a>DOMString</a>?</span>, readonly</dt>
    1.35 +<dd>
    1.36 +<p>The <code>lastStyleSheetSet</code> attribute must  return the <a href="#last-style-sheet-set-name">last style sheet set name</a>.</p>    <p class="note">This attribute is initially <code>null</code>.</dd>
    1.37 +<dt class="attribute" id="widl-Document-preferredStyleSheetSet">
    1.38 +<code>preferredStyleSheetSet</code> of type <span class="idlAttrType"><a>DOMString</a>?</span>, readonly</dt>
    1.39 +<dd>
    1.40 +<p>The <code>preferredStyleSheetSet</code> attribute must  return the <a href="#preferred-style-sheet-set-name">preferred style sheet set name</a>.</p>    <p class="note">Unlike <code title="dom-Document-lastStyleSheetSet">lastStyleSheetSet</code>,    this attribute is initially the empty string.</dd>
    1.41 +<dt class="attribute" id="widl-Document-styleSheetSets">
    1.42 +<code>styleSheetSets</code> of type <span class="idlAttrType"><a>DOMString</a></span>, readonly</dt>
    1.43 +<dd>
    1.44 +<p>The <code>styleSheetSets</code> attribute must  return a list of the <a href="#style-sheet-set-name" title="style sheet set name">style    sheet set names</a> of the <a href="#style-sheet-set" title="style sheet set">style sheet sets</a>, in order    of the <a href="#document-style-sheets">document style sheets</a>.</p>    <p class="issue">The return value is intended to be 'DOMString[]', but the brackets are missing in the IDL due to a bug in the spec's build process.</dd>
    1.45 +</dl>
    1.46 +<dl class="methods">
    1.47 +<dt class="method" id="widl-Document-enableStyleSheetsForSet-void-DOMString-name">
    1.48 +<code>enableStyleSheetsForSet</code> (<span class="idlParam"><span class="idlParamType"><a>DOMString</a>?</span> <span class="idlParamName">name</span></span>), returns <span class="idlMethType"><a>void</a></span></dt>
    1.49 +<dd>
    1.50 +<p>The <code>enableStyleSheetsForSet</code> operation must, when invoked, run these steps:</p>    <ol>      <li><p>If <var>name</var> is <code>null</code> terminate these steps.</li>      <li><p><a href="#enable-a-style-sheet-set">Enable a style sheet set</a> with name <var>name</var>.</li>    </ol>    <p class="note"><span title="Style sheet">Style sheets</span> with an    empty <a href="#style-sheet-title">style sheet title</a> are never affected by this method.    This method does not change the values of the    <code title="dom-Document-lastStyleSheetSet">lastStyleSheetSet</code> or    <code title="dom-Document-preferredStyleSheetSet">preferredStyleSheetSet</code> attributes.</dd>
    1.51 +</dl>
    1.52 +
    1.53  
    1.54    <!-- ........................................................................................................................ -->
    1.55  
    1.56 @@ -1750,7 +1787,7 @@
    1.57    <p>The <code>CSSImportRule</code> interface represents an <code>@import</code> rule.</p>
    1.58  <pre class="idl"><span class="idlInterface" id="widl-def-CSSImportRule">interface <span class="idlInterfaceID">CSSImportRule</span> : <span class="idlSuperclass"><a class="idlType" href="#widl-def-CSSRule"><code>CSSRule</code></a></span> {
    1.59  <span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a>DOMString</a></span> <span class="idlAttrName"><a href="#widl-CSSImportRule-href">href</a></span>;</span>
    1.60 -<span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a>MediaList</a></span> <span class="idlAttrName"><a href="#widl-CSSImportRule-media">media</a></span>;</span>
    1.61 +<span class="idlAttribute">    [PutForwards=mediaText] readonly attribute <span class="idlAttrType"><a>MediaList</a></span> <span class="idlAttrName"><a href="#widl-CSSImportRule-media">media</a></span>;</span>
    1.62  <span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a>CSSStyleSheet</a></span> <span class="idlAttrName"><a href="#widl-CSSImportRule-styleSheet">styleSheet</a></span>;</span>
    1.63  };</span></pre>
    1.64  <dl class="attributes">
    1.65 @@ -1775,7 +1812,7 @@
    1.66  
    1.67    <p>The <code>CSSMediaRule</code> interface represents a <code>@media</code> rule.</p>
    1.68  <pre class="idl"><span class="idlInterface" id="widl-def-CSSMediaRule">interface <span class="idlInterfaceID">CSSMediaRule</span> : <span class="idlSuperclass"><a class="idlType" href="#widl-def-CSSRule"><code>CSSRule</code></a></span> {
    1.69 -<span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a>MediaList</a></span> <span class="idlAttrName"><a href="#widl-CSSMediaRule-media">media</a></span>;</span>
    1.70 +<span class="idlAttribute">    [PutForwards=mediaText] readonly attribute <span class="idlAttrType"><a>MediaList</a></span> <span class="idlAttrName"><a href="#widl-CSSMediaRule-media">media</a></span>;</span>
    1.71  <span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a>CSSRuleList</a></span> <span class="idlAttrName"><a href="#widl-CSSMediaRule-cssRules">cssRules</a></span>;</span>
    1.72  <span class="idlMethod">    <span class="idlMethType"><a>unsigned long</a></span> <span class="idlMethName"><a href="#widl-CSSMediaRule-insertRule-unsigned-long-DOMString-rule-unsigned-long-index">insertRule</a></span> (<span class="idlParam"><span class="idlParamType"><a>DOMString</a></span> <span class="idlParamName">rule</span></span>, <span class="idlParam"><span class="idlParamType"><a>unsigned long</a></span> <span class="idlParamName">index</span></span>);</span>
    1.73  <span class="idlMethod">    <span class="idlMethType"><a>void</a></span> <span class="idlMethName"><a href="#widl-CSSMediaRule-deleteRule-void-unsigned-long-index">deleteRule</a></span> (<span class="idlParam"><span class="idlParamType"><a>unsigned long</a></span> <span class="idlParamName">index</span></span>);</span>
    1.74 @@ -1977,43 +2014,28 @@
    1.75  <dd>
    1.76  <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://dom.spec.whatwg.org/#concept-throw" title="concept-throw">throw</a> a       '<code class="external"><a href="http://dom.spec.whatwg.org/#nomodificationallowederror">NoModificationAllowedError</a></code>' and terminate these steps.</li>     <li><p>Let <var>value</var> be the return value of invoking <code title="dom-CSSStyleDeclaration-getPropertyValue">getPropertyValue()</code>       with <var>property</var> as argument.     <li><p>If <var>property</var> is an <a class="external" href="http://dom.spec.whatwg.org/#ascii-case-insensitive">ASCII case-insensitive</a> match for a property of a declaration in the       <a href="#css-declaration-block-declarations">CSS declaration block declarations</a>, and that property is defined to be a case-insensitive property, remove the declaration.</li>     <li><p>If <var>property</var> is a <a class="external" href="http://dom.spec.whatwg.org/#case-sensitive">case-sensitive</a> match for a property of a declaration in the       <a href="#css-declaration-block-declarations">CSS declaration block declarations</a>, and that property is defined to be a case-sensitive property, remove the declaration.</li>     <li><p>Return <var>value</var>.    </ol></dd>
    1.77  </dl>
    1.78 +<p>If the user agent supports the 'float' CSS property, the following partial interface applies.</p>
    1.79 +<pre class="idl"><span class="idlInterface" id="widl-def-CSSStyleDeclaration">partial interface <span class="idlInterfaceID">CSSStyleDeclaration</span> {
    1.80 +<span class="idlAttribute">    [TreatNullAs=EmptyString] attribute <span class="idlAttrType"><a>DOMString</a></span> <span class="idlAttrName"><a href="#widl-CSSStyleDeclaration-cssFloat">cssFloat</a></span>;</span>
    1.81 +};</span></pre>
    1.82 +<dl class="attributes">
    1.83 +<dt class="attribute" id="widl-CSSStyleDeclaration-cssFloat">
    1.84 +<code>cssFloat</code> of type <span class="idlAttrType"><a>DOMString</a></span></dt>
    1.85 +<dd>
    1.86 +<p>The <code>cssFloat</code>  attribute, on getting, must return the result of invoking  <code title="dom-CSSStyleDeclaration-getPropertyValue">getPropertyValue()</code> with  <code>'float'</code> as argument. On setting, the attribute must invoke  <code title="dom-CSSStyleDeclaration-setProperty">setProperty()</code> with  <code>'float'</code> as first argument, as second argument the given value, and no third argument.  Any exceptions thrown must be re-thrown.</dd>
    1.87 +</dl>
    1.88 +<p>For each CSS property <var>property</var> that the user agent supports, except for  the 'float' property, the following partial interface applies where <var>attribute</var>  is obtained by running the <a href="#css-property-to-idl-attribute">CSS property to IDL attribute</a> algorithm for  <var>property</var>.</p>
    1.89 +<pre class="idl"><span class="idlInterface" id="widl-def-CSSStyleDeclaration">partial interface <span class="idlInterfaceID">CSSStyleDeclaration</span> {
    1.90 +<span class="idlAttribute">    [TreatNullAs=EmptyString] attribute <span class="idlAttrType"><a>DOMString</a></span> <span class="idlAttrName"><a href="#widl-CSSStyleDeclaration-attribute">attribute</a></span>;</span>
    1.91 +};</span></pre>
    1.92 +<dl class="attributes">
    1.93 +<dt class="attribute" id="widl-CSSStyleDeclaration-attribute">
    1.94 +<code>attribute</code> of type <span class="idlAttrType"><a>DOMString</a></span></dt>
    1.95 +<dd>
    1.96 +<p>Getting the <var>attribute</var> attribute must return the result of invoking  <code title="dom-CSSStyleDeclaration-getPropertyValue">getPropertyValue()</code> with as  argument the result of running the <a href="#idl-attribute-to-css-property">IDL attribute to CSS property</a>  algorithm for <var>attribute</var>.</p>  <p>Setting the <var>attribute</var> attribute must invoke  <code title="dom-CSSStyleDeclaration-setProperty">setProperty()</code> with as  first argument the result of running the <a href="#idl-attribute-to-css-property">IDL attribute to CSS property</a>  algorithm for <var>attribute</var>, as second argument the given value, and no third argument. Any  exceptions thrown must be re-thrown.</dd>
    1.97 +</dl>
    1.98  
    1.99    
   1.100 -  <p>If the user agent supports the 'float' CSS property, the following partial interface
   1.101 -  applies.
   1.102 -  
   1.103 -  <pre class="idl">partial interface CSSStyleDeclaration {
   1.104 -  [TreatNullAs=EmptyString] attribute DOMString cssFloat;
   1.105 -};</pre>
   1.106 -
   1.107 -  <p>The <code><dfn id="dom-cssstyledeclaration-cssfloat" title="dom-CSSStyleDeclaration-cssFloat">cssFloat</dfn></code>
   1.108 -  attribute, on getting, must return the result of invoking
   1.109 -  <code title="dom-CSSStyleDeclaration-getPropertyValue">getPropertyValue()</code> with
   1.110 -  "float" as argument. On setting, the attribute must invoke
   1.111 -  <code title="dom-CSSStyleDeclaration-setProperty">setProperty()</code> with
   1.112 -  "float" as first argument, as second argument the given value, and no third argument.
   1.113 -  Any exceptions thrown must be re-thrown.
   1.114 -
   1.115 -  <p>For each CSS property <var>property</var> that the user agent supports, except for
   1.116 -  the 'float' property, and except for open-ended sets of properties, the following
   1.117 -  partial interface applies where <var>attribute</var> is obtained by running the
   1.118 -  <a href="#css-property-to-idl-attribute">CSS property to IDL attribute</a> algorithm for <var>property</var>.
   1.119 -
   1.120 -  <pre class="idl">partial interface CSSStyleDeclaration {
   1.121 -  [TreatNullAs=EmptyString] attribute DOMString <var>attribute</var>;
   1.122 -};</pre>
   1.123 -
   1.124 -  <p>Getting the <var>attribute</var> attribute must return the result of invoking
   1.125 -  <code title="dom-CSSStyleDeclaration-getPropertyValue">getPropertyValue()</code> with as
   1.126 -  argument the result of running the <a href="#idl-attribute-to-css-property">IDL attribute to CSS property</a>
   1.127 -  algorithm for <var>attribute</var>.</p>
   1.128 -
   1.129 -  <p>Setting the <var>attribute</var> attribute must invoke
   1.130 -  <code title="dom-CSSStyleDeclaration-setProperty">setProperty()</code> with as
   1.131 -  first argument the result of running the <a href="#idl-attribute-to-css-property">IDL attribute to CSS property</a>
   1.132 -  algorithm for <var>attribute</var>, as second argument the given value, and no third argument. Any
   1.133 -  exceptions thrown must be re-thrown.</p>
   1.134 -    
   1.135    <p>The <dfn id="css-property-to-idl-attribute">CSS property to IDL attribute</dfn> algorithm for <var>property</var> is as
   1.136    follows:</p>
   1.137    
   1.138 @@ -2441,6 +2463,21 @@
   1.139  <p>The <code>getDefaultComputedStyle</code> operation must run these steps:</p>    <ol>      <li><p>Let <var>doc</var> be the      <code class="external"><a href="http://dom.spec.whatwg.org/#document">Document</a></code>      associated with the <code class="external"><a href="http://dev.w3.org/html5/spec/single-page.html#window">Window</a></code> object on      which the method was invoked.</li>      <li><p>Let <var>obj</var> be <var>elt</var>.</li>      <li><p>If <var>pseudoElt</var> is as an      <a class="external" href="http://dom.spec.whatwg.org/#ascii-case-insensitive">ASCII case-insensitive</a> match for      either '<code>:before</code>' or '<code>::before</code>' let      <var>obj</var> be the '::before' pseudo-element of      <var>elt</var>.</li>      <li><p>If <var>pseudoElt</var> is as an      <a class="external" href="http://dom.spec.whatwg.org/#ascii-case-insensitive">ASCII case-insensitive</a> match for      either '<code>:after</code>' or '<code>::after</code>' let      <var>obj</var> be the '::after' pseudo-element of      <var>elt</var>.</li>      <li>       <p>Return a <a href="#css-declaration-block">CSS declaration block</a> with the       <a href="#css-declaration-block-readonly-flag">CSS declaration block readonly flag</a> set and the       <a href="#css-declaration-block-declarations">CSS declaration block declarations</a> set to all properties       the user agent supports with as value the computed value       for <var>obj</var> using the user agent-level style rules and user-level style       rules associated with <var>doc</var>, ignoring transitions, animations,       author-level style rules, author-level presentational hints and override-level       style rules.</p>      </li>    </ol></dd>
   1.140  </dl>
   1.141  
   1.142 +<pre class="idl"><span class="idlInterface" id="widl-def-Window">partial interface <span class="idlInterfaceID">Window</span> {
   1.143 +<span class="idlMethod">    <span class="idlMethType"><a>CSSStyleDeclaration</a></span> <span class="idlMethName"><a href="#widl-Window-getComputedStyle-CSSStyleDeclaration-Element-elt-DOMString-pseudoElt">getComputedStyle</a></span> (<span class="idlParam"><span class="idlParamType"><a>Element</a></span> <span class="idlParamName">elt</span></span>, <span class="idlParam">optional <span class="idlParamType"><a>DOMString</a></span> <span class="idlParamName">pseudoElt</span></span>);</span>
   1.144 +<span class="idlMethod">    <span class="idlMethType"><a>CSSStyleDeclaration</a></span> <span class="idlMethName"><a href="#widl-Window-getDefaultComputedStyle-CSSStyleDeclaration-Element-elt-DOMString-pseudoElt">getDefaultComputedStyle</a></span> (<span class="idlParam"><span class="idlParamType"><a>Element</a></span> <span class="idlParamName">elt</span></span>, <span class="idlParam">optional <span class="idlParamType"><a>DOMString</a></span> <span class="idlParamName">pseudoElt</span></span>);</span>
   1.145 +};</span></pre>
   1.146 +<dl class="methods">
   1.147 +<dt class="method" id="widl-Window-getComputedStyle-CSSStyleDeclaration-Element-elt-DOMString-pseudoElt">
   1.148 +<code>getComputedStyle</code> (<span class="idlParam"><span class="idlParamType"><a>Element</a></span> <span class="idlParamName">elt</span></span>, <span class="idlParam">optional <span class="idlParamType"><a>DOMString</a></span> <span class="idlParamName">pseudoElt</span></span>), returns <span class="idlMethType"><a>CSSStyleDeclaration</a></span></dt>
   1.149 +<dd>
   1.150 +<p>The <code>getComputedStyle</code> operation must run these steps:</p>    <ol>      <li><p>Let <var>doc</var> be the      <code class="external"><a href="http://dom.spec.whatwg.org/#document">Document</a></code>      associated with the <code class="external"><a href="http://dev.w3.org/html5/spec/single-page.html#window">Window</a></code> object on      which the method was invoked.</li>      <li><p>Let <var>obj</var> be <var>elt</var>.</li>      <li><p>If <var>pseudoElt</var> is as an      <a class="external" href="http://dom.spec.whatwg.org/#ascii-case-insensitive">ASCII case-insensitive</a> match for      either '<code>:before</code>' or '<code>::before</code>' let      <var>obj</var> be the '::before' pseudo-element of      <var>elt</var>.</li>      <li><p>If <var>pseudoElt</var> is as an      <a class="external" href="http://dom.spec.whatwg.org/#ascii-case-insensitive">ASCII case-insensitive</a> match for      either '<code>:after</code>' or '<code>::after</code>' let      <var>obj</var> be the '::after' pseudo-element of      <var>elt</var>.</li>      <li>       <p>Return a <a href="#css-declaration-block">CSS declaration block</a> with the       <a href="#css-declaration-block-readonly-flag">CSS declaration block readonly flag</a> set and the       <a href="#css-declaration-block-declarations">CSS declaration block declarations</a> set to all properties       the user agent supports with as value the <a href="#resolved-value">resolved value</a>       computed for <var>obj</var> using the style rules associated       with <var>doc</var>.</p>       <p class="note">This means that even if <var>obj</var> is in a       different document (e.g. one fetched via <code>XMLHttpRequest</code>) it       will still use the style rules associated with the document that is       associated with the global object on which       <code title="dom-Window-getComputedStyle">getComputedStyle()</code> was       invoked to compute the <a href="#css-declaration-block">CSS declaration block</a>.</p>      </li>    </ol>    <p class="note">Because of historical IDL limitations the <code>getComputedStyle</code> operation used to be on    a separate interface, <code>ViewCSS</code>.</dd>
   1.151 +<dt class="method" id="widl-Window-getDefaultComputedStyle-CSSStyleDeclaration-Element-elt-DOMString-pseudoElt">
   1.152 +<code>getDefaultComputedStyle</code> (<span class="idlParam"><span class="idlParamType"><a>Element</a></span> <span class="idlParamName">elt</span></span>, <span class="idlParam">optional <span class="idlParamType"><a>DOMString</a></span> <span class="idlParamName">pseudoElt</span></span>), returns <span class="idlMethType"><a>CSSStyleDeclaration</a></span></dt>
   1.153 +<dd>
   1.154 +<p>The <code>getDefaultComputedStyle</code> operation must run these steps:</p>    <ol>      <li><p>Let <var>doc</var> be the      <code class="external"><a href="http://dom.spec.whatwg.org/#document">Document</a></code>      associated with the <code class="external"><a href="http://dev.w3.org/html5/spec/single-page.html#window">Window</a></code> object on      which the method was invoked.</li>      <li><p>Let <var>obj</var> be <var>elt</var>.</li>      <li><p>If <var>pseudoElt</var> is as an      <a class="external" href="http://dom.spec.whatwg.org/#ascii-case-insensitive">ASCII case-insensitive</a> match for      either '<code>:before</code>' or '<code>::before</code>' let      <var>obj</var> be the '::before' pseudo-element of      <var>elt</var>.</li>      <li><p>If <var>pseudoElt</var> is as an      <a class="external" href="http://dom.spec.whatwg.org/#ascii-case-insensitive">ASCII case-insensitive</a> match for      either '<code>:after</code>' or '<code>::after</code>' let      <var>obj</var> be the '::after' pseudo-element of      <var>elt</var>.</li>      <li>       <p>Return a <a href="#css-declaration-block">CSS declaration block</a> with the       <a href="#css-declaration-block-readonly-flag">CSS declaration block readonly flag</a> set and the       <a href="#css-declaration-block-declarations">CSS declaration block declarations</a> set to all properties       the user agent supports with as value the computed value       for <var>obj</var> using the user agent-level style rules and user-level style       rules associated with <var>doc</var>, ignoring transitions, animations,       author-level style rules, author-level presentational hints and override-level       style rules.</p>      </li>    </ol></dd>
   1.155 +</dl>
   1.156 +
   1.157  
   1.158    <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
   1.159  
     2.1 --- a/cssom/README	Thu Apr 25 14:17:50 2013 -0700
     2.2 +++ b/cssom/README	Thu Apr 25 14:24:55 2013 -0700
     2.3 @@ -66,10 +66,10 @@
     2.4  % cd $CSSOM_TOOLS
     2.5  
     2.6  # Fetch node.js 0.10.0
     2.7 -% wget http://nodejs.org/dist/v0.10.0/ $CSSOM_TOOLS/node-v0.10.0.pkg
     2.8 +% wget http://nodejs.org/dist/v0.10.5/node-v0.10.5.pkg node-v0.10.5.pkg
     2.9  
    2.10  # Install node.js 0.10.0
    2.11 -% open $CSSOM_TOOLS/node-v0.10.0.pkg
    2.12 +% open $CSSOM_TOOLS/node-v0.10.5.pkg
    2.13  
    2.14  # Fetch html5.js
    2.15  % git clone http://dinhe.net/~aredridel/projects/js/html5.git/ $CSSOM_TOOLS/html5.js
    2.16 @@ -104,7 +104,6 @@
    2.17  *  Enumerate constructors in a manner similar to attributes/operations.
    2.18  *  Perform keyword substitution in constructor documentation.
    2.19  *  Generate typedef and implements definitions.
    2.20 -*  Generate extended attributes, e.g., PutForwards, NoInterfaceObject, etc.
    2.21  *  Generate setters, getters (not presently used in CSSOM IDL definitions).
    2.22  
    2.23  2. Content Related
     3.1 --- a/cssom/cssom-generate.js	Thu Apr 25 14:17:50 2013 -0700
     3.2 +++ b/cssom/cssom-generate.js	Thu Apr 25 14:24:55 2013 -0700
     3.3 @@ -137,6 +137,8 @@
     3.4              return formatIDLDef ( args );
     3.5          } else if ( method == 'idlDocMembers' ) {
     3.6              return formatIDLDocMembers ( args );
     3.7 +        } else if ( method == 'idlPartials' ) {
     3.8 +            return formatIDLPartials ( args );
     3.9          } else {
    3.10              return '';
    3.11          }
    3.12 @@ -146,6 +148,7 @@
    3.13          s += formatIDLDoc ( args );
    3.14          s += formatIDLDef ( args );
    3.15          s += formatIDLDocMembers ( args );
    3.16 +        s += formatIDLPartials ( args );
    3.17          return s;
    3.18      }
    3.19      function findIDL(name) {
    3.20 @@ -188,7 +191,7 @@
    3.21          s += eol;
    3.22          s += eltStart ( 'pre', [ newAttr ( 'class', 'idl' ) ], false );
    3.23          s += eltStart ( 'span', [ newAttr ( 'class', 'idlInterface' ), newAttr ( 'id', generateIDLDefinitionID ( def ) ) ], false );
    3.24 -        s += formatIDLExtendedAttributes ( def, args );
    3.25 +        s += formatIDLExtendedAttributes ( def, args, true );
    3.26          if ( partial ) {
    3.27              s += 'partial ';
    3.28          }
    3.29 @@ -222,7 +225,7 @@
    3.30          s += eltEnd ( 'pre', true );
    3.31          return s;
    3.32      }
    3.33 -    function formatIDLExtendedAttributes(def,args) {
    3.34 +    function formatIDLExtendedAttributes(def,args,useEol) {
    3.35          var s = '';
    3.36          var numExposed = 0;
    3.37          for ( var i in def.extAttrs ) {
    3.38 @@ -257,10 +260,14 @@
    3.39              }
    3.40          }
    3.41          if ( numExposed > 0 ) {
    3.42 -            if ( numOutput > 1 ) {
    3.43 -                s += eol;
    3.44 +            if (useEol) {
    3.45 +                if ( numOutput > 1 ) {
    3.46 +                    s += eol;
    3.47 +                }
    3.48 +                s += ']' + eol;
    3.49 +            } else {
    3.50 +                s += ']' + ' ';
    3.51              }
    3.52 -            s += ']' + eol;
    3.53          }
    3.54          return s;
    3.55      }
    3.56 @@ -350,6 +357,7 @@
    3.57          var s = '';
    3.58          s += eltStart ( 'span', [ newAttr ( 'class', 'idlConst' ) ], false );
    3.59          s += '    ';
    3.60 +        s += formatIDLExtendedAttributes ( mem, args, false );
    3.61          s += 'const ';
    3.62          s += formatIDLConstType ( def, mem, mem.idlType, false, args );
    3.63          s += ' ';
    3.64 @@ -372,14 +380,14 @@
    3.65          var n = mem.name;
    3.66          var s = '';
    3.67          s += eltStart ( 'span', [ newAttr ( 'class', 'idlAttribute' ) ], false );
    3.68 -        s += '   ';
    3.69 +        s += '    ';
    3.70 +        s += formatIDLExtendedAttributes ( mem, args, false );
    3.71          if ( mem.stringifier ) {
    3.72 -            s += ' stringifier';
    3.73 +            s += 'stringifier ';
    3.74          }
    3.75          if ( mem.readonly ) {
    3.76 -            s += ' readonly';
    3.77 +            s += 'readonly ';
    3.78          }
    3.79 -        s += ' ';
    3.80          s += 'attribute ';
    3.81          s += formatIDLAttrType ( def, mem, mem.idlType, false, args );
    3.82          s += ' ';
    3.83 @@ -451,6 +459,7 @@
    3.84          var s = '';
    3.85          s += eltStart ( 'span', [ newAttr ( 'class', 'idlMethod' ) ], false );
    3.86          s += '    ';
    3.87 +        s += formatIDLExtendedAttributes ( mem, args, false );
    3.88          s += formatIDLOperType ( def, mem, mem.idlType, false, args );
    3.89          s += ' ';
    3.90          s += eltStart ( 'span', [ newAttr ( 'class', 'idlMethName' ) ], false );
    3.91 @@ -912,6 +921,33 @@
    3.92      function formatIDLMemberNameAsLink(def,mem,args) {
    3.93          return formatAsLink ( mem.name, getIDLMemberCSSClass ( def, mem, args ), generateIDRef ( generateIDLMemberID ( def, mem, args ) ), args );
    3.94      }
    3.95 +    function findIDLPartials(name) {
    3.96 +        var partials = [];
    3.97 +        for ( var i in idl ) {
    3.98 +            var d = idl[i];
    3.99 +            if ( d.type != 'partialinterface' ) {
   3.100 +                continue;
   3.101 +            } else if ( !! d.name && ( d.name == name ) ) {
   3.102 +                partials.push(d);
   3.103 +            }
   3.104 +        }
   3.105 +        return partials;
   3.106 +    }
   3.107 +    function formatIDLPartial(d, args) {
   3.108 +        var s = '';
   3.109 +        s += formatIDLDefinitionDoc ( d, args );
   3.110 +        s += formatIDLDefinition ( d, args );
   3.111 +        s += formatIDLDefinitionDocMembers ( d, args );
   3.112 +        return s;
   3.113 +    }
   3.114 +    function formatIDLPartials(args) {
   3.115 +        var s = '';
   3.116 +        var partials = findIDLPartials ( args[0] );
   3.117 +        for ( var i in partials ) {
   3.118 +            s += formatIDLPartial ( partials[i], args );
   3.119 +        }
   3.120 +        return s;
   3.121 +    }
   3.122      function newAttr(n,v) {
   3.123          return { nodeName: n, nodeValue: v };
   3.124      }
     4.1 --- a/cssom/cssom-source	Thu Apr 25 14:17:50 2013 -0700
     4.2 +++ b/cssom/cssom-source	Thu Apr 25 14:24:55 2013 -0700
     4.3 @@ -1535,41 +1535,6 @@
     4.4  
     4.5    <!--{@idl(CSSStyleDeclaration)}-->
     4.6    
     4.7 -  <p>If the user agent supports the 'float' CSS property, the following partial interface
     4.8 -  applies.
     4.9 -  
    4.10 -  <pre class=idl>partial interface CSSStyleDeclaration {
    4.11 -  [TreatNullAs=EmptyString] attribute DOMString cssFloat;
    4.12 -};</pre>
    4.13 -
    4.14 -  <p>The <code><dfn title=dom-CSSStyleDeclaration-cssFloat>cssFloat</dfn></code>
    4.15 -  attribute, on getting, must return the result of invoking
    4.16 -  <code title=dom-CSSStyleDeclaration-getPropertyValue>getPropertyValue()</code> with
    4.17 -  "float" as argument. On setting, the attribute must invoke
    4.18 -  <code title=dom-CSSStyleDeclaration-setProperty>setProperty()</code> with
    4.19 -  "float" as first argument, as second argument the given value, and no third argument.
    4.20 -  Any exceptions thrown must be re-thrown.
    4.21 -
    4.22 -  <p>For each CSS property <var>property</var> that the user agent supports, except for
    4.23 -  the 'float' property, and except for open-ended sets of properties, the following
    4.24 -  partial interface applies where <var>attribute</var> is obtained by running the
    4.25 -  <span>CSS property to IDL attribute</span> algorithm for <var>property</var>.
    4.26 -
    4.27 -  <pre class=idl>partial interface CSSStyleDeclaration {
    4.28 -  [TreatNullAs=EmptyString] attribute DOMString <var>attribute</var>;
    4.29 -};</pre>
    4.30 -
    4.31 -  <p>Getting the <var>attribute</var> attribute must return the result of invoking
    4.32 -  <code title=dom-CSSStyleDeclaration-getPropertyValue>getPropertyValue()</code> with as
    4.33 -  argument the result of running the <span>IDL attribute to CSS property</span>
    4.34 -  algorithm for <var>attribute</var>.</p>
    4.35 -
    4.36 -  <p>Setting the <var>attribute</var> attribute must invoke
    4.37 -  <code title=dom-CSSStyleDeclaration-setProperty>setProperty()</code> with as
    4.38 -  first argument the result of running the <span>IDL attribute to CSS property</span>
    4.39 -  algorithm for <var>attribute</var>, as second argument the given value, and no third argument. Any
    4.40 -  exceptions thrown must be re-thrown.</p>
    4.41 -    
    4.42    <p>The <dfn>CSS property to IDL attribute</dfn> algorithm for <var>property</var> is as
    4.43    follows:</p>
    4.44    
     5.1 --- a/cssom/cssom.idl	Thu Apr 25 14:17:50 2013 -0700
     5.2 +++ b/cssom/cssom.idl	Thu Apr 25 14:24:55 2013 -0700
     5.3 @@ -6,6 +6,7 @@
     5.4  #include "CSSRule.idl"
     5.5  #include "CSSRuleList.idl"
     5.6  #include "CSSStyleDeclaration.idl"
     5.7 +#include "CSSStyleDeclarationProperties.idl"
     5.8  #include "CSSStyleRule.idl"
     5.9  #include "CSSStyleSheet.idl"
    5.10  #include "Document.idl"
     6.1 --- a/cssom/data/xrefs/css/cssom.json	Thu Apr 25 14:17:50 2013 -0700
     6.2 +++ b/cssom/data/xrefs/css/cssom.json	Thu Apr 25 14:24:55 2013 -0700
     6.3 @@ -15,7 +15,6 @@
     6.4      "css rule": "rule",
     6.5      "css style sheet": "css-style-sheet",
     6.6      "document style sheets": "document-style-sheets",
     6.7 -    "dom-cssstyledeclaration-cssfloat": "dom-cssstyledeclaration-cssfloat",
     6.8      "enable a style sheet set": "enable-a-style-sheet-set",
     6.9      "enabled style sheet set": "enabled-style-sheet-set",
    6.10      "escape a character": "escape-a-character",
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/cssom/idl/CSSStyleDeclarationProperties.idl	Thu Apr 25 14:24:55 2013 -0700
     7.3 @@ -0,0 +1,42 @@
     7.4 +
     7.5 +[Documentation=
     7.6 + "<p>If the user agent supports the 'float' CSS property, the following partial interface applies.</p>"
     7.7 +]
     7.8 +partial interface CSSStyleDeclaration {
     7.9 +
    7.10 +  [Documentation=
    7.11 +  "<p>The <code>cssFloat</code>\
    7.12 +  attribute, on getting, must return the result of invoking\
    7.13 +  <code title=dom-CSSStyleDeclaration-getPropertyValue>getPropertyValue()</code> with\
    7.14 +  <code>'float'</code> as argument. On setting, the attribute must invoke\
    7.15 +  <code title=dom-CSSStyleDeclaration-setProperty>setProperty()</code> with\
    7.16 +  <code>'float'</code> as first argument, as second argument the given value, and no third argument.\
    7.17 +  Any exceptions thrown must be re-thrown.",
    7.18 +  TreatNullAs=EmptyString
    7.19 +  ]
    7.20 +  attribute DOMString cssFloat;
    7.21 +};
    7.22 +
    7.23 +
    7.24 +[Documentation=
    7.25 + "<p>For each CSS property <var>property</var> that the user agent supports, except for\
    7.26 +  the 'float' property, the following partial interface applies where <var>attribute</var>\
    7.27 +  is obtained by running the <span>CSS property to IDL attribute</span> algorithm for\
    7.28 +  <var>property</var>.</p>"
    7.29 +]
    7.30 +partial interface CSSStyleDeclaration {
    7.31 +
    7.32 +  [Documentation=
    7.33 +  "<p>Getting the <var>attribute</var> attribute must return the result of invoking\
    7.34 +  <code title=dom-CSSStyleDeclaration-getPropertyValue>getPropertyValue()</code> with as\
    7.35 +  argument the result of running the <span>IDL attribute to CSS property</span>\
    7.36 +  algorithm for <var>attribute</var>.</p>\
    7.37 +  <p>Setting the <var>attribute</var> attribute must invoke\
    7.38 +  <code title=dom-CSSStyleDeclaration-setProperty>setProperty()</code> with as\
    7.39 +  first argument the result of running the <span>IDL attribute to CSS property</span>\
    7.40 +  algorithm for <var>attribute</var>, as second argument the given value, and no third argument. Any\
    7.41 +  exceptions thrown must be re-thrown.</p>",
    7.42 +  TreatNullAs=EmptyString
    7.43 +  ]
    7.44 +  attribute DOMString attribute;
    7.45 +};

mercurial