Status: FAIL | Duration: 10ms | Subtests: 0/1 | Open test on wpt.live | Open ref on wpt.live | wpt.fyi
/css/css-highlight-api/painting/custom-highlight-dynamic-container-metrics-005.html
<!DOCTYPE html> <meta charset="UTF-8"> <title>CSS Highlight API Test: Highlight disappears when container query stops matching</title> <link rel="help" href="https://drafts.csswg.org/css-highlight-api-1/"> <link rel="help" href="https://drafts.csswg.org/css-pseudo/#highlight-styling"> <link rel="help" href="https://drafts.csswg.org/css-conditional-5/#container-lengths"> <link rel="match" href="custom-highlight-dynamic-container-metrics-005-ref.html"> <meta name="assert" value="a highlight decoration disappears when a container query stops matching after a container resize"> <head> <style> .wrapper { container: wrapper / size; width: 200px; height: 100px; } .resize { width: 400px; height: 200px; } @container (width < 300px) { .wrapper::highlight(highlight1) { text-underline-offset: 2cqw; text-decoration-line: underline; text-decoration-color: green; text-decoration-thickness: 4cqh; } } </style> </head> <body> <div id="h1" class="wrapper">No highlight expected</div> <div id="h2">Should be no highlight</div> <script> let r1 = new Range(); r1.setStart(h1, 0); r1.setEnd(h1, 1); let r2 = new Range(); r2.setStart(h2, 0); r2.setEnd(h2, 1); CSS.highlights.set("highlight1", new Highlight(r1, r2)); requestAnimationFrame(() => { h1.classList.add('resize'); requestAnimationFrame(() => takeScreenshot()); }); </script> </body> </html>
/css/css-highlight-api/painting/custom-highlight-dynamic-container-metrics-005-ref.html
<!DOCTYPE html> <meta charset="UTF-8"> <title>CSS Highlight API Test Reference</title> <head> <style> .wrapper { width: 400px; height: 200px; } </style> </head> <body> <div class="wrapper">No highlight expected</div> <div>Should be no highlight</div> </body>