Skip to content

Commit b95fff6

Browse files
committed
[cssom, cssom-view] fix widl bug causing duplicate partials; fix idl syntax error
1 parent b6a9fad commit b95fff6

4 files changed

Lines changed: 10 additions & 61 deletions

File tree

cssom-view/Overview.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
<div class="head">
99

1010
<!--begin-logo-->
11-
<p><a href="http://www.w3.org/"><img alt="W3C" height="48" src="https://www.w3.org/Icons/w3c_home" width="72"></a></p>
11+
<p><a href="http://www.w3.org/"><img alt="W3C" height="48" src="http://www.w3.org/Icons/w3c_home" width="72"></a></p>
1212
<!--end-logo-->
1313

1414
<h1 id="cssom-view-module">CSSOM View Module</h1>
1515

16-
<h2 class="no-num no-toc" id="w3c-doctype">Editor's Draft 23 April 2013</h2>
16+
<h2 class="no-num no-toc" id="w3c-doctype">Editor's Draft 25 April 2013</h2>
1717

1818
<dl>
1919

@@ -69,7 +69,7 @@ <h2 class="no-num no-toc" id="sotd">Status of this Document</h2>
6969
can be found in the <a href="http://www.w3.org/TR/">W3C technical reports
7070
index at http://www.w3.org/TR/.</a></em>
7171

72-
<p>This is the 23 April 2013 Editor's Draft of CSSOM View. Please send
72+
<p>This is the 25 April 2013 Editor's Draft of CSSOM View. Please send
7373
comments to
7474
<a href="mailto:www-style@w3.org?subject=%5Bcssom-view%5D%20">www-style@w3.org</a>
7575
(<a href="http://lists.w3.org/Archives/Public/www-style/">archived</a>)
@@ -451,8 +451,7 @@ <h3 id="the-caretposition-interface"><span class="secno">5.1 </span>The <code ti
451451
<dt class="method" id="widl-CaretPosition-getClientRect-ClientRect">
452452
<code>getClientRect</code> (), returns <span class="idlMethType"><a>ClientRect</a>?</span></dt>
453453
<dd>
454-
<p>The <code>getClientRect</code> operation must follow these steps, aborting on the first step that returns a value:</p> <ol> <li> <p>If <a href="#caret-range">caret range</a> is not null: <ol> <li><p>Let <var>list</var> be the result of invoking the <code title="dom-Range-getClientRects">getClientRects()</code> method on the range.
455-
<li><p>If <var>list</var> is empty, return null. <li><p>Return the <code>ClientRect</code> object in <var>list</var> at index 0. </ol> <li><p>If <a href="#caret-node">caret node</a> is a text entry widget that is a replaced element, and that is in the document, return a <code>ClientRect</code> object for the caret in the widget as represented by the <a href="#caret-offset">caret offset</a> value. <li><p>Return null. </ol></dd>
454+
<p>The <code>getClientRect</code> operation must follow these steps, aborting on the first step that returns a value:</p> <ol> <li> <p>If <a href="#caret-range">caret range</a> is not null: <ol> <li><p>Let <var>list</var> be the result of invoking the <code title="dom-Range-getClientRects">getClientRects()</code> method on the range. <li><p>If <var>list</var> is empty, return null. <li><p>Return the <code>ClientRect</code> object in <var>list</var> at index 0. </ol> <li><p>If <a href="#caret-node">caret node</a> is a text entry widget that is a replaced element, and that is in the document, return a <code>ClientRect</code> object for the caret in the widget as represented by the <a href="#caret-offset">caret offset</a> value. <li><p>Return null. </ol></dd>
456455
</dl>
457456

458457

