seg-break-transformation-015.tentative.html (4605B)
1 <!DOCTYPE html> 2 <html lang="en" > 3 <head> 4 <meta charset="utf-8"> 5 <title>Thai and Latin 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 latin</span></div> 21 <div id='test2' class="test"><span>ภาษา    22 latin</span></div> 23 <div id='test3' class="test"><span>ภาษา 24         latin</span></div> 25 <div id='test4' class="test"><span>ภาษา    26      latin</span></div> 27 <div id='test5' class="test"><span>ภาษา 28 29 30 latin</span></div> 31 <div id='test6' class="test"><span>ภาษา   32     33     34    latin</span></div> 35 <div id="ref1" class="ref"><span>ภาษา latin</span></div> 36 37 <div id='test7' class="test"><span>latin 38 ภาษา</span></div> 39 <div id='test8' class="test"><span>latin    40 ภาษา</span></div> 41 <div id='test9' class="test"><span>latin 42         ภาษา</span></div> 43 <div id='test10' class="test"><span>latin    44      ภาษา</span></div> 45 <div id='test11' class="test"><span>latin 46 47 48 ภาษา</span></div> 49 <div id='test12' class="test"><span>latin   50     51     52    ภาษา</span></div> 53 <div id="ref2" class="ref"><span>latin ภาษา</span></div> 54 <script> 55 test(function() { 56 assert_equals(document.getElementById('test1').firstChild.offsetWidth, document.getElementById('ref1').firstChild.offsetWidth); 57 }, "linebreak only thai latin"); 58 test(function() { 59 assert_equals(document.getElementById('test2').firstChild.offsetWidth, document.getElementById('ref1').firstChild.offsetWidth); 60 }, "spaces linebreak thai latin"); 61 test(function() { 62 assert_equals(document.getElementById('test3').firstChild.offsetWidth, document.getElementById('ref1').firstChild.offsetWidth); 63 }, "linebreak spaces thai latin"); 64 test(function() { 65 assert_equals(document.getElementById('test4').firstChild.offsetWidth, document.getElementById('ref1').firstChild.offsetWidth); 66 }, "spaces linebreak spaces thai latin"); 67 test(function() { 68 assert_equals(document.getElementById('test5').firstChild.offsetWidth, document.getElementById('ref1').firstChild.offsetWidth); 69 }, "multiple linebreaks thai latin"); 70 test(function() { 71 assert_equals(document.getElementById('test6').firstChild.offsetWidth, document.getElementById('ref1').firstChild.offsetWidth); 72 }, "multiple linebreaks + spaces thai latin"); 73 test(function() { 74 assert_equals(document.getElementById('test7').firstChild.offsetWidth, document.getElementById('ref2').firstChild.offsetWidth); 75 }, "linebreak only latin thai"); 76 test(function() { 77 assert_equals(document.getElementById('test8').firstChild.offsetWidth, document.getElementById('ref2').firstChild.offsetWidth); 78 }, "spaces linebreak latin thai"); 79 test(function() { 80 assert_equals(document.getElementById('test9').firstChild.offsetWidth, document.getElementById('ref2').firstChild.offsetWidth); 81 }, "linebreak spaces latin thai"); 82 test(function() { 83 assert_equals(document.getElementById('test10').firstChild.offsetWidth, document.getElementById('ref2').firstChild.offsetWidth); 84 }, "spaces linebreak spaces latin thai"); 85 test(function() { 86 assert_equals(document.getElementById('test11').firstChild.offsetWidth, document.getElementById('ref2').firstChild.offsetWidth); 87 }, "multiple linebreaks latin thai"); 88 test(function() { 89 assert_equals(document.getElementById('test12').firstChild.offsetWidth, document.getElementById('ref2').firstChild.offsetWidth); 90 }, "multiple linebreaks + spaces latin thai"); 91 </script> 92 <!-- Notes: 93 The assertion will fail if space is produced for any line in the test paragraph. 94 --> 95 </body> 96 </html>