Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/compositing/mix-blend-mode/mix-blend-mode-stacking-context-002.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html class="reftest-wait">
<meta charset="utf-8">
<title>CSS Compositing: mix-blend-mode changing dynamically</title>
<link rel="author" title="Oriol Brufau" href="mailto:obrufau@igalia.com">
<meta name="assert" content="Dynamic changes of mix-blend-mode can start or stop establishing a stacking context.">
<link rel="match" href="../../reference/ref-filled-green-200px-square.html">
<style>
.target {
width: 200px;
height: 100px;
position: relative;
}
.target > div {
position: absolute;
inset: 0;
z-index: -1;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div id="a" class="target" style="mix-blend-mode: normal; background: red">
<div style="background: green"></div>
</div>
<div id="b" class="target" style="mix-blend-mode: multiply; background: green">
<div style="background: red"></div>
</div>
<script src="/common/reftest-wait.js"></script>
<script>
requestAnimationFrame(() => requestAnimationFrame(() => {
document.getElementById("a").style.mixBlendMode = "multiply";
document.getElementById("b").style.mixBlendMode = "normal";
takeScreenshot();
}));
</script>
</html>