Bug 981919: Add some documentation/clarification in test_flexbox_flex_shorthand.html. r=SimonSapin
authorDaniel Holbert <dholbert@cs.stanford.edu>
Tue, 11 Mar 2014 10:06:54 -0700
changeset 172983 9948eaf63a9546241106554d2d02351bef3b5879
parent 172982 ed30fc4d3e178ad72fe63bf112956d96be876f6a
child 172984 0c7de28ed85433e43dbfb14ab223a6e3c8102bbe
push id40904
push userdholbert@mozilla.com
push dateTue, 11 Mar 2014 17:07:43 +0000
treeherdermozilla-inbound@9948eaf63a95 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersSimonSapin
bugs981919
milestone30.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 981919: Add some documentation/clarification in test_flexbox_flex_shorthand.html. r=SimonSapin
layout/style/test/test_flexbox_flex_shorthand.html
--- a/layout/style/test/test_flexbox_flex_shorthand.html
+++ b/layout/style/test/test_flexbox_flex_shorthand.html
@@ -18,19 +18,27 @@ https://bugzilla.mozilla.org/show_bug.cg
 </div>
 <pre id="test">
 <script type="application/javascript;version=1.7">
 "use strict";
 
 /** Test for Bug 696253 **/
 /* (Testing the 'flex' CSS shorthand property) */
 
+// The CSS property name for the shorthand we're testing:
 const gFlexPropName = "flex";
+
+// Info from property_database.js on this property:
 const gFlexPropInfo = gCSSProperties[gFlexPropName];
 
+// The name of the property in the DOM (i.e. in elem.style):
+// (NOTE: In this case it's actually the same as the CSS property name --
+// "flex" -- but that's not guaranteed in general.)
+const gFlexDOMName = gFlexPropInfo.domProp;
+
 // Default values for shorthand subproperties, when they're not specified
 // explicitly in a testcase.  This lets the testcases be more concise.
 //
 // The values here are from the flexbox spec on the 'flex' shorthand:
 //   "When omitted, [flex-grow and flex-shrink] are set to '1'.
 //   "If omitted, the flex basis defaults to 0%"
 let gFlexShorthandDefaults = {
     "flex-grow":   "1",
@@ -236,17 +244,17 @@ let gFlexShorthandTestcases = [
 ];
 
 function runFlexShorthandTest(aFlexShorthandTestcase)
 {
   let content = document.getElementById("content");
 
   let elem = document.createElement("div");
 
-  elem.style[gFlexPropInfo.domProp] = aFlexShorthandTestcase[gFlexPropName];
+  elem.style[gFlexDOMName] = aFlexShorthandTestcase[gFlexPropName];
   content.appendChild(elem);
 
   gFlexPropInfo.subproperties.forEach(function(aSubPropName) {
     var expectedVal = aSubPropName in aFlexShorthandTestcase ?
      aFlexShorthandTestcase[aSubPropName] :
      gFlexShorthandDefaults[aSubPropName];
 
     // Compare computed value against expected computed value (from testcase)