tor-browser

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

empty-text-baseline-001.html (1482B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <title>CSS Test: An Empty Text Node Should Not Generate a Baseline</title>
      4 <link rel="author" title="David Shin" href="mailto:dshin@mozilla.com">
      5 <link rel="help" href="https://drafts.csswg.org/css-display-3/#intro">
      6 <link rel="help" href="https://github.com/w3c/csswg-drafts/issues/9606">
      7 <link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1855583">
      8 <link rel="stylesheet" href="/fonts/ahem.css">
      9 <script src="/resources/testharness.js"></script>
     10 <script src="/resources/testharnessreport.js"></script>
     11 <style>
     12 body {
     13  margin: 0;
     14 }
     15 
     16 #container {
     17  font-family: Ahem;
     18 }
     19 
     20 #inner {
     21  display: inline-block;
     22 }
     23 </style>
     24 <div id="container"><div id="inner">x</div><span id="span">x</span></div>
     25 <script>
     26 const expected = span.offsetTop;
     27 
     28 // Force an empty text node on the second line of #inner
     29 inner.appendChild(document.createElement("br"));
     30 inner.appendChild(document.createTextNode(''));
     31 
     32 test(function() {
     33  assert_equals(span.offsetTop, expected);
     34 }, "Empty second line in #inner does not generate baseline for #span");
     35 
     36 test(function() {
     37  inner.style = "white-space: pre-line";
     38  assert_equals(span.offsetTop, expected);
     39 }, "Empty second line in #inner does not generate baseline for #span with white-space: pre-line");
     40 
     41 test(function() {
     42  inner.style = "white-space: pre";
     43  assert_equals(span.offsetTop, expected);
     44 }, "Empty second line in #inner does not generate baseline for #span with white-space: pre");
     45 </script>