OLD | NEW |
1 if (window.testRunner) | 1 if (window.testRunner) |
2 testRunner.dumpAsText(); | 2 testRunner.dumpAsText(); |
3 | 3 |
4 description("Test CSS <length> parsing on SVG presentation attributes.") | 4 description("Test CSS <length> parsing on SVG presentation attributes.") |
5 createSVGTestCase(); | 5 createSVGTestCase(); |
6 | 6 |
7 var text = createSVGElement("text"); | 7 var text = createSVGElement("text"); |
8 text.setAttribute("id", "text"); | 8 text.setAttribute("id", "text"); |
9 text.setAttribute("x", "20px"); | 9 text.setAttribute("x", "20px"); |
10 text.setAttribute("y", "100px"); | 10 text.setAttribute("y", "100px"); |
11 text.setAttribute("visibility", "hidden"); | |
12 text.innerHTML = "Test"; | 11 text.innerHTML = "Test"; |
13 rootSVGElement.appendChild(text); | 12 rootSVGElement.appendChild(text); |
14 | 13 |
15 // Test initial value of font-length. | 14 // Test initial value of font-length. |
16 shouldBeEqualToString("document.defaultView.getComputedStyle(text, null).fontSiz
e", "16px"); | 15 shouldBeEqualToString("document.defaultView.getComputedStyle(text, null).fontSiz
e", "16px"); |
17 | 16 |
18 // Set valid font-size of 100px | 17 // Set valid font-size of 100px |
19 text.setAttribute("font-size", "100px"); | 18 text.setAttribute("font-size", "100px"); |
20 shouldBeEqualToString("document.defaultView.getComputedStyle(text, null).fontSiz
e", "100px"); | 19 shouldBeEqualToString("document.defaultView.getComputedStyle(text, null).fontSiz
e", "100px"); |
21 | 20 |
22 // Space between unit and value - invalid according strict parsing rules. | 21 // Space between unit and value - invalid according strict parsing rules. |
23 text.setAttribute("font-size", "100 px"); | 22 text.setAttribute("font-size", "100 px"); |
24 shouldBeEqualToString("document.defaultView.getComputedStyle(text, null).fontSiz
e", "16px"); | 23 shouldBeEqualToString("document.defaultView.getComputedStyle(text, null).fontSiz
e", "16px"); |
25 | 24 |
26 // Space within the value - invalid according strict parsing rules. | 25 // Space within the value - invalid according strict parsing rules. |
27 text.setAttribute("font-size", "10 0px"); | 26 text.setAttribute("font-size", "10 0px"); |
28 shouldBeEqualToString("document.defaultView.getComputedStyle(text, null).fontSiz
e", "16px"); | 27 shouldBeEqualToString("document.defaultView.getComputedStyle(text, null).fontSiz
e", "16px"); |
29 | 28 |
30 var successfullyParsed = true; | 29 var successfullyParsed = true; |
31 | 30 |
32 completeTest(); | 31 completeTest(); |
OLD | NEW |