4 https://bugzilla.mozilla.org/show_bug.cgi?id=678671
7 <title>Test for Bug
678671</title>
8 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
9 <script type=
"text/javascript" src=
"property_database.js"></script>
10 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
13 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=678671">Mozilla Bug
678671</a>
15 <div id=
"content"></div>
16 <script type=
"application/javascript">
18 /** Test for Bug
678671 **/
21 * Test 'ex' and 'ch' units in every place we possible can to make
22 * sure they don't cause an infinite loop.
25 var content = document.getElementById(
"content");
26 var cs = getComputedStyle(content,
"");
28 for (var prop in gCSSProperties) {
29 var info = gCSSProperties[prop];
30 function test_val(v) {
31 content.style.setProperty(prop, v,
"");
32 isnot(get_computed_value(cs, prop),
"",
33 "Setting '" + prop +
"' to '" + v +
"' should not cause infinite loop");
37 function test_replaced_values(value_list) {
38 // For each item in value_list, if it looks like it has a dimension
39 // in it, replace those dimensions with
3ex and
2ch and test it.
40 for (var i =
0; i < value_list.length; ++i) {
41 var value = value_list[i];
42 function try_replace(withval) {
43 var rep = value.replace(/[
0-
9.]+[a-zA-Z]+/g, withval)
52 test_replaced_values(info.initial_values);
53 test_replaced_values(info.other_values);
54 content.style.removeProperty(prop);