tor-browser

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

pseudo-with-classes-new-with-class-old-without.html (1162B)


      1 <!DOCTYPE html>
      2 <html class=reftest-wait>
      3 <title>View transition classes: view-transition-class should apply if applied only in new state</title>
      4 <link rel="help" href="https://drafts.csswg.org/css-transitions-2/">
      5 <link rel="author" href="mailto:nrosenthal@chromium.org">
      6 <link rel="match" href="pseudo-with-classes-ref.html">
      7 <script src="/common/rendering-utils.js"></script>
      8 <script src="/common/reftest-wait.js"></script>
      9 
     10 <style>
     11 div {
     12  width: 100px;
     13  height: 100px;
     14  position: absolute;
     15 }
     16 
     17 #target {
     18  background: green;
     19  view-transition-name: target;
     20 }
     21 
     22 #target.new-state {
     23  view-transition-class: cls;
     24 }
     25 
     26 ::view-transition-group(*),
     27 ::view-transition-image-pair(*),
     28 ::view-transition-old(*),
     29 ::view-transition-new(*) {
     30  animation-play-state: paused;
     31 }
     32 
     33 ::view-transition-new(*.cls),
     34 ::view-transition-old(*.cls) {
     35  left: 100px;
     36 }
     37 
     38 </style>
     39 <div id=target></div>
     40 
     41 <script>
     42 failIfNot(document.startViewTransition, "Missing document.startViewTransition");
     43 
     44 window.addEventListener("load", () => {
     45  document.startViewTransition(() => {
     46    document.getElementById("target").classList.add("new-state");
     47  }).ready.then(takeScreenshot);
     48 });
     49 </script>