Skip to content

Commit 78f62a3

Browse files
committed
[css-variables] Update second script example to the new map-like interface.
1 parent 7f22e91 commit 78f62a3

2 files changed

Lines changed: 10 additions & 12 deletions

File tree

css-variables/Overview.html

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
</head>
99
<body class="h-entry">
1010
<div class="head">
11-
<p data-fill-with="logo"><a href="http://www.w3.org/">
11+
<p data-fill-with="logo"><a href="http://www.w3.org/" class="logo">
1212
<img width="72" alt="W3C" src="http://www.w3.org/Icons/w3c_home" height="48">
1313
</a></p>
1414
<h1 class="p-name no-ref" id="title">CSS Custom Properties for Cascading Variables Module Level 1</h1>
1515
<h2 class="no-num no-toc no-ref" id="subtitle">Editor's Draft,
16-
<span class="dt-updated"><span class="value-title" title="20130619">19 June 2013</span></span></h2>
16+
<span class="dt-updated"><span class="value-title" title="20130620">20 June 2013</span></span></h2>
1717
<div data-fill-with="spec-metadata"><dl><dt>This version:</dt><dd><a href="http://dev.w3.org/csswg/css-variables/" class="u-url">http://dev.w3.org/csswg/css-variables/</a></dd><dt>Latest version:</dt><dd><a href="http://www.w3.org/TR/css-variables-1/">http://www.w3.org/TR/css-variables-1/</a></dd><dt>Editor's Draft:</dt><dd><a href="http://dev.w3.org/csswg/css-variables/">http://dev.w3.org/csswg/css-variables/</a></dd><dt>Previous Versions:</dt><dd><a href="http://www.w3.org/TR/2013/WD-css-variables-20130312/" rel="previous">http://www.w3.org/TR/2013/WD-css-variables-20130312/</a></dd><dd><a href="http://www.w3.org/TR/2012/WD-css-variables-20120410/" rel="previous">http://www.w3.org/TR/2012/WD-css-variables-20120410/</a>
1818
</dd><dt>Feedback:</dt>
1919
<dd><a href="mailto:www-style@w3.org?subject=%5Bcss-variables%5D%20feedback">www-style@w3.org</a>
@@ -720,7 +720,7 @@ <h3 id="the-cssstyledeclaration-interface" data-level="4.1"><span class="secno">
720720
on the <a data-autolink="link" href="#associated-style-declaration">associated style declaration</a>
721721
by passing <var>varName</var> and <var>varValue</var> as its two arguments, in that order.
722722

723-
</dd><dt>delete(DOMString varName), return DOMString
723+
</dd><dt>delete(DOMString varName), return boolean
724724
</dt><dd>
725725
Prepend "var-" to <var>varName</var>.
726726
Invoke <code>removeProperty()</code>
@@ -786,12 +786,11 @@ <h3 id="the-cssstyledeclaration-interface" data-level="4.1"><span class="secno">
786786
is also simple with the <code>var</code> property:
787787

788788
<pre>var customProps = el.style.var;
789-
for(customPropName in customProps) {
790-
if( knownCustomPropName(customPropName) ) {
791-
var customPropValue = customProps[customPropName];
789+
customProps.forEach(function(propValue, propName) {
790+
if( knownCustomPropName(propName) ) {
792791
/* Processing code here. */
793792
}
794-
}
793+
});
795794
</pre> </div>
796795

797796

css-variables/Overview.src.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ <h4 id='cssvariablesmap-methods'>
683683
on the <a>associated style declaration</a>
684684
by passing <var>varName</var> and <var>varValue</var> as its two arguments, in that order.
685685

686-
<dt>delete(DOMString varName), return DOMString
686+
<dt>delete(DOMString varName), return boolean
687687
<dd>
688688
Prepend "var-" to <var>varName</var>.
689689
Invoke <code>removeProperty()</code>
@@ -752,12 +752,11 @@ <h4 id='cssvariablesmap-methods'>
752752

753753
<pre>
754754
var customProps = el.style.var;
755-
for(customPropName in customProps) {
756-
if( knownCustomPropName(customPropName) ) {
757-
var customPropValue = customProps[customPropName];
755+
customProps.forEach(function(propValue, propName) {
756+
if( knownCustomPropName(propName) ) {
758757
/* Processing code here. */
759758
}
760-
}
759+
});
761760
</pre>
762761
</div>
763762

0 commit comments

Comments
 (0)