tor-browser

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

pre-line-with-space-and-newline.html (1444B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <title>CSS Text Test: 'white-space: pre-line' with space and newline</title>
      4 <link rel="author" title="Oriol Brufau" href="mailto:obrufau@igalia.com">
      5 <link rel="help" href="https://drafts.csswg.org/css-text/#white-space-phase-1">
      6 <link rel="help" href="https://crbug.com/1136688">
      7 <link rel="match" href="../../reference/ref-filled-green-200px-square.html">
      8 <meta name="assert" content="
      9  Checks that collapsible spaces immediately preceding a sequent break are removed.
     10  That still applies if they are separated into different inline elements.
     11  Also, if some text is inserted dynamically, the browser should not crash.">
     12 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
     13 <style>
     14 span {
     15  font: 25px/1 Ahem;
     16  background: red;
     17  color: green;
     18 }
     19 i {
     20  white-space: pre-line;
     21 }
     22 </style>
     23 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
     24 <div class="static together">
     25  <span>XXXXXXXX<i> &#10;</i>XXXXXXXX</span>
     26 </div>
     27 <div class="static separated">
     28  <span>XXXXXXXX<i> </i><i>&#10;</i>XXXXXXXX</span>
     29 </div>
     30 <div class="dynamic together">
     31  <span>XXXXXXXX<i> &#10;</i></span>
     32 </div>
     33 <div class="dynamic separated">
     34  <span>XXXXXXXX<i> </i><i>&#10;</i></span>
     35 </div>
     36 <script>
     37 // Force layout
     38 document.body.offsetLeft;
     39 
     40 // Insert text, should not crash
     41 for (let span of document.querySelectorAll(".dynamic > span")) {
     42  span.append("XXXXXXXX");
     43 }
     44 </script>