| OLD | NEW |
| (Empty) |
| 1 <head> | |
| 2 | |
| 3 <style type="text/css" media="all"> | |
| 4 @font-face { | |
| 5 font-family: ABCFont; | |
| 6 src: url(resources/ABCFont.svg#ABCFont) format('svg'); | |
| 7 } | |
| 8 | |
| 9 span { | |
| 10 margin-right: 10px; | |
| 11 } | |
| 12 </style> | |
| 13 | |
| 14 <script type="text/javascript"> | |
| 15 | |
| 16 if (window.testRunner) | |
| 17 testRunner.dumpAsText(); | |
| 18 | |
| 19 function log(msg) | |
| 20 { | |
| 21 var div = document.createElement("div"); | |
| 22 div.innerHTML = msg; | |
| 23 document.getElementById("console").appendChild(div); | |
| 24 } | |
| 25 | |
| 26 function run() | |
| 27 { | |
| 28 var withLinebreaks = document.getElementById("svg-with-linebreaks"); | |
| 29 var withoutLinebreaks = document.getElementById("svg-without-linebreaks"); | |
| 30 | |
| 31 if (withLinebreaks.offsetWidth == withoutLinebreaks.offsetWidth) { | |
| 32 log("<span style='color: green'>PASS</span>"); | |
| 33 } else { | |
| 34 log("<span style='color: red'>FAIL</span>(" | |
| 35 + withLinebreaks.offsetWidth + "px != "+ withoutLinebreaks.offse
tWidth + "px)"); | |
| 36 } | |
| 37 } | |
| 38 </script> | |
| 39 | |
| 40 </head> | |
| 41 | |
| 42 <body onload="run()"> | |
| 43 | |
| 44 <p>This test is to ensure that text rendered with a SVG-font has the same behavi
or for handling | |
| 45 control characters like newlines, as text rendered though the normal (fast or co
mplex) path. | |
| 46 The two "a b c" strings below should have the same length and not produce any mi
ssing-glyph symbols.</p> | |
| 47 <div> | |
| 48 <span id="svg-with-linebreaks" style="font-family: ABCFont">a | |
| 49 b | |
| 50 c</span> | |
| 51 <span><--- This text has line breaks in the source HTML ("\n")</span> | |
| 52 </div> | |
| 53 <div> | |
| 54 <span id="svg-without-linebreaks" style="font-family: ABCFont">a b c</span> | |
| 55 <span><--- This text has no line breaks (just "a b c")</span> | |
| 56 </div> | |
| 57 <br> | |
| 58 <div>As a reference, this is how normal text looks like for the same usecase:</d
iv> | |
| 59 <br> | |
| 60 <div> | |
| 61 <span id="normal-with-linebreaks">a | |
| 62 b | |
| 63 c</span> | |
| 64 <span><--- This text has line breaks in the source HTML ("\n")</span> | |
| 65 </div> | |
| 66 <div> | |
| 67 <span id="normal-without-linebreaks">a b c</span> | |
| 68 <span><--- This text has no line breaks (just "a b c")</span> | |
| 69 </div> | |
| 70 <br> | |
| 71 <div id="console"></div> | |
| 72 </body> | |
| 73 | |
| OLD | NEW |