Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / text / fractional-word-and-letter-spacing-with-kerning.html
blobc76a176aa830baa20d100aa3b4a35b3ef324654e
1 <!DOCTYPE html>
2 <style>
3 div {
4 text-rendering: optimizeLegibility;
5 white-space:nowrap;
7 </style>
8 <script src="../../resources/js-test.js"></script>
9 <p>For each pair of paragraphs, the second one should be wider than the first one.</p>
10 <div id="ls0">
11 This test ensures that we properly accumulate sub-pixel word and letter spacing: <a href="http://crbug.com/336358">bug 336358</a>.
12 </div>
13 <div id="ls005" style="letter-spacing: 0.05em">
14 This test ensures that we properly accumulate sub-pixel word and letter spacing: <a href="http://crbug.com/336358">bug 336358</a>.
15 </div>
16 <div id="ws0">
17 Pack Emil's box with five dozen <a href="#pangram">liquor jugs</a>!
18 </div>
19 <div id="ws005" style="word-spacing: 0.05em">
20 Pack Emil's box with five dozen <a href="#pangram">liquor jugs</a>!
21 </div>
22 <script>
23 description("This test confirms fractional values for word- and letter-spacing are not truncated in complex path.");
25 function getWidth(element) {
26 if (window.getComputedStyle(element).display != 'block')
27 return elment.offsetWidth;
28 var child = element.firstChild;
29 if (!child)
30 return 0;
31 if (child === element.lastChild)
32 return getWidth(child);
33 var span = document.createElement('span');
34 while (child = element.firstChild)
35 span.appendChild(child);
36 element.appendChild(span);
37 return span.offsetWidth;
40 shouldBeCloseTo('getWidth(ls005)-getWidth(ls0)', 73, 1);
41 shouldBeCloseTo('getWidth(ws005)-getWidth(ws0)', 5, 1); // 7*0.05em = 5.6px.
42 </script>