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