5 <title>Shape across element boundary test
</title>
6 <script src=
"../../../resources/js-test.js"></script>
8 section { padding-left:
1rem; }
10 display: inline-block;
13 vertical-align: middle;
16 display: inline-block;
18 vertical-align: middle;
23 <h1>Shape across element boundary test
</h1>
25 <div><span id=
"expected">سلام
</span></div>
29 <div><span id=
"split">س
<span id=
"red" style=
"color: red">ل
</span>ام
</span></div>
31 Adding a span around a character that forms a ligature.
32 Should render the same as the above, except that half
33 of the middle glyph should be red.
38 Same word with a ZWJ character to disallow the ligature.
41 <div><span id=
"isolated" style=
"color: red;">ل
</span></div>
42 The letter in red, in isolation.
47 var el
= document
.getElementById(id
);
48 return el
.getBoundingClientRect().width
;
51 if (Math
.abs(width('split') - width('expected')) > 0.1) {
52 testFailed('Width of isolated word should match width of' +
53 ' word with markup.');
55 testPassed('Width of isolated word does match width of' +
56 ' word with markup.');
59 if (Math
.abs(width('red') - width('isolated')) < 0.1) {
60 testFailed('Width of partial glyph in ligature should not' +
61 ' match width of isolated glyph.');
63 testPassed('Width of partial glyph in ligature does not' +
64 ' match width of isolated glyph.');