Skip to content

Truly independent web browser

973 B
Raw Blame
<!DOCTYPE html>
<html class="reftest-wait">
<link rel="match" href="../expected/force-dark-inverts-backgrounds-only-ref.html">
<style>
    /* #848484, just above mid-gray, is the fixed point of the inversion, so the page behind stays put either way. */
    body { margin: 0; background: #848484; }
    #box { width: 100px; height: 100px; background: #ffffff; border: 20px solid #cc0000; }
</style>
<div id="box"></div>
<script>
    // Foreground threshold 0 inverts no foreground; background threshold 0 inverts every background, so only the box
    // fill moves. The red sits under the readable-contrast mark on purpose: the border pass isn't what's pinned here.
    if (window.internals) {
        internals.setForceDarkEnabled(true);
        internals.setForceDarkThresholds(0, 0);
    }
    requestAnimationFrame(() => {
        requestAnimationFrame(() => {
            document.documentElement.classList.remove("reftest-wait");
        });
    });
</script>
</html>