tor-browser

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

minHeight.html (1071B)


      1 <!DOCTYPE html>
      2 <script src="/resources/testharness.js"></script>
      3 <script src="/resources/testharnessreport.js"></script>
      4 
      5 <div id='container'>
      6 <div id='element'></div>
      7 </div>
      8 
      9 <script>
     10 var element = document.getElementById('element');
     11 var container = document.getElementById('container');
     12 
     13 test(function() {
     14    element.style.fontSize = '10px';
     15    var player = element.animate([{minHeight: '3em'}, {minHeight: '5em'}], 10);
     16    player.pause();
     17    player.currentTime = 5;
     18    element.style.fontSize = '20px';
     19    assert_equals(getComputedStyle(element).minHeight, '80px');
     20 }, 'minHeight responsive to style changes');
     21 
     22 test(function() {
     23    element.style.fontSize = '10px';
     24    var player = element.animate([{minHeight: '40px'}, {minHeight: 'calc(40px - 2em)'}], 10);
     25    player.pause();
     26 
     27    player.currentTime = 5;
     28    element.style.fontSize = '40px';
     29    assert_equals(getComputedStyle(element).minHeight, '20px');
     30 
     31    player.currentTime = 7.5;
     32    assert_equals(getComputedStyle(element).minHeight, '10px');
     33 }, 'minHeight clamped to 0px on keyframes');
     34 
     35 </script>