seg-break-transformation-001.tentative.html (2689B)
1 <!DOCTYPE html> 2 <html lang="en" > 3 <head> 4 <meta charset="utf-8"> 5 <title>Wide 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 W and neither side is Hangul, then the segment break is removed."> 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 space is produced for any line in the test paragraph. 58 --> 59 </body> 60 </html>