Bug 981919: Add some documentation/clarification in test_flexbox_flex_shorthand.html. r=SimonSapin

This commit is contained in:
Daniel Holbert 2014-03-11 10:06:54 -07:00
parent d9866324aa
commit f1a9c96f8b

View File

@ -23,9 +23,17 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=696253
/** 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.
//
@ -241,7 +249,7 @@ function runFlexShorthandTest(aFlexShorthandTestcase)
let elem = document.createElement("div");
elem.style[gFlexPropInfo.domProp] = aFlexShorthandTestcase[gFlexPropName];
elem.style[gFlexDOMName] = aFlexShorthandTestcase[gFlexPropName];
content.appendChild(elem);
gFlexPropInfo.subproperties.forEach(function(aSubPropName) {