sergio@webkit.org | 7d7118f | 2013-06-11 07:10:00 +0000 | [diff] [blame] | 1 | <!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. "User agents must close all open constructs ... at the end of the style sheet." |
| 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 |
| 21 | all braces and parentheses are closed.</div> |
| 22 | <div id="console"></div> |
| 23 | <script> |
| 24 | if (window.testRunner) |
| 25 | testRunner.dumpAsText(); |
| 26 | |
| 27 | var NUMBER_OF_TESTS = 3; |
| 28 | var failed = false; |
| 29 | var consoleElement = document.getElementById("console"); |
| 30 | for (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 | } |
| 42 | if (!failed) { |
| 43 | consoleElement.textContent += "All tests passed\n"; |
| 44 | } |
| 45 | </script> |
| 46 | </body> |