tor-browser

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

block-ellipsis-repaint-003.html (1604B)


      1 <!DOCTYPE html>
      2 <html class="reftest-wait">
      3 <meta charset="utf-8">
      4 <title>CSS Overflow: line-clamp ellipsis repaint tests</title>
      5 <link rel="author" title="Andreu Botella" href="mailto:abotella@igalia.com">
      6 <link rel="help" href="https://drafts.csswg.org/css-overflow-4/#block-ellipsis">
      7 <link rel="match" href="reference/block-ellipsis-repaint-003-ref.html">
      8 <meta name="assert" content="This test makes sure that, if the line with the ellipsis gets moved vertically because the height of previous lines grows, the ellipsis moves correspondingly; and that this happens even when the height of the line-clamp container does not change. This is the case even if the ellipsis completely displaces the line it's in.">
      9 <script src="/common/reftest-wait.js"></script>
     10 <style>
     11 .clamp {
     12  line-clamp: 2;
     13  border: 1px solid black;
     14  padding: 4px;
     15  background-color: yellow;
     16  height: 3lh;
     17  width: 400px;
     18 
     19  position: relative;
     20  z-index: 0;
     21 }
     22 #abspos {
     23  position: absolute;
     24  top: calc(1lh + 4px);
     25  left: 4px;
     26  height: 1lh;
     27  width: 2em;
     28 
     29  background-color: pink;
     30  z-index: -1;
     31 }
     32 #line1 {
     33  line-height: 2lh;
     34 }
     35 #wide-atomic {
     36  display: inline-block;
     37  width: 500px;
     38 }
     39 </style>
     40 
     41 <p>The ellipsis should appear inside the pink box.</p>
     42 
     43 <div class="clamp">
     44  <div id="abspos"></div>
     45  <span id="line1">Line 1</span> <br>
     46  <span id="wide-atomic"></span>
     47  Line 2
     48 </div>
     49 
     50 <script>
     51  window.onload = () => {
     52    requestAnimationFrame(() => {
     53      requestAnimationFrame(() => {
     54        document.getElementById("line1").style.lineHeight = "initial";
     55        takeScreenshot();
     56      });
     57    });
     58  };
     59 </script>