Bug 1187110 part 1: Use "for of" instead of "for in" to loop over an array in test_extra_inherit_initial.html. r=heycam
authorDaniel Holbert <dholbert@cs.stanford.edu>
Tue, 04 Aug 2015 14:05:12 -0700
changeset 287872 de6004c72675c91db8b1000befd2863af201cebf
parent 287871 d31e43ead2dcd242e6fba23cd970ae519c7ae6ef
child 287873 5189e3db2bc23d8c44ac94e652219c7a7234d4eb
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1187110
milestone42.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1187110 part 1: Use "for of" instead of "for in" to loop over an array in test_extra_inherit_initial.html. r=heycam
layout/style/test/test_extra_inherit_initial.html
--- a/layout/style/test/test_extra_inherit_initial.html
+++ b/layout/style/test/test_extra_inherit_initial.html
@@ -13,17 +13,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=940229">Mozilla Bug 940229</a>
 <p id="display"></p>
 <div id="content" style="display: none">
 
 <div id="testnode"></div>
   
 </div>
 <pre id="test">
-<script class="testbody" type="text/javascript">
+<script class="testbody" type="application/javascript;version=1.7">
 
 /*
  * Inspired by mistake in quotes noticed while reviewing bug 189519.
  */
 
 var gPropsNeedComma = {
   "font": true,
   "font-family": true,
@@ -38,24 +38,25 @@ function test_property(property)
   var info = gCSSProperties[property];
 
   var delim = (property in gPropsNeedComma) ? ", " : " ";
 
   function test_value_pair(relation, val1, val2, extraval) {
     var decl = property + ": " + val1 + delim + val2;
     gElement.setAttribute("style", decl);
     if ("subproperties" in info) {
-      for (idx in info.subproperties) {
-        var subprop = info.subproperties[idx];
+      // Shorthand property; inspect each subproperty value.
+      for (let subprop of info.subproperties) {
         is(gDeclaration.getPropertyValue(subprop), "",
            ["expected", extraval, "ignored", relation, "value in",
             "'" + decl + "'", "when looking at subproperty",
             "'" + subprop + "'"].join(" "));
       }
     } else {
+      // Longhand property.
       is(gDeclaration.getPropertyValue(property), "",
          ["expected", extraval, "ignored", relation, "value in",
           "'" + decl + "'"].join(" "));
     }
   }
 
   function test_value(value) {
     test_value_pair("after", value, "inherit", "inherit");