3 <style type="text/css" media="all">
6 src: url(resources/ABCFont.svg#ABCFont) format('svg');
14 <script type="text/javascript">
16 if (window.layoutTestController)
17 layoutTestController.dumpAsText();
21 var div = document.createElement("div");
23 document.getElementById("console").appendChild(div);
28 var withLinebreaks = document.getElementById("svg-with-linebreaks");
29 var withoutLinebreaks = document.getElementById("svg-without-linebreaks");
31 if (withLinebreaks.offsetWidth == withoutLinebreaks.offsetWidth) {
32 log("<span style='color: green'>PASS</span>");
34 log("<span style='color: red'>FAIL</span>("
35 + withLinebreaks.offsetWidth + "px != "+ withoutLinebreaks.offsetWidth + "px)");
44 <p>This test is to ensure that text rendered with a SVG-font has the same behavior for handling
45 control characters like newlines, as text rendered though the normal (fast or complex) path.
46 The two "a b c" strings below should have the same length and not produce any missing-glyph symbols.</p>
48 <span id="svg-with-linebreaks" style="font-family: ABCFont">a
51 <span><--- This text has line breaks in the source HTML ("\n")</span>
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>
58 <div>As a reference, this is how normal text looks like for the same usecase:</div>
61 <span id="normal-with-linebreaks">a
64 <span><--- This text has line breaks in the source HTML ("\n")</span>
67 <span id="normal-without-linebreaks">a b c</span>
68 <span><--- This text has no line breaks (just "a b c")</span>
71 <div id="console"></div>