OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> | 4 <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> |
5 <title>Letter spacing and Ligature</title> | 5 <title>Letter spacing and Ligature</title> |
6 | 6 |
7 <style type="text/css"> | 7 <style type="text/css"> |
8 @font-face { | 8 @font-face { |
9 font-family: megalopolis; | 9 font-family: megalopolis; |
10 src: url(../../third_party/MEgalopolis/MEgalopolisExtra.woff) format("woff"); | 10 src: url(../../third_party/MEgalopolis/MEgalopolisExtra.woff) format("woff"); |
11 } | 11 } |
12 | 12 |
13 .dligDiv { | 13 .dligDiv { |
14 -moz-font-feature-settings:"frac" 1, "dlig" 1; | 14 -moz-font-feature-settings:"frac" 1, "dlig" 1; |
15 -moz-font-feature-settings:"frac=1, dlig=1"; | 15 -moz-font-feature-settings:"frac=1, dlig=1"; |
16 -ms-font-feature-settings:"frac" 1, "dlig" 1; | 16 -ms-font-feature-settings:"frac" 1, "dlig" 1; |
17 -o-font-feature-settings:"frac" 1, "dlig" 1; | 17 -o-font-feature-settings:"frac" 1, "dlig" 1; |
18 -webkit-font-feature-settings:"frac" 1, "dlig" 1; | 18 -webkit-font-feature-settings:"frac" 1, "dlig" 1; |
19 font-feature-settings:"frac" 1, "dlig" 1; | 19 font-feature-settings:"frac" 1, "dlig" 1; |
20 } | 20 } |
21 | 21 |
| 22 .fontVariantDiv { |
| 23 font-variant-ligatures: discretionary-ligatures; |
| 24 } |
| 25 |
22 .common { | 26 .common { |
23 font-size: 24px; | 27 font-size: 24px; |
24 line-height: 100%; | 28 line-height: 100%; |
25 padding: 0px; | 29 padding: 0px; |
26 letter-spacing:20px; | 30 letter-spacing:20px; |
27 font-family: megalopolis; | 31 font-family: megalopolis; |
28 } | 32 } |
29 | 33 |
30 p { font-family: serif; font-style: italic; } | 34 p { font-family: serif; font-style: italic; } |
31 </style> | 35 </style> |
32 | 36 |
33 <script src="../../resources/testharness.js"></script> | 37 <script src="../../resources/testharness.js"></script> |
34 <script src="../../resources/testharnessreport.js"></script> | 38 <script src="../../resources/testharnessreport.js"></script> |
35 <script> | 39 <script> |
36 setup({ explicit_done: true }); | 40 setup({ explicit_done: true }); |
37 function testLetterSpaceAndLigature() { | 41 function testLetterSpaceAndLigature(element) { |
38 var elementWidthWithLigatureAndLetterSpacing = document.getElementsByCla
ssName("dligSpan")[0].getBoundingClientRect().width; | 42 var elementWidthWithLigatureAndLetterSpacing = element.getBoundingClient
Rect().width; |
39 var elementWidthWithLetterSpacing = document.getElementsByClassName("let
terSpace")[0].getBoundingClientRect().width; | 43 var elementWidthWithLetterSpacing = letterSpace.getBoundingClientRect().
width; |
40 test(function() { | 44 test(function() { |
41 assert_equals(elementWidthWithLigatureAndLetterSpacing, elementWidth
WithLetterSpacing, "Ligature not applied due to letter spacing."); | 45 assert_equals(elementWidthWithLigatureAndLetterSpacing, elementWidth
WithLetterSpacing, "Ligature not applied due to letter spacing."); |
42 }, "Ligature expected not to be applied due to letter spacing."); | 46 }, "Ligature expected not to be applied due to letter spacing."); |
| 47 } |
| 48 |
| 49 function runTest() { |
| 50 testLetterSpaceAndLigature(dligSpan); |
| 51 testLetterSpaceAndLigature(fontVariantSpan); |
43 done(); | 52 done(); |
44 } | 53 } |
45 </script> | 54 </script> |
46 </head> | 55 </head> |
47 <body onload="testLetterSpaceAndLigature();"> | 56 <body onload="runTest();"> |
48 <div class="dligDiv common"> | 57 <div class="dligDiv common"> |
49 <span class="dligSpan">CACACACA</span> | 58 <span id="dligSpan">CACACACA</span> |
| 59 </div> |
| 60 |
| 61 <div class="fontVariantDiv common"> |
| 62 <span id="fontVariantSpan">CACACACA</span> |
50 </div> | 63 </div> |
51 | 64 |
52 <div class="common"> | 65 <div class="common"> |
53 <span class="letterSpace">CACACACA</span> | 66 <span id="letterSpace">CACACACA</span> |
54 </div> | 67 </div> |
55 </body> | 68 </body> |
56 </html> | 69 </html> |
OLD | NEW |