|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <!-- |
|
4 https://bugzilla.mozilla.org/show_bug.cgi?id=897094 |
|
5 |
|
6 This test verifies that: |
|
7 (1) Mismatched parentheses in a CSS function prevent parsing of subsequent CSS |
|
8 properties. |
|
9 (2) Properly matched parentheses do not prevent parsing of subsequent CSS |
|
10 properties. |
|
11 --> |
|
12 <head> |
|
13 <title>Test for Bug 897094</title> |
|
14 <script type="text/javascript" src="/MochiKit/MochiKit.js"></script> |
|
15 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
16 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> |
|
17 </head> |
|
18 <body> |
|
19 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=897094">Mozilla Bug 897094</a> |
|
20 <p id="display"></p> |
|
21 <div id="content" style="display: none"> |
|
22 <div id="target"></div> |
|
23 </div> |
|
24 <pre id="test"> |
|
25 <script class="testbody" type="text/javascript"> |
|
26 |
|
27 /** Test for Bug 897094 **/ |
|
28 function check_parens(declaration, parens_are_balanced) |
|
29 { |
|
30 var element = document.getElementById("target"); |
|
31 element.setAttribute("style", |
|
32 "background-color: " + (parens_are_balanced ? "red" : "green") + "; " + |
|
33 declaration + "; " + |
|
34 "background-color: " + (parens_are_balanced ? "green" : "red") + "; "); |
|
35 var resultColor = element.style.getPropertyValue("background-color"); |
|
36 is(resultColor, "green", "parenthesis balancing within " + declaration); |
|
37 } |
|
38 |
|
39 check_parens("transform: scale()", true); |
|
40 check_parens("transform: scale(", false); |
|
41 check_parens("transform: scale(,)", true); |
|
42 check_parens("transform: scale(,", false); |
|
43 check_parens("transform: scale(1)", true); |
|
44 check_parens("transform: scale(1", false); |
|
45 check_parens("transform: scale(1,)", true); |
|
46 check_parens("transform: scale(1,", false); |
|
47 check_parens("transform: scale(1,1)", true); |
|
48 check_parens("transform: scale(1,1", false); |
|
49 check_parens("transform: scale(1,1,)", true); |
|
50 check_parens("transform: scale(1,1,", false); |
|
51 check_parens("transform: scale(1,1,1)", true); |
|
52 check_parens("transform: scale(1,1,1", false); |
|
53 check_parens("transform: scale(1,1,1,)", true); |
|
54 check_parens("transform: scale(1,1,1,", false); |
|
55 check_parens("transform: scale(1px)", true); |
|
56 check_parens("transform: scale(1px", false); |
|
57 check_parens("transform: scale(1px,)", true); |
|
58 check_parens("transform: scale(1px,", false); |
|
59 |
|
60 </script> |
|
61 </pre> |
|
62 </body> |
|
63 </html> |