tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

seg-break-transformation-017.tentative.html (3712B)


      1 <!DOCTYPE html>
      2 <html  lang="en" >
      3 <head>
      4 <meta charset="utf-8">
      5 <title>Thai with ZWSP after 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 character immediately before or immediately after the segment break is the zero-width space character (U+200B), then the break is removed, leaving behind the zero-width space.">
      9 <style type='text/css'>
     10 .test span { font-size: 24px; font-family: sans-serif; background-color: #2AA5F7; color: white; }
     11 .ref span { font-size: 24px; font-family: sans-serif; background-color: #270CEF; color: white; }
     12 </style>
     13 <script src="/resources/testharness.js"></script>
     14 <script src="/resources/testharnessreport.js"></script>
     15 </head>
     16 <body>
     17 <div id='log'></div>
     18 <div id='test1' class="test"><span>ภาษา
     19 &#x200B;ไทย</span></div>
     20 <div id='test2' class="test"><span>ภาษา
     21 &#x20;&#x20;&#x20;&#x200B;ไทย</span></div>
     22 <div id='test3' class="test"><span>ภาษา&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;
     23 &#x200B;ไทย</span></div>
     24 <div id='test4' class="test"><span>ภาษา&#x20;&#x20;&#x20;
     25 &#x20;&#x20;&#x20;&#x20;&#x20;&#x200B;ไทย</span></div>
     26 <div id='test5' class="test"><span>ภาษา
     27 
     28 
     29 &#x200B;ไทย</span></div>
     30 <div id='test6' class="test"><span>ภาษา&#x20;&#x20;
     31 &#x20;&#x20;&#x20;
     32 &#x20;&#x20;&#x20;
     33 &#x20;&#x20;&#x20;&#x200B;ไทย</span></div>
     34 <div id="ref" class="ref"><span>ภาษาไทย</span></div>
     35 <script>
     36 test(function() {
     37 assert_equals(document.getElementById('test1').firstChild.offsetWidth, document.getElementById('ref').firstChild.offsetWidth);
     38 }, "linebreak only");
     39 var matches = document.getElementById('test1').firstChild.textContent.match(/\u200B/g)
     40 test(function() {
     41 assert_equals(matches.length, 1);
     42 }, "zwsp retained 1");
     43 test(function() {
     44 assert_equals(document.getElementById('test2').firstChild.offsetWidth, document.getElementById('ref').firstChild.offsetWidth);
     45 }, "spaces linebreak");
     46 var matches = document.getElementById('test2').firstChild.textContent.match(/\u200B/g)
     47 test(function() {
     48 assert_equals(matches.length, 1);
     49 }, "zwsp retained 2");
     50 test(function() {
     51 assert_equals(document.getElementById('test3').firstChild.offsetWidth, document.getElementById('ref').firstChild.offsetWidth);
     52 }, "linebreak spaces");
     53 var matches = document.getElementById('test3').firstChild.textContent.match(/\u200B/g)
     54 test(function() {
     55 assert_equals(matches.length, 1);
     56 }, "zwsp retained 3");
     57 test(function() {
     58 assert_equals(document.getElementById('test4').firstChild.offsetWidth, document.getElementById('ref').firstChild.offsetWidth);
     59 }, "spaces linebreak spaces");
     60 var matches = document.getElementById('test4').firstChild.textContent.match(/\u200B/g)
     61 test(function() {
     62 assert_equals(matches.length, 1);
     63 }, "zwsp retained 4");
     64 test(function() {
     65 assert_equals(document.getElementById('test5').firstChild.offsetWidth, document.getElementById('ref').firstChild.offsetWidth);
     66 }, "multiple linebreaks");
     67 var matches = document.getElementById('test5').firstChild.textContent.match(/\u200B/g)
     68 test(function() {
     69 assert_equals(matches.length, 1);
     70 }, "zwsp retained 5");
     71 test(function() {
     72 assert_equals(document.getElementById('test6').firstChild.offsetWidth, document.getElementById('ref').firstChild.offsetWidth);
     73 }, "multiple linebreaks + spaces");
     74 var matches = document.getElementById('test6').firstChild.textContent.match(/\u200B/g)
     75 test(function() {
     76 assert_equals(matches.length, 1);
     77 }, "zwsp retained 6");
     78 </script>
     79 <!-- Notes:
     80 The assertion will fail if space is produced for any line in the test paragraph.
     81 -->
     82 </body>
     83 </html>