tor-browser

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

massive-element-on-top-of-viewport-partially-onscreen-old.html (2100B)


      1 <!DOCTYPE html>
      2 <html class=reftest-wait>
      3 <title>View transitions: massive element on top of viewport partially onscreen (old content)</title>
      4 <link rel="help" href="https://drafts.csswg.org/css-view-transitions-1/">
      5 <link rel="author" href="mailto:khushalsagar@chromium.org">
      6 <link rel="match" href="massive-element-on-top-of-viewport-partially-onscreen-ref.html">
      7 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
      8 <meta name="fuzzy" content="maxDifference=0-3;totalPixels=0-330">
      9 
     10 <script src="/common/reftest-wait.js"></script>
     11 <style>
     12 :root {
     13  font: 12px/1 Ahem;
     14 }
     15 
     16 .target {
     17  inline-size: 100px;
     18  block-size: 40000px;
     19  view-transition-name: target;
     20 }
     21 
     22 .top {
     23  inline-size: 100%;
     24  block-size: 100px;
     25  background: lightblue;
     26 }
     27 
     28 .middle {
     29  inline-size: 100%;
     30  block-size: 39800px;
     31  background: green;
     32 }
     33 
     34 .bottom {
     35  inline-size: 100%;
     36  block-size: 100px;
     37  background: blue;
     38 }
     39 
     40 .hidden {
     41  contain: paint;
     42  inline-size: 10px;
     43  block-size: 10px;
     44  background: grey;
     45  view-transition-name: hidden;
     46 }
     47 
     48 html::view-transition-group(hidden) { animation-duration: 300s; }
     49 html::view-transition-image-pair(hidden) { animation: unset; opacity: 0; }
     50 
     51 html::view-transition-old(*), html::view-transition-new(*) {
     52  object-fit: none;
     53 }
     54 
     55 html::view-transition-old(target) { animation: unset; opacity: 1; }
     56 html::view-transition-new(target) { animation: unset; opacity: 0; }
     57 
     58 </style>
     59 
     60 <div class="target">
     61  <div class="top">This text is at the top of the box</div>
     62  <div class="middle">This text is in the middle of the box</div>
     63  <div id="scrollblue" class="bottom">This text is at the bottom of the box</div>
     64 </div>
     65 <div id=hidden class=hidden></div>
     66 
     67 <script>
     68 failIfNot(document.startViewTransition, "Missing document.startViewTransition");
     69 
     70 async function runTest() {
     71  scrollblue.scrollIntoView();
     72 
     73  document.startViewTransition(() => {
     74    requestAnimationFrame(() => requestAnimationFrame(() =>
     75      requestAnimationFrame(() => requestAnimationFrame(takeScreenshot))
     76    ));
     77  });
     78 }
     79 onload = () => requestAnimationFrame(() => requestAnimationFrame(runTest));
     80 </script>