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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/HTMLFontElement/size-attribute.html

Issue 2667393002: Stop using script-tests in fast/dom/. (Closed)
Patch Set: . Created 3 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
OLDNEW
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../../resources/js-test.js"></script> 4 <script src="../../../resources/js-test.js"></script>
5 </head> 5 </head>
6 <body> 6 <body>
7 <script src="script-tests/size-attribute.js"></script> 7 <script>
8 description("HTMLFontElement size attribute test");
9
10 function fontSizeAttributeEffect(value)
11 {
12 var element = document.createElement("font");
13 element.setAttribute("size", value);
14 var outerElement = document.createElement("p");
15 outerElement.setAttribute("style", "font-size: 100px");
16 document.body.appendChild(outerElement);
17 outerElement.appendChild(element);
18 var computedStyle = getComputedStyle(element, "");
19 var result = computedStyle.fontSize;
20 document.body.removeChild(outerElement);
21 return result === "100px" ? null : result;
22 }
23
24 shouldBe('fontSizeAttributeEffect("")', 'null');
25
26 shouldBe('fontSizeAttributeEffect("1")', '"10px"');
27 shouldBe('fontSizeAttributeEffect("2")', '"13px"');
28 shouldBe('fontSizeAttributeEffect("3")', '"16px"');
29 shouldBe('fontSizeAttributeEffect("4")', '"18px"');
30 shouldBe('fontSizeAttributeEffect("5")', '"24px"');
31 shouldBe('fontSizeAttributeEffect("6")', '"32px"');
32 shouldBe('fontSizeAttributeEffect("7")', '"48px"');
33
34 shouldBe('fontSizeAttributeEffect("0")', '"10px"');
35
36 shouldBe('fontSizeAttributeEffect("-1")', '"13px"');
37 shouldBe('fontSizeAttributeEffect("-2")', '"10px"');
38 shouldBe('fontSizeAttributeEffect("-3")', '"10px"');
39 shouldBe('fontSizeAttributeEffect("-4")', '"10px"');
40 shouldBe('fontSizeAttributeEffect("-5")', '"10px"');
41 shouldBe('fontSizeAttributeEffect("-6")', '"10px"');
42 shouldBe('fontSizeAttributeEffect("-7")', '"10px"');
43 shouldBe('fontSizeAttributeEffect("-8")', '"10px"');
44 shouldBe('fontSizeAttributeEffect("-9")', '"10px"');
45 shouldBe('fontSizeAttributeEffect("-10")', '"10px"');
46
47 shouldBe('fontSizeAttributeEffect("x6")', 'null');
48 shouldBe('fontSizeAttributeEffect(" 6")', '"32px"');
49 shouldBe('fontSizeAttributeEffect("\\t6")', '"32px"');
50 shouldBe('fontSizeAttributeEffect("\\r6")', '"32px"');
51 shouldBe('fontSizeAttributeEffect("\\n6")', '"32px"');
52 shouldBe('fontSizeAttributeEffect("\\u20086")', 'null');
53
54 shouldBe('fontSizeAttributeEffect("x-6")', 'null');
55 shouldBe('fontSizeAttributeEffect(" -6")', '"10px"');
56 shouldBe('fontSizeAttributeEffect("\\t-6")', '"10px"');
57 shouldBe('fontSizeAttributeEffect("\\r-6")', '"10px"');
58 shouldBe('fontSizeAttributeEffect("\\n-6")', '"10px"');
59 shouldBe('fontSizeAttributeEffect("\\u2008-6")', 'null');
60
61 shouldBe('fontSizeAttributeEffect("x+6")', 'null');
62 shouldBe('fontSizeAttributeEffect(" +6")', '"48px"');
63 shouldBe('fontSizeAttributeEffect("\\t+6")', '"48px"');
64 shouldBe('fontSizeAttributeEffect("\\r+6")', '"48px"');
65 shouldBe('fontSizeAttributeEffect("\\n+6")', '"48px"');
66 shouldBe('fontSizeAttributeEffect("\\u2008+6")', 'null');
67
68 shouldBe('fontSizeAttributeEffect("x+x6")', 'null');
69 shouldBe('fontSizeAttributeEffect(" + 6")', 'null');
70 shouldBe('fontSizeAttributeEffect("\\t+\\t6")', 'null');
71 shouldBe('fontSizeAttributeEffect("\\r+\\r6")', 'null');
72 shouldBe('fontSizeAttributeEffect("\\n+\\n6")', 'null');
73 shouldBe('fontSizeAttributeEffect("\\u2008+\\u20086")', 'null');
74
75 shouldBe('fontSizeAttributeEffect("x-x6")', 'null');
76 shouldBe('fontSizeAttributeEffect(" - 6")', 'null');
77 shouldBe('fontSizeAttributeEffect("\\t-\\t6")', 'null');
78 shouldBe('fontSizeAttributeEffect("\\r-\\r6")', 'null');
79 shouldBe('fontSizeAttributeEffect("\\n-\\n6")', 'null');
80 shouldBe('fontSizeAttributeEffect("\\u2008-\\u20086")', 'null');
81
82 shouldBe('fontSizeAttributeEffect("8")', '"48px"');
83 shouldBe('fontSizeAttributeEffect("9")', '"48px"');
84 shouldBe('fontSizeAttributeEffect("10")', '"48px"');
85 shouldBe('fontSizeAttributeEffect("100")', '"48px"');
86 shouldBe('fontSizeAttributeEffect("1000")', '"48px"');
87
88 shouldBe('fontSizeAttributeEffect("1x")', '"10px"');
89 shouldBe('fontSizeAttributeEffect("1.")', '"10px"');
90 shouldBe('fontSizeAttributeEffect("1.9")', '"10px"');
91 shouldBe('fontSizeAttributeEffect("2x")', '"13px"');
92 shouldBe('fontSizeAttributeEffect("2.")', '"13px"');
93 shouldBe('fontSizeAttributeEffect("2.9")', '"13px"');
94
95 shouldBe('fontSizeAttributeEffect("a")', 'null');
96
97 var arabicIndicDigitOne = String.fromCharCode(0x661);
98 shouldBe('fontSizeAttributeEffect(arabicIndicDigitOne)', 'null');
99 </script>
8 </body> 100 </body>
9 </html> 101 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698