content-visibility-086.html (1339B)
1 <!doctype HTML> 2 <html> 3 <meta charset="utf8"> 4 <title>Content Visibility: innerText</title> 5 <link rel="author" title="Rob Buis" href="mailto:rbuis@igalia.com"> 6 <link rel="help" href="https://drafts.csswg.org/css-contain/#content-visibility"> 7 <meta name="assert" content="innerText is empty for skipped content due to content-visibility auto"> 8 9 <script src="/resources/testharness.js"></script> 10 <script src="/resources/testharnessreport.js"></script> 11 12 <div id="container"> 13 This text should be visible. 14 <div style="content-visibility: auto"> 15 This text should be visible. 16 <div id="inner">This text is also visible.<br/> 17 </div> 18 </div> 19 <div id=spacer style="height: 300vh"></div> 20 <div style="content-visibility: auto"> 21 This text should not be visible. 22 <div id="inner2"> 23 This text is also not visible. 24 </div> 25 </div> 26 </div> 27 28 <script> 29 async_test((t) => { 30 function step1() { 31 t.step(() => { 32 assert_equals(document.getElementById("container").innerText, "This text should be visible.\nThis text should be visible.\nThis text is also visible.\n"); 33 assert_equals(document.getElementById("inner").innerText, "This text is also visible.\n"); 34 assert_equals(document.getElementById("inner2").innerText, ""); 35 }); 36 t.done(); 37 } 38 39 requestAnimationFrame(() => requestAnimationFrame(step1)); 40 }); 41 </script> 42 </html>