| <!DOCTYPE HTML> |
| <div id="dummy"></div> |
| <div id="results">This tests calc() and the CSSOM<br><br></div> |
| <script> |
| if (window.testRunner) |
| window.testRunner.dumpAsText(); |
| |
| var tests = ["10px", |
| "10px + 15px", |
| "100%", |
| "100% - 10px", |
| "10px + 10px * 5", |
| "5px + 2em + 6in", |
| "100% - 10px / 2", |
| "1px + 2em - 3rem + 4in", |
| "100px * (1 + 2 * 3 - 4 / 5)", |
| "(100px) + 200px", |
| "((((((((((100px))))))))))", |
| "flimstix"]; |
| |
| var results = document.getElementById("results"); |
| var dummy = document.getElementById("dummy"); |
| for (var i = 0; i < tests.length; ++i) { |
| var expression = tests[i]; |
| dummy.style.width = 'calc(' + expression + ')'; |
| dummy.style.width = 'calc(' + expression + ')'; |
| dummy.style.width = '-moz-calc(' + expression + ')'; |
| results.innerHTML += expression + " => " + dummy.style.width + "<br>"; |
| } |
| </script> |