Add performance test for FontCache::systemFallbackForCharacters()
[WebKit-https.git] / PerformanceTests / Layout / word-joiner.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../resources/runner.js"></script>
5 </head>
6 <body>
7     <pre id="log"></pre>
8     <div id="target" style="width: 300px; display: none; font-family: 'Zapfino';">
9     </div>
10     <script>
11         var target = document.getElementById("target");
12         var style = target.style;
13         var locales = ["ar", "hy", "as", "iu", "ab", "hi", "am", "ka", "el", "gu", "pa", "ko", "ko", "he", "kn", "ja", "km", "lo", "aa", "ml", "my", "or", "si", "ta", "te", "dv", "th", "bo", "zh_hk", "ii"];
14
15         for (var i = 0; i < locales.length; ++i) {
16             var span = document.createElement("span");
17             span.className = "tester";
18             var joiner = document.createTextNode(String.fromCharCode(0x2060));
19             span.appendChild(joiner);
20             target.appendChild(span);
21         }
22
23         function updateLanguages() {
24             if (window.internals)
25                 internals.invalidateFontCache();
26             var testers = document.getElementsByClassName("tester");
27             for (var i = 0; i < testers.length; ++i) {
28                 testers[i].lang = locales[i];
29             }
30         }
31
32         updateLanguages();
33
34         function test() {
35             style.display = "block";
36             updateLanguages();
37             var testers = document.getElementsByClassName("tester");
38             testers[testers.length - 1].getClientRects();
39             style.display = "none";
40         }
41
42         PerfTestRunner.measureRunsPerSecond({ run: test });
43     </script>
44 </body>
45 </html>