Wed, 24 Apr 2013 13:43:33 +0200
[cssom] Add getDefaultComputedStyle()
cssom/Overview.html | file | annotate | diff | comparison | revisions | |
cssom/idl/Window.idl | file | annotate | diff | comparison | revisions |
1.1 --- a/cssom/Overview.html Wed Apr 24 10:56:24 2013 +0200 1.2 +++ b/cssom/Overview.html Wed Apr 24 13:43:33 2013 +0200 1.3 @@ -2425,16 +2425,18 @@ 1.4 1.5 1.6 <pre class="idl"><span class="idlInterface" id="widl-def-Window">partial interface <span class="idlInterfaceID">Window</span> { 1.7 -<span class="idlMethod"> <span class="idlMethType"><a>CSSStyleDeclaration</a></span> <span class="idlMethName"><a href="#widl-Window-getComputedStyle-CSSStyleDeclaration-Element-elt">getComputedStyle</a></span> (<span class="idlParam"><span class="idlParamType"><a>Element</a></span> <span class="idlParamName">elt</span></span>);</span> 1.8 -<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"><span class="idlParamType"><a>DOMString</a></span> <span class="idlParamName">pseudoElt</span></span>);</span> 1.9 +<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.10 +<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.11 };</span></pre> 1.12 <dl class="methods"> 1.13 -<dt class="method" id="widl-Window-getComputedStyle-CSSStyleDeclaration-Element-elt"> 1.14 -<code>getComputedStyle</code> (<span class="idlParam"><span class="idlParamType"><a>Element</a></span> <span class="idlParamName">elt</span></span>), returns <span class="idlMethType"><a>CSSStyleDeclaration</a></span></dt> 1.15 <dt class="method" id="widl-Window-getComputedStyle-CSSStyleDeclaration-Element-elt-DOMString-pseudoElt"> 1.16 -<code>getComputedStyle</code> (<span class="idlParam"><span class="idlParamType"><a>Element</a></span> <span class="idlParamName">elt</span></span>, <span class="idlParam"><span class="idlParamType"><a>DOMString</a></span> <span class="idlParamName">pseudoElt</span></span>), returns <span class="idlMethType"><a>CSSStyleDeclaration</a></span></dt> 1.17 +<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.18 <dd> 1.19 <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.20 +<dt class="method" id="widl-Window-getDefaultComputedStyle-CSSStyleDeclaration-Element-elt-DOMString-pseudoElt"> 1.21 +<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.22 +<dd> 1.23 +<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 author-level style rules, transitions, animations, override style sheets and presentational hints.</p> </li> </ol></dd> 1.24 </dl> 1.25 1.26
2.1 --- a/cssom/idl/Window.idl Wed Apr 24 10:56:24 2013 +0200 2.2 +++ b/cssom/idl/Window.idl Wed Apr 24 13:43:33 2013 +0200 2.3 @@ -1,8 +1,6 @@ 2.4 2.5 partial interface Window { 2.6 2.7 - CSSStyleDeclaration getComputedStyle(Element elt); 2.8 - 2.9 [Documentation= 2.10 "<p>The {@name} {@type} must run these steps:</p>\ 2.11 <ol>\ 2.12 @@ -39,6 +37,36 @@ 2.13 <p class='note'>Because of historical IDL limitations the {@name} {@type} used to be on\ 2.14 a separate interface, <code>ViewCSS</code>.</p>" 2.15 ] 2.16 - CSSStyleDeclaration getComputedStyle(Element elt, DOMString pseudoElt); 2.17 + CSSStyleDeclaration getComputedStyle(Element elt, optional DOMString pseudoElt); 2.18 2.19 + [Documentation= 2.20 + "<p>The {@name} {@type} must run these steps:</p>\ 2.21 + <ol>\ 2.22 + <li><p>Let <var>doc</var> be the\ 2.23 + <code data-anolis-spec=dom>Document</code>\ 2.24 + associated with the <code data-anolis-spec=html>Window</code> object on\ 2.25 + which the method was invoked.</p></li>\ 2.26 + <li><p>Let <var>obj</var> be <var>elt</var>.</p></li>\ 2.27 + <li><p>If <var>pseudoElt</var> is as an\ 2.28 + <span data-anolis-spec=dom>ASCII case-insensitive</span> match for\ 2.29 + either '<code>:before</code>' or '<code>::before</code>' let\ 2.30 + <var>obj</var> be the '::before' pseudo-element of\ 2.31 + <var>elt</var>.</p></li>\ 2.32 + <li><p>If <var>pseudoElt</var> is as an\ 2.33 + <span data-anolis-spec=dom>ASCII case-insensitive</span> match for\ 2.34 + either '<code>:after</code>' or '<code>::after</code>' let\ 2.35 + <var>obj</var> be the '::after' pseudo-element of\ 2.36 + <var>elt</var>.</p></li>\ 2.37 + <li>\ 2.38 + <p>Return a <span>CSS declaration block</span> with the\ 2.39 + <span>CSS declaration block readonly flag</span> set and the\ 2.40 + <span>CSS declaration block declarations</span> set to all properties\ 2.41 + the user agent supports with as value the computed value\ 2.42 + for <var>obj</var> using the user agent-level style rules and user-level style\ 2.43 + rules associated with <var>doc</var>, ignoring author-level style rules,\ 2.44 + transitions, animations, override style sheets and presentational hints.</p>\ 2.45 + </li>\ 2.46 + </ol>" 2.47 + ] 2.48 + CSSStyleDeclaration getDefaultComputedStyle(Element elt, optional DOMString pseudoElt); 2.49 };