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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/css/font-shorthand-from-longhands.html

Issue 1820773002: getComputedStyle() should return used value for 'line-height' (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <style> 4 <style>
5 @font-face { 5 @font-face {
6 font-family: "foobar"; 6 font-family: "foobar";
7 src: local("foobar"); 7 src: local("foobar");
8 } 8 }
9 div { 9 div {
10 font-family: "foobar"; 10 font-family: "foobar";
(...skipping 18 matching lines...) Expand all
29 function checkFontStyleValue() { 29 function checkFontStyleValue() {
30 var before = e.style.getPropertyValue('font'); 30 var before = e.style.getPropertyValue('font');
31 e.style.font = ''; 31 e.style.font = '';
32 e.style.font = before; 32 e.style.font = before;
33 return (e.style.getPropertyValue('font') === before); 33 return (e.style.getPropertyValue('font') === before);
34 } 34 }
35 35
36 style.fontSize = "20px"; 36 style.fontSize = "20px";
37 // We need all font longhands to build the shorthand. 37 // We need all font longhands to build the shorthand.
38 shouldBe("style.font", "''"); 38 shouldBe("style.font", "''");
39 shouldBe("computedStyle.font", "'normal normal normal normal 20px / normal fooba r'"); 39 shouldBe("computedStyle.font", "'normal normal normal normal 20px / 23px foobar' ");
40 shouldBe("computedStyle.fontSize", "'20px'"); 40 shouldBe("computedStyle.fontSize", "'20px'");
41 shouldBe("checkFontStyleValue()", "true"); 41 shouldBe("checkFontStyleValue()", "true");
42 42
43 style.fontSize = "20px"; 43 style.fontSize = "20px";
44 style.fontFamily = "sans-serif"; 44 style.fontFamily = "sans-serif";
45 shouldBe("style.font", "''"); 45 shouldBe("style.font", "''");
46 shouldBe("computedStyle.font", "'normal normal normal normal 20px / normal sans- serif'"); 46 shouldBe("computedStyle.font", "'normal normal normal normal 20px / 24px sans-se rif'");
47 shouldBe("computedStyle.fontFamily", "'sans-serif'"); 47 shouldBe("computedStyle.fontFamily", "'sans-serif'");
48 48
49 style.fontStyle = "italic"; 49 style.fontStyle = "italic";
50 shouldBe("style.font", "''"); 50 shouldBe("style.font", "''");
51 shouldBe("computedStyle.font", "'italic normal normal normal 20px / normal sans- serif'"); 51 shouldBe("computedStyle.font", "'italic normal normal normal 20px / 25px sans-se rif'");
52 shouldBe("computedStyle.fontStyle", "'italic'"); 52 shouldBe("computedStyle.fontStyle", "'italic'");
53 53
54 style.fontVariant = "small-caps"; 54 style.fontVariant = "small-caps";
55 shouldBe("style.font", "''"); 55 shouldBe("style.font", "''");
56 shouldBe("computedStyle.font", "'italic small-caps normal normal 20px / normal s ans-serif'"); 56 shouldBe("computedStyle.font", "'italic small-caps normal normal 20px / 25px san s-serif'");
57 shouldBe("computedStyle.fontVariant", "'small-caps'"); 57 shouldBe("computedStyle.fontVariant", "'small-caps'");
58 58
59 style.fontWeight = "bold"; 59 style.fontWeight = "bold";
60 shouldBe("style.font", "''"); 60 shouldBe("style.font", "''");
61 shouldBe("computedStyle.font", "'italic small-caps bold normal 20px / normal san s-serif'"); 61 shouldBe("computedStyle.font", "'italic small-caps bold normal 20px / 25px sans- serif'");
62 shouldBe("computedStyle.fontWeight", "'bold'"); 62 shouldBe("computedStyle.fontWeight", "'bold'");
63 63
64 style.lineHeight = "40px"; 64 style.lineHeight = "40px";
65 shouldBe("style.font", "''"); 65 shouldBe("style.font", "''");
66 shouldBe("computedStyle.font", "'italic small-caps bold normal 20px / 40px sans- serif'"); 66 shouldBe("computedStyle.font", "'italic small-caps bold normal 20px / 40px sans- serif'");
67 shouldBe("computedStyle.lineHeight", "'40px'"); 67 shouldBe("computedStyle.lineHeight", "'40px'");
68 68
69 style.fontStretch = "ultra-expanded"; 69 style.fontStretch = "ultra-expanded";
70 // All font longhands are set, therefore shorthand is built 70 // All font longhands are set, therefore shorthand is built
71 shouldBe("style.font", "'italic small-caps bold ultra-expanded 20px/40px sans-se rif'"); 71 shouldBe("style.font", "'italic small-caps bold ultra-expanded 20px/40px sans-se rif'");
72 shouldBe("computedStyle.font", "'italic small-caps bold ultra-expanded 20px / 40 px sans-serif'"); 72 shouldBe("computedStyle.font", "'italic small-caps bold ultra-expanded 20px / 40 px sans-serif'");
73 shouldBe("checkFontStyleValue()", "true"); 73 shouldBe("checkFontStyleValue()", "true");
74 74
75 style.font = ""; 75 style.font = "";
76 shouldBe("style.font", "''"); 76 shouldBe("style.font", "''");
77 shouldBe("computedStyle.font", "'normal normal normal normal 16px / normal fooba r'"); 77 shouldBe("computedStyle.font", "'normal normal normal normal 16px / 20px foobar' ");
78 shouldBe("checkFontStyleValue()", "true"); 78 shouldBe("checkFontStyleValue()", "true");
79 79
80 document.body.removeChild(testContainer); 80 document.body.removeChild(testContainer);
81 </script> 81 </script>
82 </body> 82 </body>
83 </html> 83 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698