Upstream version 5.34.92.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / fast / text / sub-pixel / text-scaling-webfont.html
1 <!DOCTYPE>
2 <html>
3     <head>
4         <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5         <link rel="stylesheet" type="text/css" href="resources/text-scaling.css">
6         <style>
7             @font-face {
8                 font-family: 'Open Sans';
9                 font-style: normal;
10                 font-weight: 400;
11                 src: url('../../../resources/opensans/OpenSans-Regular.woff') format('woff');
12             }
13             section > div > div {
14                 font-family: 'Open Sans';
15             }
16         </style>
17         <script src="resources/text-scaling.js"></script>
18         <script src="../../../resources/js-test.js"></script>
19     </head>
20     <body>
21         <section>
22             <h1>Font Size Scaling (WebFont, Latin)</h1>
23             <p>
24                 Size of the text should scale smoothly.
25                 Reported width should be within 0.01px of that of the highlighted reference row.
26             </p>
27             <div id="test"></div>
28         </section>
29         <script>
30             if (window.testRunner && window.testRunner.setTextSubpixelPositioning)
31                 window.testRunner.setTextSubpixelPositioning(true);
32
33             var PANGRAM = 'My faxed joke won a pager in the cable TV quiz show.';
34             var results = runTest(document.getElementById('test'), PANGRAM);
35             
36             if (results == PASS) {
37                 testPassed('Size of text scales smoothly and width scales with font size as expected.');
38                 
39                 // Hide text if test passes as the actual numbers are
40                 // different across platforms and would require platform
41                 // specific baselines.
42                 if (window.testRunner)
43                     document.getElementById('test').style.display = 'none';
44             } else {
45                 testFailed('Size of text does not scale smoothly, reported widths highlighted in red do not match reference row.');
46             }
47         </script>
48     </body>
49 </html>