yuzo@google.com | 9207843 | 2010-12-21 07:30:09 +0000 | [diff] [blame] | 1 | <!doctype html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <title>Test for Bug 26183 - [@font-face] font-family descriptor with multiple names should be discarded</title> |
| 5 | <style> |
| 6 | .testtext { |
| 7 | font-size: 64px; |
| 8 | font-family: Arial; |
| 9 | border: solid 1px; |
| 10 | } |
| 11 | @font-face { |
| 12 | font-family: myfont1, myfont2; |
| 13 | src: local(Courier); |
| 14 | } |
| 15 | </style> |
mark.lam@apple.com | 104d993 | 2013-09-07 22:20:15 +0000 | [diff] [blame] | 16 | <script src="../../resources/js-test-pre.js"></script> |
yuzo@google.com | 9207843 | 2010-12-21 07:30:09 +0000 | [diff] [blame] | 17 | </head> |
| 18 | <body onload="test()"> |
| 19 | <div id="description"></div> |
| 20 | Test:<br/> |
| 21 | <span id="testText" class="testtext" style="font-family: myfont1, Arial">Text iii</span><br/> |
| 22 | Must match:<br/> |
| 23 | <span id="mustMatch" class="testtext" style="font-family: Arial">Text iii</span><br/> |
| 24 | Must not match:<br/> |
| 25 | <span id="mustNotMatch" class="testtext" style="font-family: Courier">Text iii</span><br/> |
| 26 | <div id="console"></div> |
| 27 | <script> |
rniwa@webkit.org | 38608af | 2012-06-19 07:23:13 +0000 | [diff] [blame] | 28 | if (window.testRunner) |
| 29 | window.testRunner.dumpAsText(); |
yuzo@google.com | 9207843 | 2010-12-21 07:30:09 +0000 | [diff] [blame] | 30 | |
| 31 | description("font-family descriptor in @font-face rule can take only one family. Hence the @font-face rule in this test must be ignored."); |
| 32 | |
| 33 | function test() |
| 34 | { |
| 35 | shouldBeTrue("document.getElementById('testText').offsetWidth == document.getElementById('mustMatch').offsetWidth"); |
| 36 | shouldBeTrue("document.getElementById('testText').offsetWidth != document.getElementById('mustNotMatch').offsetWidth"); |
| 37 | } |
yuzo@google.com | 9207843 | 2010-12-21 07:30:09 +0000 | [diff] [blame] | 38 | </script> |
mark.lam@apple.com | 104d993 | 2013-09-07 22:20:15 +0000 | [diff] [blame] | 39 | <script src="../../resources/js-test-post.js"></script> |
yuzo@google.com | 9207843 | 2010-12-21 07:30:09 +0000 | [diff] [blame] | 40 | </body> |
| 41 | </html> |
| 42 | |