blob: 7a1a21bfcd085e9acfa7a53cea382a8db7b9a1c7 [file] [log] [blame]
<!DOCTYPE HTML>
<div id="dummy"></div>
<div id="results">This tests catching of divide by 0 in calc() at parse time<br><br></div>
<script>
if (window.testRunner)
window.testRunner.dumpAsText();
var tests = [
"100px / 0",
"100px / (0)",
"100px / (2 - 2)",
"100px / (2 - (-62 + 64))",
"100px * (1 / 0)",
"100px * (1 / (0))",
"100px * (1 / (2 - 2))",
"100px * (1 / (2 - (-62 + 64)))",
];
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 + ')';
results.innerHTML += expression + " => " + dummy.style.width + "<br>";
}
</script>