Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: LayoutTests/svg/css/parse-length.html

Issue 896773002: [svg2] Make 'x' and 'y' presentation attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | LayoutTests/svg/css/parse-length-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <style>
4 * { font-size: 16px; }
5 svg, rect { font-family: 'Ahem'; }
6 div { font-size: 8px; }
7 </style>
8 <html>
9 <svg id="svg" width="0" height="0"></svg>
10 <script src="../../resources/js-test.js"></script>
11 <script>
12 description("Test that 'length' presentation attribute values are parsed with CS S presentation rules.");
13
14 function computedStyle(property, value) {
15 var rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');
16 document.getElementById('svg').appendChild(rect);
17 rect.setAttribute(property, value);
18 var computedValue = getComputedStyle(rect).getPropertyValue(property);
19 document.getElementById('svg').removeChild(rect);
20 return computedValue;
21 }
22
23 function testComputed(property, value, expected) {
24 shouldBeEqualToString('computedStyle("' + property + '", "' + value + '")', expected);
25 }
26
27 function negativeTest(property, value) {
28 testComputed(property, value, "auto");
29 }
30
31 function negativeTestZero(property, value) {
32 testComputed(property, value, "0px");
33 }
34
35 // Test 'x'.
36 testComputed("x", " 100", "100px");
37 testComputed("x", "100 ", "100px");
38 testComputed("x", "100px", "100px");
39 testComputed("x", "1em", "16px");
40 // testComputed("x", "1ex", "12.8000001907349px"); // enable this again once htt p://crbug.com/441840 is fixed
41 testComputed("x", "20%", "20%");
42 testComputed("x", "-200px", "-200px");
43
44 // Test 'y'.
45 testComputed("y", " 100", "100px");
46 testComputed("y", "100 ", "100px");
47 testComputed("y", "100px", "100px");
48 testComputed("y", "1em", "16px");
49 // testComputed("y", "1ex", "12.8000001907349px"); // enable this again once htt p://crbug.com/441840 is fixed
50 testComputed("y", "20%", "20%");
51 testComputed("y", "-200px", "-200px");
52
53 // Negative tests for 'x'.
54 negativeTestZero("x", "auto", "auto");
55 negativeTestZero("x", "100 px");
56 negativeTestZero("x", "100px;");
57 negativeTestZero("x", "100px !important");
58 negativeTestZero("x", "{ 100px }");
59
60 // Negative tests for 'y'.
61 negativeTestZero("y", "auto");
62 negativeTestZero("y", "100 px");
63 negativeTestZero("y", "100px;");
64 negativeTestZero("y", "100px !important");
65 negativeTestZero("y", "{ 100px }");
66 </script>
67 </body>
68 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/svg/css/parse-length-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698