tor-browser

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

border-inline-width-computed.html (3221B)


      1 <!DOCTYPE html>
      2 <html>
      3 <head>
      4 <meta charset="utf-8">
      5 <title>CSS Logical Properties and Values: getComputedStyle().borderInlineWidth</title>
      6 <link rel="help" href="https://drafts.csswg.org/css-logical/#propdef-border-inline-width">
      7 <meta name="assert" content="border-inline-width is absolute length; zero if the border block style is none or hidden.">
      8 <script src="/resources/testharness.js"></script>
      9 <script src="/resources/testharnessreport.js"></script>
     10 <script src="/css/support/computed-testcommon.js"></script>
     11 </head>
     12 <body>
     13 <div id="box"></div>
     14 <div id="target"></div>
     15 <style>
     16  #box {
     17    border-style: dotted; /* Avoid border-*-width computed style 0 */
     18    border-top-width: thin;
     19    border-right-width: medium;
     20    border-bottom-width: thick;
     21  }
     22  #target {
     23    font-size: 40px;
     24    border-inline-style: dotted; /* Avoid border-inline-*-width computed style 0 */
     25  }
     26 </style>
     27 <script>
     28 'use strict';
     29 const box = document.getElementById('box');
     30 const thinWidth = getComputedStyle(box).borderTopWidth;
     31 const mediumWidth = getComputedStyle(box).borderRightWidth;
     32 const thickWidth = getComputedStyle(box).borderBottomWidth;
     33 
     34 test_computed_value("border-inline-start-width", "calc(10px + 0.5em)", "30px");
     35 test_computed_value("border-inline-start-width", "calc(10px - 0.5em)", "0px");
     36 test_computed_value("border-inline-start-width", "thin", thinWidth);
     37 test_computed_value("border-inline-start-width", "medium", mediumWidth);
     38 
     39 test_computed_value("border-inline-end-width", "calc(10px + 0.5em)", "30px");
     40 test_computed_value("border-inline-end-width", "calc(10px - 0.5em)", "0px");
     41 test_computed_value("border-inline-end-width", "thick", thickWidth);
     42 
     43 test_computed_value("border-inline-width", "10px");
     44 test_computed_value("border-inline-width", "10px 20px");
     45 test_computed_value("border-inline-width", "10px 10px", "10px");
     46 test(() => {
     47  box.style.borderInlineStartWidth = '10px';
     48  box.style.borderInlineEndWidth = '10px';
     49 
     50  box.style.borderInlineStartStyle = 'groove';
     51  box.style.borderInlineEndStyle = 'solid';
     52  assert_equals(getComputedStyle(box).borderInlineStartWidth, '10px');
     53  assert_equals(getComputedStyle(box).borderInlineEndWidth, '10px');
     54  assert_equals(getComputedStyle(box).borderInlineWidth, '10px');
     55 
     56  box.style.borderInlineStartStyle = 'hidden';
     57  box.style.borderInlineEndStyle = 'dashed';
     58  assert_equals(getComputedStyle(box).borderInlineStartWidth, '0px');
     59  assert_equals(getComputedStyle(box).borderInlineEndWidth, '10px');
     60  assert_equals(getComputedStyle(box).borderInlineWidth, '0px 10px');
     61 
     62  box.style.borderInlineStartStyle = 'inset';
     63  box.style.borderInlineEndStyle = 'none';
     64  assert_equals(getComputedStyle(box).borderInlineStartWidth, '10px');
     65  assert_equals(getComputedStyle(box).borderInlineEndWidth, '0px');
     66  assert_equals(getComputedStyle(box).borderInlineWidth, '10px 0px');
     67 
     68  box.style.borderInlineStartStyle = 'none';
     69  box.style.borderInlineEndStyle = 'hidden';
     70  assert_equals(getComputedStyle(box).borderInlineStartWidth, '0px');
     71  assert_equals(getComputedStyle(box).borderInlineEndWidth, '0px');
     72  assert_equals(getComputedStyle(box).borderInlineWidth, '0px');
     73 }, 'width is zero if the border block style is none or hidden');
     74 </script>
     75 </body>
     76 </html>