blob: d7b49708905210484e6f61c46cde83372eb228ea [file] [log] [blame]
sergio@webkit.org7d7118f2013-06-11 07:10:00 +00001<!DOCTYPE HTML>
2<style>
3.test1 {
4 width: 1px;
5 width: calc(100px
6</style>
7<style>
8.test2 {
9 width: 1px;
10 width: calc((((((100px
11</style>
12<style>
13@media all {
14.test3 {
15 width: 1px;
16 width: calc(100px
17</style>
18<body>
19<div>Tests parsing style declarations without closing braces and parentheses. &quot;User agents must close all open constructs ... at the end of the style sheet.&quot;
20(<a href="http://www.w3.org/TR/CSS21/syndata.html#parsing-errors">http://www.w3.org/TR/CSS21/syndata.html#parsing-errors</a>). So it must be parsed as if
21all braces and parentheses are closed.</div>
22<div id="console"></div>
23<script>
24if (window.testRunner)
25 testRunner.dumpAsText();
26
27var NUMBER_OF_TESTS = 3;
28var failed = false;
29var consoleElement = document.getElementById("console");
30for (var i = 1; i <= NUMBER_OF_TESTS; i++) {
31 var div = document.createElement("DIV");
32 div.className = "test" + i;
33 document.body.appendChild(div);
34 var width = window.getComputedStyle(div).getPropertyValue("width");
35 document.body.removeChild;
36
37 if (width != "100px") {
38 consoleElement.textContent += "Test " + i + " failed\n";
39 failed = true;
40 }
41}
42if (!failed) {
43 consoleElement.textContent += "All tests passed\n";
44}
45</script>
46</body>