tor-browser

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

highlight-painting-shadows-vertical-ref.html (2235B)


      1 <!doctype html>
      2 <meta charset="utf-8">
      3 <title>CSS Pseudo-Elements Test: Shadows on highlights vertical text - reference</title>
      4 <link rel="author" name="Stephen Chenney" href="mailto:schenney@igalia.com">
      5 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
      6 <style>
      7    :root {
      8        font-family: Ahem;
      9        writing-mode: vertical-lr;
     10        line-height: 1;
     11        white-space: break-spaces;
     12    }
     13    #originating_shadow {
     14        color: transparent;
     15        text-shadow: 0.1em 0.1em rgba(0,0,0,0.5);
     16        position: absolute;
     17        z-index: 0;
     18        top: 10px;
     19        left: 10px;
     20    }
     21    #originating_text {
     22        color: black;
     23        position: absolute;
     24        z-index: 7;
     25        top: 10px;
     26        left: 10px;
     27    }
     28    #selection_only {
     29        color: green;
     30        text-shadow: -0.25em -0.25em rgba(0,128,0,0.5), 0.1em 0.1em rgba(0,0,0,0.5);
     31        position: absolute;
     32        z-index: 5;
     33        left: 10px;
     34    }
     35    #target {
     36        color: blue;
     37        text-shadow: 0.25em 0.25em rgba(0,0,128,0.5), 0.1em 0.1em rgba(0,0,0,0.5);
     38        position: absolute;
     39        z-index: 3;
     40        left: 10px;
     41    }
     42    #both_text {
     43        color: green;
     44        position: absolute;
     45        z-index: 4;
     46        left: 10px;
     47    }
     48    #both_shadow {
     49        color: transparent;
     50        text-shadow: 0.25em 0.25em rgba(0,0,128,0.5), -0.25em -0.25em rgba(0,128,0,0.5), 0.1em 0.1em rgba(0,0,0,0.5);
     51        position: absolute;
     52        z-index: 2;
     53        left: 10px;
     54    }
     55 </style>
     56 <p id="originating_shadow">part</p>
     57 <p id="originating_text">part</p>
     58 <p id="selection_only">ially selected </p>
     59 <p id="both_text">ta</p>
     60 <p id="both_shadow">ta</p>
     61 <p id="target">rget</p>
     62 <script>
     63    originatingCS = getComputedStyle(originating_text);
     64    selection_only.style.top = (parseFloat(originatingCS.height) + parseFloat(originatingCS.top)).toString() + "px";
     65    selectionCS = getComputedStyle(selection_only);
     66    both_text.style.top = (parseFloat(selectionCS.height) + parseFloat(selectionCS.top)).toString() + "px";
     67    both_shadow.style.top =  both_text.style.top;
     68    bothCS = getComputedStyle(both_text);
     69    target.style.top = (parseFloat(bothCS.height) + parseFloat(bothCS.top)).toString() + "px";
     70 </script>