tor-browser

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

grid-alignment-style-changes-007.html (2434B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <title>CSS Grid Layout Test: Changing the value of Self-Alignment properties</title>
      4 <link rel="author" title="Javier Fernandez Garcia-Boente" href="mailto:jfernandez@igalia.com">
      5 <link rel="help" href="https://drafts.csswg.org/css-grid-1/#grid-align">
      6 <link rel="help" href="https://drafts.csswg.org/css-align-3/#self-alignment">
      7 <link rel="help" href="https://drafts.csswg.org/css-align-3/#justify-self-property">
      8 <link rel="help" href="https://drafts.csswg.org/css-align/#typedef-baseline-position">
      9 <meta name="assert" content="Changing the 'align-self' property's value of a grid item from 'baseline' will exclude such item from its baseline context, which implies recomputing all the baseline offsets and aligning the items left in such context.">
     10 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
     11 <style>
     12 #container {
     13  position: relative;
     14  display: inline-grid;
     15  grid: 50px 50px 50px / 100px;
     16  background: grey;
     17  justify-items: baseline;
     18  font-family: Ahem;
     19  text-orientation: sideways;
     20  line-height: 1;
     21 }
     22 #container > div { writing-mode: vertical-lr; }
     23 #item1 {
     24  font-size: 20px;
     25  background: blue;
     26 }
     27 #item2 {
     28  font-size: 40px;
     29  background: green;
     30 }
     31 #item3 {
     32  font-size: 30px;
     33  background: red;
     34 }
     35 </style>
     36 <script src="/resources/testharness.js"></script>
     37 <script src="/resources/testharnessreport.js"></script>
     38 <script src="/resources/check-layout-th.js"></script>
     39 <script src="support/style-change.js"></script>
     40 <script>
     41 setup({ explicit_done: true });
     42 function runTest() {
     43    let before = {
     44        item1: {"data-offset-x": 4 },
     45        item2: {"data-offset-x": 0 },
     46        item3: {"data-offset-x": 2 }
     47    }
     48 
     49    let after = {
     50        item1: {"data-offset-x": 2 },
     51        item2: {"data-offset-x": 60 },
     52        item3: {"data-offset-x": 0  }
     53    }
     54 
     55    evaluateStyleChangeMultiple("before", before);
     56    item2.style.justifySelf = "end";
     57    evaluateStyleChangeMultiple("after", after);
     58    done();
     59 }
     60 </script>
     61 <body onload="document.fonts.ready.then(() => { runTest(); })">
     62    <div id="container">
     63        <div id="item1" data-expected-width="20" data-expected-height="50" data-offset-y="0">É</div>
     64        <div id="item2" data-expected-width="40" data-expected-height="50" data-offset-y="50">É</div>
     65        <div id="item3" data-expected-width="30" data-expected-height="50" data-offset-y="100">É</div>
     66    </div>
     67    <div id="log"></div>
     68 </body>