seg-break-transformation-014.tentative.html (2803B)
1 <!DOCTYPE html> 2 <html lang="en" > 3 <head> 4 <meta charset="utf-8"> 5 <title>Thai characters around line break</title> 6 <link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'> 7 <link rel='help' href='https://drafts.csswg.org/css-text-3/#line-break-transform'> 8 <meta name="assert" content="If the East Asian Width property of both the character before and after the line feed is F, W or H and neither side is Hangul, then the segment break is removed. Otherwise, the segment break is converted to a space."> 9 <style type='text/css'> 10 /* the CSS below is not part of the test */ 11 .test span { font-size: 24px; font-family: sans-serif; background-color: #2AA5F7; color: white; } 12 .ref span { font-size: 24px; font-family: sans-serif; background-color: #270CEF; color: white; } 13 </style> 14 <script src="/resources/testharness.js"></script> 15 <script src="/resources/testharnessreport.js"></script> 16 </head> 17 <body> 18 <div id='log'></div> 19 <div id='test1' class="test"><span>ภาษา 20 ไทย</span></div> 21 <div id='test2' class="test"><span>ภาษา    22 ไทย</span></div> 23 <div id='test3' class="test"><span>ภาษา 24         ไทย</span></div> 25 <div id='test4' class="test"><span>ภาษา    26      ไทย</span></div> 27 <div id='test5' class="test"><span>ภาษา 28 29 30 ไทย</span></div> 31 <div id='test6' class="test"><span>ภาษา   32     33     34    ไทย</span></div> 35 <div id="ref" class="ref"><span>ภาษา ไทย</span></div> 36 <script> 37 test(function() { 38 assert_equals(document.getElementById('test1').firstChild.offsetWidth, document.getElementById('ref').firstChild.offsetWidth); 39 }, "linebreak only"); 40 test(function() { 41 assert_equals(document.getElementById('test2').firstChild.offsetWidth, document.getElementById('ref').firstChild.offsetWidth); 42 }, "spaces linebreak"); 43 test(function() { 44 assert_equals(document.getElementById('test3').firstChild.offsetWidth, document.getElementById('ref').firstChild.offsetWidth); 45 }, "linebreak spaces"); 46 test(function() { 47 assert_equals(document.getElementById('test4').firstChild.offsetWidth, document.getElementById('ref').firstChild.offsetWidth); 48 }, "spaces linebreak spaces"); 49 test(function() { 50 assert_equals(document.getElementById('test5').firstChild.offsetWidth, document.getElementById('ref').firstChild.offsetWidth); 51 }, "multiple linebreaks"); 52 test(function() { 53 assert_equals(document.getElementById('test6').firstChild.offsetWidth, document.getElementById('ref').firstChild.offsetWidth); 54 }, "multiple linebreaks + spaces"); 55 </script> 56 <!-- Notes: 57 The assertion will fail if more or less than one space is produced for any line in the test paragraph. 58 --> 59 </body> 60 </html>