tor-browser

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

css-text-line-break-cj-strict.html (4384B)


      1 <!DOCTYPE html>
      2 <html  lang="en" >
      3 <head>
      4 <meta charset="utf-8"/>
      5 <title>line-break:strict, Conditional Japanese Starter (CJ) (language unknown)</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-property">
      8 <script src="/resources/testharness.js"></script>
      9 <script src="/resources/testharnessreport.js"></script>
     10 <meta name="assert" content="With line-break:strict, a browser will NOT allow a conditional Japanese starter at the beginning of a line; the language being unknown makes no difference.">
     11 <style type="text/css">
     12 @font-face {
     13    font-family: 'mplus-1p-regular';
     14    src: url('/fonts/mplus-1p-regular.woff') format('woff');
     15    }
     16 #wrapper { position: relative; }
     17 .test { color: red; }
     18 .test, .ref {
     19    font-size: 30px;
     20    font-family: mplus-1p-regular, sans-serif;
     21    width: 185px;
     22    padding: 0;
     23    border: 1px solid orange;
     24    line-height: 1em;
     25    text-autospace: no-autospace;
     26 }
     27 </style>
     28 <style>
     29 .test { line-break: strict; }
     30 </style>
     31 <script>
     32 var charlist = `3041  HIRAGANA LETTER SMALL A
     33 3043  HIRAGANA LETTER SMALL I
     34 3045  HIRAGANA LETTER SMALL U
     35 3047  HIRAGANA LETTER SMALL E
     36 3049  HIRAGANA LETTER SMALL O
     37 3063  HIRAGANA LETTER SMALL TU
     38 3083  HIRAGANA LETTER SMALL YA
     39 3085  HIRAGANA LETTER SMALL YU
     40 3087  HIRAGANA LETTER SMALL YO
     41 308E  HIRAGANA LETTER SMALL WA
     42 3095  HIRAGANA LETTER SMALL KA
     43 3096  HIRAGANA LETTER SMALL KE
     44 30A1  KATAKANA LETTER SMALL A
     45 30A3  KATAKANA LETTER SMALL I
     46 30A5  KATAKANA LETTER SMALL U
     47 30A7  KATAKANA LETTER SMALL E
     48 30A9  KATAKANA LETTER SMALL O
     49 30C3  KATAKANA LETTER SMALL TU
     50 30E3  KATAKANA LETTER SMALL YA
     51 30E5  KATAKANA LETTER SMALL YU
     52 30E7  KATAKANA LETTER SMALL YO
     53 30EE  KATAKANA LETTER SMALL WA
     54 30F5  KATAKANA LETTER SMALL KA
     55 30F6  KATAKANA LETTER SMALL KE
     56 30FC  KATAKANA-HIRAGANA PROLONGED SOUND MARK
     57 31F0  KATAKANA LETTER SMALL KU
     58 31F1  KATAKANA LETTER SMALL SI
     59 31F2  KATAKANA LETTER SMALL SU
     60 31F3  KATAKANA LETTER SMALL TO
     61 31F4  KATAKANA LETTER SMALL NU
     62 31F5  KATAKANA LETTER SMALL HA
     63 31F6  KATAKANA LETTER SMALL HI
     64 31F7  KATAKANA LETTER SMALL HU
     65 31F8  KATAKANA LETTER SMALL HE
     66 31F9  KATAKANA LETTER SMALL HO
     67 31FA  KATAKANA LETTER SMALL MU
     68 31FB  KATAKANA LETTER SMALL RA
     69 31FC  KATAKANA LETTER SMALL RI
     70 31FD  KATAKANA LETTER SMALL RU
     71 31FE  KATAKANA LETTER SMALL RE
     72 31FF  KATAKANA LETTER SMALL RO
     73 FF67  HALFWIDTH KATAKANA LETTER SMALL A
     74 FF68  HALFWIDTH KATAKANA LETTER SMALL I
     75 FF69  HALFWIDTH KATAKANA LETTER SMALL U
     76 FF6A  HALFWIDTH KATAKANA LETTER SMALL E
     77 FF6B  HALFWIDTH KATAKANA LETTER SMALL O
     78 FF6C  HALFWIDTH KATAKANA LETTER SMALL YA
     79 FF6D  HALFWIDTH KATAKANA LETTER SMALL YU
     80 FF6E  HALFWIDTH KATAKANA LETTER SMALL YO
     81 FF6F  HALFWIDTH KATAKANA LETTER SMALL TU
     82 FF70  HALFWIDTH KATAKANA-HIRAGANA PROLONGED SOUND MARK`
     83 </script>
     84 </head>
     85 <body>
     86 <script>
     87 var lines = charlist.split('\n')
     88 var out = '<div id="log"></div>\n'
     89 for (var i=0;i<lines.length;i++) {
     90 // get the data
     91 var firstSpace = lines[i].indexOf(' ')
     92 var hex = lines[i].substr(0,firstSpace)
     93 var name = lines[i].substr(firstSpace)
     94 // make a test
     95 out +=  '<div class="wrapper"><div>'+hex+'</div>' +
     96 '<div class="test" id="test'+i+'" lang="">文文文文文文&#x'+hex+';字<span id="testSpan'+i+'">字</span></div>' +
     97  '<div class="ref" id="ref'+i+'" lang="">文文文文文<br/>文&#x'+hex+';字<span id="refSpan'+i+'">字</span></div>' +
     98  '</div>'
     99 }
    100 
    101 document.querySelector('body').innerHTML = out
    102 setup({explicit_done: true});
    103 
    104 document.fonts.ready.then(validate);
    105 
    106 function validate() {
    107  for (i=0;i<lines.length;i++) {
    108    test(function() {
    109      assert_approx_equals(
    110        document.getElementById('testSpan'+i).getBoundingClientRect().left,
    111        document.getElementById('refSpan'+i).getBoundingClientRect().left, 1);
    112      // Hide successful tests.
    113      document.getElementById('test'+i).parentNode.style.display = 'none';
    114    }, lines[i]+' may NOT appear at line start if strict');
    115  }
    116  done();
    117 }
    118 </script>
    119 <!--Notes:
    120 The test creates a box with room for 6 characters, causing wrapping to occur either between the 6th and the 7th character, or before the 6th if the breaks after the 6th or before the 7th are prohibited.
    121 
    122 It also creates the expected behaviour with a ref instance, using <br/>. Each line ends with a span. The test then checks whether the left edge of the span is in the same place in test and ref instance.
    123 -->
    124 </body>
    125 </html>