tor-browser

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

source-quirks-mode.html (1134B)


      1 <!-- Quirks mode -->
      2 <html>
      3 <head>
      4  <title>ScrollTimeline default source in quirks mode</title>
      5  <link rel="help" href="https://drafts.csswg.org/scroll-animations-1/#dom-scrolltimeline-scrolltimeline">
      6  <script src="/resources/testharness.js"></script>
      7  <script src="/resources/testharnessreport.js"></script>
      8  <style>
      9    /* This is just to make it possible for #body1 to be
     10       "potentially scrollable".
     11 
     12       https://drafts.csswg.org/cssom-view/#potentially-scrollable */
     13    html {
     14      overflow: hidden;
     15    }
     16  </style>
     17 </head>
     18 <body id=body1></body>
     19 <script>
     20 test(() => {
     21  try {
     22    assert_equals(document.scrollingElement.id, 'body1');
     23    assert_equals(new ScrollTimeline({}).source, body1);
     24 
     25    // Make #body1 "potentially scrollable". This causes the scrollingElement
     26    // of the document to become null.
     27    //
     28    // https://drafts.csswg.org/cssom-view/#dom-document-scrollingelement
     29    body1.style = 'overflow:scroll';
     30    assert_equals(new ScrollTimeline({}).source, null);
     31  } finally {
     32    body1.style = '';
     33  }
     34 }, 'Style of <body> is reflected in source attribute in quirks mode');
     35 </script>
     36 </html>