Fix missing frame in style system mochitests. (Bug 585715) r=bzbarsky a2.0=blocking2.0:beta6
authorL. David Baron <dbaron@dbaron.org>
Thu, 09 Sep 2010 08:21:46 -0700
changeset 52282 d8e37eb0c77cd85b2c1d58116e72ff76e63969c0
parent 52281 d7e5bc1bbb7bdb6e869d63c37e94f10dab0adf7f
child 52283 3f2ae0cc2cb894e2f3e8af95aede888d3b7713e1
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersbzbarsky
bugs585715
milestone2.0b6pre
Fix missing frame in style system mochitests. (Bug 585715) r=bzbarsky a2.0=blocking2.0:beta6
layout/style/test/property_database.js
layout/style/test/test_initial_computation.html
layout/style/test/test_value_computation.html
--- a/layout/style/test/property_database.js
+++ b/layout/style/test/property_database.js
@@ -157,16 +157,17 @@ var gCSSProperties = {
 		initial_values: [ "none" ],
 		other_values: [ "red green", "red #fc3", "#ff00cc", "currentColor", "blue currentColor orange currentColor" ],
 		invalid_values: [ "red none", "red inherit", "red, green", "none red", "inherit red" ]
 	},
 	"-moz-border-radius": {
 		domProp: "MozBorderRadius",
 		inherited: false,
 		type: CSS_TYPE_TRUE_SHORTHAND,
+		prerequisites: { "width": "200px", "height": "100px", "display": "inline-block"},
 		subproperties: [ "-moz-border-radius-bottomleft", "-moz-border-radius-bottomright", "-moz-border-radius-topleft", "-moz-border-radius-topright" ],
 		initial_values: [ "0", "0px", "0px 0 0 0px" ], /* 0% ? */
 		other_values: [ "3%", "1px", "2em", "3em 2px", "2pt 3% 4em", "2px 2px 2px 2px", // circular
 						"3% / 2%", "1px / 4px", "2em / 1em", "3em 2px / 2px 3em", "2pt 3% 4em / 4pt 1% 5em", "2px 2px 2px 2px / 4px 4px 4px 4px", "1pt / 2pt 3pt", "4pt 5pt / 3pt", // elliptical
 			"-moz-calc(2px)",
 			"-moz-calc(50%)",
 			"-moz-calc(3*25px)",
 			"-moz-calc(3*25px) 5px",
@@ -179,16 +180,17 @@ var gCSSProperties = {
 			"1px 2px 2px 2px / 2px 2px -moz-calc(2px + 1%) 2px",
 					  ],
 		invalid_values: [ "2px -2px", "inherit 2px", "inherit / 2px", "2px inherit", "2px / inherit", "2px 2px 2px 2px 2px", "1px / 2px 2px 2px 2px 2px" ]
 	},
 	"-moz-border-radius-bottomleft": {
 		domProp: "MozBorderRadiusBottomleft",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
+		prerequisites: { "width": "200px", "height": "100px", "display": "inline-block"},
 		initial_values: [ "0", "0px" ], /* 0% ? */
 		other_values: [ "3%", "1px", "2em", // circular
 						"3% 2%", "1px 4px", "2em 2pt", // elliptical
 			"-moz-calc(2px)",
 			"-moz-calc(50%)",
 			"-moz-calc(3*25px)",
 			"-moz-calc(3*25px) 5px",
 			"5px -moz-calc(3*25px)",
@@ -198,16 +200,17 @@ var gCSSProperties = {
 			"-moz-min(30%, 30em,200px, min(500px ,40em))",
 					  ],
 		invalid_values: [ "-1px", "4px -2px", "inherit 2px", "2px inherit" ]
 	},
 	"-moz-border-radius-bottomright": {
 		domProp: "MozBorderRadiusBottomright",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
+		prerequisites: { "width": "200px", "height": "100px", "display": "inline-block"},
 		initial_values: [ "0", "0px" ], /* 0% ? */
 		other_values: [ "3%", "1px", "2em", // circular
 						"3% 2%", "1px 4px", "2em 2pt", // elliptical
 			"-moz-calc(2px)",
 			"-moz-calc(50%)",
 			"-moz-calc(3*25px)",
 			"-moz-calc(3*25px) 5px",
 			"5px -moz-calc(3*25px)",
@@ -217,16 +220,17 @@ var gCSSProperties = {
 			"-moz-min(30%, 30em,200px, min(500px ,40em))",
 					  ],
 		invalid_values: [ "-1px", "4px -2px", "inherit 2px", "2px inherit" ]
 	},
 	"-moz-border-radius-topleft": {
 		domProp: "MozBorderRadiusTopleft",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
+		prerequisites: { "width": "200px", "height": "100px", "display": "inline-block"},
 		initial_values: [ "0", "0px" ], /* 0% ? */
 		other_values: [ "3%", "1px", "2em", // circular
 						"3% 2%", "1px 4px", "2em 2pt", // elliptical
 			"-moz-calc(2px)",
 			"-moz-calc(50%)",
 			"-moz-calc(3*25px)",
 			"-moz-calc(3*25px) 5px",
 			"5px -moz-calc(3*25px)",
@@ -236,16 +240,17 @@ var gCSSProperties = {
 			"-moz-min(30%, 30em,200px, min(500px ,40em))",
 					  ],
 		invalid_values: [ "-1px", "4px -2px", "inherit 2px", "2px inherit" ]
 	},
 	"-moz-border-radius-topright": {
 		domProp: "MozBorderRadiusTopright",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
+		prerequisites: { "width": "200px", "height": "100px", "display": "inline-block"},
 		initial_values: [ "0", "0px" ], /* 0% ? */
 		other_values: [ "3%", "1px", "2em", // circular
 						"3% 2%", "1px 4px", "2em 2pt", // elliptical
 			"-moz-calc(2px)",
 			"-moz-calc(50%)",
 			"-moz-calc(3*25px)",
 			"-moz-calc(3*25px) 5px",
 			"5px -moz-calc(3*25px)",
@@ -646,16 +651,17 @@ var gCSSProperties = {
 			"-moz-min(30%, 30em,200px, min(500px ,40em))",
 		],
 		invalid_values: []
 	},
 	"-moz-outline-radius": {
 		domProp: "MozOutlineRadius",
 		inherited: false,
 		type: CSS_TYPE_TRUE_SHORTHAND,
+		prerequisites: { "width": "200px", "height": "100px", "display": "inline-block"},
 		subproperties: [ "-moz-outline-radius-bottomleft", "-moz-outline-radius-bottomright", "-moz-outline-radius-topleft", "-moz-outline-radius-topright" ],
 		initial_values: [ "0", "0px", "0%" ],
 		other_values: [ "3%", "1px", "2em", "3em 2px", "2pt 3% 4em", "2px 2px 2px 2px", // circular
 						"3% / 2%", "1px / 4px", "2em / 1em", "3em 2px / 2px 3em", "2pt 3% 4em / 4pt 1% 5em", "2px 2px 2px 2px / 4px 4px 4px 4px", "1pt / 2pt 3pt", "4pt 5pt / 3pt", // elliptical
 			"-moz-calc(2px)",
 			"-moz-calc(50%)",
 			"-moz-calc(3*25px)",
 			"-moz-calc(3*25px) 5px",
@@ -668,16 +674,17 @@ var gCSSProperties = {
 			"1px 2px 2px 2px / 2px 2px -moz-calc(2px + 1%) 2px",
 					  ],
 		invalid_values: [ "2px -2px", "inherit 2px", "inherit / 2px", "2px inherit", "2px / inherit", "2px 2px 2px 2px 2px", "1px / 2px 2px 2px 2px 2px" ]
 	},
 	"-moz-outline-radius-bottomleft": {
 		domProp: "MozOutlineRadiusBottomleft",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
+		prerequisites: { "width": "200px", "height": "100px", "display": "inline-block"},
 		initial_values: [ "0", "0px", "0%" ],
 		other_values: [ "3%", "1px", "2em", // circular
 						"3% 2%", "1px 4px", "2em 2pt", // elliptical
 			"-moz-calc(2px)",
 			"-moz-calc(50%)",
 			"-moz-calc(3*25px)",
 			"-moz-calc(3*25px) 5px",
 			"5px -moz-calc(3*25px)",
@@ -687,16 +694,17 @@ var gCSSProperties = {
 			"-moz-min(30%, 30em,200px, min(500px ,40em))",
 					  ],
 		invalid_values: [ "-1px", "4px -2px", "inherit 2px", "2px inherit" ]
 	},
 	"-moz-outline-radius-bottomright": {
 		domProp: "MozOutlineRadiusBottomright",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
+		prerequisites: { "width": "200px", "height": "100px", "display": "inline-block"},
 		initial_values: [ "0", "0px", "0%" ],
 		other_values: [ "3%", "1px", "2em", // circular
 						"3% 2%", "1px 4px", "2em 2pt", // elliptical
 			"-moz-calc(2px)",
 			"-moz-calc(50%)",
 			"-moz-calc(3*25px)",
 			"-moz-calc(3*25px) 5px",
 			"5px -moz-calc(3*25px)",
@@ -706,16 +714,17 @@ var gCSSProperties = {
 			"-moz-min(30%, 30em,200px, min(500px ,40em))",
 					  ],
 		invalid_values: [ "-1px", "4px -2px", "inherit 2px", "2px inherit" ]
 	},
 	"-moz-outline-radius-topleft": {
 		domProp: "MozOutlineRadiusTopleft",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
+		prerequisites: { "width": "200px", "height": "100px", "display": "inline-block"},
 		initial_values: [ "0", "0px", "0%" ],
 		other_values: [ "3%", "1px", "2em", // circular
 						"3% 2%", "1px 4px", "2em 2pt", // elliptical
 			"-moz-calc(2px)",
 			"-moz-calc(50%)",
 			"-moz-calc(3*25px)",
 			"-moz-calc(3*25px) 5px",
 			"5px -moz-calc(3*25px)",
@@ -725,16 +734,17 @@ var gCSSProperties = {
 			"-moz-min(30%, 30em,200px, min(500px ,40em))",
 					  ],
 		invalid_values: [ "-1px", "4px -2px", "inherit 2px", "2px inherit" ]
 	},
 	"-moz-outline-radius-topright": {
 		domProp: "MozOutlineRadiusTopright",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
+		prerequisites: { "width": "200px", "height": "100px", "display": "inline-block"},
 		initial_values: [ "0", "0px", "0%" ],
 		other_values: [ "3%", "1px", "2em", // circular
 						"3% 2%", "1px 4px", "2em 2pt", // elliptical
 			"-moz-calc(2px)",
 			"-moz-calc(50%)",
 			"-moz-calc(3*25px)",
 			"-moz-calc(3*25px) 5px",
 			"5px -moz-calc(3*25px)",
--- a/layout/style/test/test_initial_computation.html
+++ b/layout/style/test/test_initial_computation.html
@@ -125,16 +125,25 @@ function test_property(property)
       gInitialPrereqsRuleN.style.removeProperty(prereq);
       gInitialPrereqsRuleF.style.removeProperty(prereq);
     }
   }
   if (info.inherited) {
     gElementN.parentNode.style.removeProperty(property);
     gElementF.parentNode.style.removeProperty(property);
   }
+
+  // FIXME: Something (maybe with the -moz-binding values in
+  // test_value_computation.html, but may as well do it here to match)
+  // causes gElementF's frame to get lost.  Force it to get recreated
+  // after each property.
+  gElementF.parentNode.style.display = "none";
+  get_computed_value(getComputedStyle(gElementF, ""), "width");
+  gElementF.parentNode.style.display = "";
+  get_computed_value(getComputedStyle(gElementF, ""), "width");
 }
 
 function run_tests() {
   setup_initial_values("unstyledn", "gInitialValuesN", "gInitialPrereqsRuleN");
   setup_initial_values("unstyledf", "gInitialValuesF", "gInitialPrereqsRuleF");
   for (var prop in gCSSProperties)
     test_property(prop);
   SimpleTest.finish();
--- a/layout/style/test/test_value_computation.html
+++ b/layout/style/test/test_value_computation.html
@@ -38,32 +38,29 @@
 <script class="testbody" type="text/javascript">
 
 /** Test for computation of values in property database **/
 
 var gBadComputed = {
   // These values are treated as auto.
   "page-break-after": [ "avoid" ],
   "page-break-before": [ "avoid" ],
+};
 
+var gBadComputedNoFrame = {
   // These are probably bogus tests...
   "-moz-outline-radius": [ "0%" ],
   "-moz-outline-radius-bottomleft": [ "0%" ],
   "-moz-outline-radius-bottomright": [ "0%" ],
   "-moz-outline-radius-topleft": [ "0%" ],
   "-moz-outline-radius-topright": [ "0%" ],
-  // These are probably bogus tests... (why not just when no frame?)
   "-moz-margin-end": [ "0%" ],
   "-moz-margin-start": [ "0%" ],
   "-moz-padding-end": [ "0%" ],
   "-moz-padding-start": [ "0%" ],
-};
-
-var gBadComputedNoFrame = {
-  // These are probably bogus tests...
   "margin": [ "0% 0px 0em 0pt" ],
   "margin-bottom": [ "0%" ],
   "margin-left": [ "0%" ],
   "margin-right": [ "0%" ],
   "margin-top": [ "0%" ],
   "padding": [ "0% 0px 0em 0pt" ],
   "padding-bottom": [ "0%" ],
   "padding-left": [ "0%" ],
@@ -192,16 +189,24 @@ function test_value(property, val, is_in
       gInitialPrereqsRuleN.style.removeProperty(prereq);
       gInitialPrereqsRuleF.style.removeProperty(prereq);
     }
   }
   if (info.inherited && is_initial) {
     gElementN.parentNode.style.removeProperty(property);
     gElementF.parentNode.style.removeProperty(property);
   }
+
+  // FIXME: Something (maybe with the -moz-binding values) causes
+  // gElementF's frame to get lost.  Force it to get recreated after
+  // each property.
+  gElementF.parentNode.style.display = "none";
+  get_computed_value(getComputedStyle(gElementF, ""), "width");
+  gElementF.parentNode.style.display = "";
+  get_computed_value(getComputedStyle(gElementF, ""), "width");
 }
 
 function test_property(prop) {
   var info = gCSSProperties[prop];
   for (var idx in info.initial_values)
     test_value(prop, info.initial_values[idx], true);
   for (var idx in info.other_values)
     test_value(prop, info.other_values[idx], false);