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

Side by Side Diff: LayoutTests/svg/custom/script-tests/invalid-length-units.js

Issue 302643004: [SVG2] Allow leading and trailing whitespace in svg attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@relax_todouble_wtf
Patch Set: split tests to combat slow xp trybots Created 6 years, 6 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
OLDNEW
1 description("Tests handling of invalid SVG length units."); 1 description("Tests handling of invalid SVG length units.");
2 2
3 var svgNS = "http://www.w3.org/2000/svg"; 3 var svgNS = "http://www.w3.org/2000/svg";
4 4
5 var svgRoot = document.createElementNS(svgNS, "svg"); 5 var svgRoot = document.createElementNS(svgNS, "svg");
6 document.documentElement.appendChild(svgRoot); 6 document.documentElement.appendChild(svgRoot);
7 7
8 rect = document.createElementNS(svgNS, "rect"); 8 rect = document.createElementNS(svgNS, "rect");
9 svgRoot.appendChild(rect); 9 svgRoot.appendChild(rect);
10 10
11 function trySettingLength(length, expected) 11 function trySettingLength(length, expected)
12 { 12 {
13 rect.setAttribute('x', "1234"); 13 rect.setAttribute('x', "1234");
14 shouldBe("rect.setAttribute('x', '" + length + "'); rect.x.baseVal.valueAsSt ring", expected); 14 shouldBe("rect.setAttribute('x', '" + length + "'); rect.x.baseVal.valueAsSt ring", expected);
15 } 15 }
16 16
17 trySettingLength("", "'0'"); 17 trySettingLength("", "'0'");
18 trySettingLength(" ", "'0'"); 18 trySettingLength(" ", "'0'");
19 trySettingLength("foo", "'0'"); 19 trySettingLength("foo", "'0'");
20 trySettingLength("10foo", "'0'"); 20 trySettingLength("10foo", "'0'");
21 trySettingLength("px", "'0'"); 21 trySettingLength("px", "'0'");
22 trySettingLength("10px ", "'0'"); 22 trySettingLength("10px ", "'10px'");
23 trySettingLength("10% ", "'0'"); 23 trySettingLength("10% ", "'10%'");
24 trySettingLength("10 % ", "'0'"); 24 trySettingLength("10 % ", "'0'");
25 trySettingLength("10 %", "'0'"); 25 trySettingLength("10 %", "'0'");
26 trySettingLength("10 px ", "'0'"); 26 trySettingLength("10 px ", "'0'");
27 trySettingLength("10 px", "'0'"); 27 trySettingLength("10 px", "'0'");
28 trySettingLength("10", "'10'"); 28 trySettingLength("10", "'10'");
29 trySettingLength("10%", "'10%'"); 29 trySettingLength("10%", "'10%'");
30 trySettingLength("10em", "'10em'"); 30 trySettingLength("10em", "'10em'");
31 trySettingLength("10ex", "'10ex'"); 31 trySettingLength("10ex", "'10ex'");
32 trySettingLength("10px", "'10px'"); 32 trySettingLength("10px", "'10px'");
33 trySettingLength("10cm", "'10cm'"); 33 trySettingLength("10cm", "'10cm'");
34 trySettingLength("10mm", "'10mm'"); 34 trySettingLength("10mm", "'10mm'");
35 trySettingLength("10pt", "'10pt'"); 35 trySettingLength("10pt", "'10pt'");
36 trySettingLength("10pc", "'10pc'"); 36 trySettingLength("10pc", "'10pc'");
37 37
38 document.documentElement.removeChild(svgRoot); 38 document.documentElement.removeChild(svgRoot);
39 39
40 var successfullyParsed = true; 40 var successfullyParsed = true;
OLDNEW
« no previous file with comments | « LayoutTests/svg/custom/invalid-length-units-expected.txt ('k') | LayoutTests/svg/hixie/error/015.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698