cssom-view/idl/CaretPosition.idl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ interface CaretPosition {
2424
<ol>\
2525
<li><p>Let <var>list</var> be the result of invoking the\
2626
<code title=dom-Range-getClientRects>getClientRects()</code> method on the\
27-
range.
27+
range.\
2828
<li><p>If <var>list</var> is empty, return null.\
2929
<li><p>Return the <code>ClientRect</code> object in <var>list</var> at index 0.\
3030
</ol>\

cssom/Overview.html

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,43 +1159,6 @@ <h4 id="the-stylesheetlist-sequence"><span class="secno">6.2.2 </span>The <code>
11591159
<h4 id="extensions-to-the-document-interface"><span class="secno">6.2.3 </span>Extensions to the <code>Document</code> Interface</h4>
11601160

11611161

1162-
<pre class="idl"><span class="idlInterface" id="widl-def-Document">partial interface <span class="idlInterfaceID">Document</span> {
1163-
<span class="idlAttribute"> readonly attribute <span class="idlAttrType"><a>StyleSheetList</a></span> <span class="idlAttrName"><a href="#widl-Document-styleSheets">styleSheets</a></span>;</span>
1164-
<span class="idlAttribute"> attribute <span class="idlAttrType"><a>DOMString</a>?</span> <span class="idlAttrName"><a href="#widl-Document-selectedStyleSheetSet">selectedStyleSheetSet</a></span>;</span>
1165-
<span class="idlAttribute"> readonly attribute <span class="idlAttrType"><a>DOMString</a>?</span> <span class="idlAttrName"><a href="#widl-Document-lastStyleSheetSet">lastStyleSheetSet</a></span>;</span>
1166-
<span class="idlAttribute"> readonly attribute <span class="idlAttrType"><a>DOMString</a>?</span> <span class="idlAttrName"><a href="#widl-Document-preferredStyleSheetSet">preferredStyleSheetSet</a></span>;</span>
1167-
<span class="idlAttribute"> readonly attribute <span class="idlAttrType"><a>DOMString</a>[]</span> <span class="idlAttrName"><a href="#widl-Document-styleSheetSets">styleSheetSets</a></span>;</span>
1168-
<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>
1169-
};</span></pre>
1170-
<dl class="attributes">
1171-
<dt class="attribute" id="widl-Document-styleSheets">
1172-
<code>styleSheets</code> of type <span class="idlAttrType"><a>StyleSheetList</a></span>, readonly</dt>
1173-
<dd>
1174-
<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>
1175-
<dt class="attribute" id="widl-Document-selectedStyleSheetSet">
1176-
<code>selectedStyleSheetSet</code> of type <span class="idlAttrType"><a>DOMString</a>?</span></dt>
1177-
<dd>
1178-
<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>
1179-
<dt class="attribute" id="widl-Document-lastStyleSheetSet">
1180-
<code>lastStyleSheetSet</code> of type <span class="idlAttrType"><a>DOMString</a>?</span>, readonly</dt>
1181-
<dd>
1182-
<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>
1183-
<dt class="attribute" id="widl-Document-preferredStyleSheetSet">
1184-
<code>preferredStyleSheetSet</code> of type <span class="idlAttrType"><a>DOMString</a>?</span>, readonly</dt>
1185-
<dd>
1186-
<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>
1187-
<dt class="attribute" id="widl-Document-styleSheetSets">
1188-
<code>styleSheetSets</code> of type <span class="idlAttrType"><a>DOMString</a>[]</span>, readonly</dt>
1189-
<dd>
1190-
<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>
1191-
</dl>
1192-
<dl class="methods">
1193-
<dt class="method" id="widl-Document-enableStyleSheetsForSet-void-DOMString-name">
1194-
<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>
1195-
<dd>
1196-
<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>
1197-
</dl>
1198-
11991162
<pre class="idl"><span class="idlInterface" id="widl-def-Document">partial interface <span class="idlInterfaceID">Document</span> {
12001163
<span class="idlAttribute"> readonly attribute <span class="idlAttrType"><a>StyleSheetList</a></span> <span class="idlAttrName"><a href="#widl-Document-styleSheets">styleSheets</a></span>;</span>
12011164
<span class="idlAttribute"> attribute <span class="idlAttrType"><a>DOMString</a>?</span> <span class="idlAttrName"><a href="#widl-Document-selectedStyleSheetSet">selectedStyleSheetSet</a></span>;</span>
@@ -2448,21 +2411,6 @@ <h3 id="the-elementcssinlinestyle-interface"><span class="secno">7.1 </span>The
24482411
<h3 id="extensions-to-the-window-interface"><span class="secno">7.2 </span>Extensions to the <code>Window</code> Interface</h3>
24492412

24502413

2451-
<pre class="idl"><span class="idlInterface" id="widl-def-Window">partial interface <span class="idlInterfaceID">Window</span> {
2452-
<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>
2453-
<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>
2454-
};</span></pre>
2455-
<dl class="methods">
2456-
<dt class="method" id="widl-Window-getComputedStyle-CSSStyleDeclaration-Element-elt-DOMString-pseudoElt">
2457-
<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>
2458-
<dd>
2459-
<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>
2460-
<dt class="method" id="widl-Window-getDefaultComputedStyle-CSSStyleDeclaration-Element-elt-DOMString-pseudoElt">
2461-
<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>
2462-
<dd>
2463-
<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>
2464-
</dl>
2465-
24662414
<pre class="idl"><span class="idlInterface" id="widl-def-Window">partial interface <span class="idlInterfaceID">Window</span> {
24672415
<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>
24682416
<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>

cssom/cssom-generate.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,11 @@
151151
s += formatIDLPartials ( args );
152152
return s;
153153
}
154-
function findIDL(name) {
154+
function findIDL(name, includePartials) {
155155
for ( var i in idl ) {
156156
var d = idl[i];
157+
if ( ( d.type == 'partialinterface' ) && !includePartials )
158+
continue;
157159
if ( !! d.name && ( d.name == name ) ) {
158160
return d;
159161
} else if ( !! d.target && ( d.target == name ) ) {
@@ -709,7 +711,7 @@
709711
}
710712
return join ( sa );
711713
}
712-
function formatIDLDoc(args) {
714+
function formatIDLDoc(args, ignorePartials) {
713715
var d = findIDL ( args[0] );
714716
if ( d ) {
715717
return formatIDLDefinitionDoc ( d, args );
@@ -753,7 +755,7 @@
753755
return '';
754756
}
755757
}
756-
function formatIDLDocMembers(args) {
758+
function formatIDLDocMembers(args, ignorePartials) {
757759
var d = findIDL ( args[0] );
758760
if ( d ) {
759761
return formatIDLDefinitionDocMembers ( d, args );

0 commit comments

Comments
 (0)